Skip to content

Commit

Permalink
wscript: Use INTERNAL_NAME instead of 'ardour' + MAJOR
Browse files Browse the repository at this point in the history
Replace repeated hardcoded appending of MAJOR with reuse of the existing
computed name, which is as available in env, exactly as MAJOR was.

Note: INTERNAL_NAME will sometimes be used with a prefix like 'gtk2_' or
'lib', or a suffix like '-lua'.
  • Loading branch information
kiilerix committed Oct 23, 2024
1 parent 0c7dad6 commit d4891db
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
12 changes: 6 additions & 6 deletions gtk2_ardour/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def configure(conf):
conf.env['define_key'] = bak

def build(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
I18N_PACKAGE = 'gtk2_' + bld.env['INTERNAL_NAME']

# Tool to dump lua-bindings (of gtk2ardour + libs)
if re.search ("linux", sys.platform) != None and bld.env['LUABINDINGDOC']:
Expand Down Expand Up @@ -754,7 +754,7 @@ def build(bld):

obj = bld(features = 'subst')
obj.source = 'ardour.sh.in'
obj.target = 'ardour' + bld.env['MAJOR']
obj.target = bld.env['INTERNAL_NAME']
obj.chmod = Utils.O755
obj.dict = wrapper_subst_dict
obj.install_path = bld.env['BINDIR']
Expand Down Expand Up @@ -969,27 +969,27 @@ def build(bld):
mo)

def i18n_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
I18N_PACKAGE = 'gtk2_' + bld.env['INTERNAL_NAME']
autowaf.build_i18n(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis')
appdata_i18n_pot(bld)
appdata_i18n_po(bld)
appdata_i18n_mo(bld)

def i18n_pot_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
I18N_PACKAGE = 'gtk2_' + bld.env['INTERNAL_NAME']
autowaf.build_i18n_pot(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis')
appdata_i18n_pot(bld)

def i18n_po_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
I18N_PACKAGE = 'gtk2_' + bld.env['INTERNAL_NAME']
autowaf.build_i18n_po(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis')
appdata_i18n_po(bld)

def i18n_mo_func(bld):
I18N_PACKAGE = 'gtk2_ardour' + bld.env['MAJOR']
I18N_PACKAGE = 'gtk2_' + bld.env['INTERNAL_NAME']
autowaf.build_i18n_mo(bld, '.', 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
'Paul Davis')

Expand Down
22 changes: 10 additions & 12 deletions libs/ardour/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import re
# default state file version for this build
CURRENT_SESSION_FILE_VERSION = 7003

I18N_PACKAGE = 'ardour'

libardour_sources = [
'amp.cc',
'analyser.cc',
Expand Down Expand Up @@ -421,7 +419,7 @@ def build(bld):
obj.vnum = LIBARDOUR_LIB_VERSION
obj.install_path = bld.env['LIBDIR']
obj.defines += [
'PACKAGE="' + I18N_PACKAGE + bld.env['MAJOR'] + '"',
'PACKAGE="' + bld.env['INTERNAL_NAME'] + '"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
Expand Down Expand Up @@ -592,7 +590,7 @@ def build(bld):
mo_files = bld.path.ant_glob('po/*.mo')
for mo in mo_files:
lang = os.path.basename(mo.srcpath()).replace('.mo', '')
bld.install_as(os.path.join(bld.env['LOCALEDIR'], lang, 'LC_MESSAGES', I18N_PACKAGE + bld.env['MAJOR'] + '.mo'),
bld.install_as(os.path.join(bld.env['LOCALEDIR'], lang, 'LC_MESSAGES', bld.env['INTERNAL_NAME'] + '.mo'),
mo)

if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
Expand All @@ -610,7 +608,7 @@ def build(bld):
else:
testcommon.use.extend(['libltc', 'librubberband', 'libfluidsynth'])
testcommon.defines = [
'PACKAGE="libardour' + bld.env['MAJOR'] + 'test"',
'PACKAGE="lib' + bld.env['INTERNAL_NAME'] + 'test"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
Expand Down Expand Up @@ -686,7 +684,7 @@ def build(bld):
load_save_session.target = 'load-save-session'
load_save_session.install_path = ''
load_save_session.defines = [
'PACKAGE="libardour' + bld.env['MAJOR'] + 'profile"',
'PACKAGE="lib' + bld.env['INTERNAL_NAME'] + 'profile"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
Expand All @@ -712,7 +710,7 @@ def build(bld):
profilingobj.target = p
profilingobj.install_path = ''
profilingobj.defines = [
'PACKAGE="libardour' + bld.env['MAJOR'] + 'profile"',
'PACKAGE="lib' + bld.env['INTERNAL_NAME'] + 'profile"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
Expand All @@ -730,24 +728,24 @@ def create_ardour_test_program(bld, includes, name, target, sources):
# not sure about install path
testobj.install_path = bld.env['LIBDIR']
testobj.defines = [
'PACKAGE="libardour' + bld.env['MAJOR'] + 'test"',
'PACKAGE="lib' + bld.env['INTERNAL_NAME'] + 'test"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
]

def i18n_func(bld):
autowaf.build_i18n(bld, '.', 'libs/ardour', I18N_PACKAGE + bld.env['MAJOR'], libardour_sources,
autowaf.build_i18n(bld, '.', 'libs/ardour', bld.env['INTERNAL_NAME'], libardour_sources,
'Paul Davis')

def i18n_pot_func(bld):
autowaf.build_i18n_pot(bld, '.', 'libs/ardour', I18N_PACKAGE + bld.env['MAJOR'], libardour_sources,
autowaf.build_i18n_pot(bld, '.', 'libs/ardour', bld.env['INTERNAL_NAME'], libardour_sources,
'Paul Davis')

def i18n_po_func(bld):
autowaf.build_i18n_po(bld, '.', 'libs/ardour', I18N_PACKAGE + bld.env['MAJOR'], libardour_sources,
autowaf.build_i18n_po(bld, '.', 'libs/ardour', bld.env['INTERNAL_NAME'], libardour_sources,
'Paul Davis')

def i18n_mo_func(bld):
autowaf.build_i18n_mo(bld, '.', 'libs/ardour', I18N_PACKAGE + bld.env['MAJOR'], libardour_sources,
autowaf.build_i18n_mo(bld, '.', 'libs/ardour', bld.env['INTERNAL_NAME'], libardour_sources,
'Paul Davis')
4 changes: 2 additions & 2 deletions luasession/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def build(bld):
if bld.env['build_target'] != 'mingw':
obj = bld(features = 'subst')
obj.source = 'ardour-lua.sh.in'
obj.target = 'ardour' + bld.env['MAJOR'] + '-lua'
obj.target = bld.env['INTERNAL_NAME'] + '-lua'
obj.chmod = Utils.O755
obj.install_path = bld.env['BINDIR']
obj.LIBDIR = os.path.normpath(bld.env['DLLDIR'])
Expand Down Expand Up @@ -75,6 +75,6 @@ def build(bld):

if bld.env['build_target'] == 'mingw':
obj.install_path = bld.env['BINDIR']
obj.target = 'ardour' + bld.env['MAJOR'] + '-lua'
obj.target = bld.env['INTERNAL_NAME'] + '-lua'
else:
obj.install_path = bld.env['DLLDIR']
2 changes: 1 addition & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ def configure(conf):
if Options.options.lv2dir:
conf.env['LV2DIR'] = Options.options.lv2dir
else:
conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'ardour' + conf.env['MAJOR'], 'LV2')
conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], conf.env['INTERNAL_NAME'], 'LV2')

conf.env['LV2DIR'] = os.path.normpath(conf.env['LV2DIR'])

Expand Down

0 comments on commit d4891db

Please sign in to comment.