Skip to content

Commit

Permalink
wscript: Rename lwrcase_dirname (with values like "ardourX") to INTER…
Browse files Browse the repository at this point in the history
…NAL_NAME

The build system does a lot all over to keep ardour8 (almost) without
file name conflicts if installed next to ardour9. Often by appending
MAJOR in lots of places.

lwrcase_dirname was just 'ardour' + MAJOR. The naming of lwrcase_dirname
did not say much about what it was, and it was only defined locally in
build(). We set INTERNAL_NAME globally in configure(), exactly like
MAJOR is set.

INTERNAL_NAME is similar to the existing PROGRAM_NAME, which contains
the visible name. INTERNAL_NAME is however more intended to be used for
namespacing installed files. We will soon use it in a lot of places
where MAJOR used to be used.

The end goal is to make sure there only is one place where the
"ardour"+major naming policy is hardcoded. And to make it configurable
instead of hardcoded.

Things should not be repeated so they are hard to change, and they
should not be hardcoded. The policy of including the major version in
the internal name is not necessarily relevant when always using latest
version. Most programs don't do that. But also, if there for some reason
should be a need to install several minor versions side by side, then it
would be relevant to include both the major and the minor number.
  • Loading branch information
kiilerix committed Oct 23, 2024
1 parent e4daee0 commit 0c7dad6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
10 changes: 5 additions & 5 deletions gtk2_ardour/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -881,16 +881,16 @@ def build(bld):

# Freedesktop
freedesktop_subst_dict = {
'ARDOUR_EXEC' : bld.env['lwrcase_dirname'],
'ARDOUR_ICON' : bld.env['lwrcase_dirname'],
'ARDOUR_EXEC' : bld.env['INTERNAL_NAME'],
'ARDOUR_ICON' : bld.env['INTERNAL_NAME'],
'VERSION': bld.env['VERSION'],
'DATE': bld.env['DATE'],
}

if bld.env['FREEDESKTOP']:
obj = bld(features = 'subst')
obj.source = 'ardour.desktop.in'
obj.target = bld.env['lwrcase_dirname'] + '.desktop'
obj.target = bld.env['INTERNAL_NAME'] + '.desktop'
obj.chmod = Utils.O644
obj.dict = freedesktop_subst_dict
set_subst_dict(obj, freedesktop_subst_dict)
Expand All @@ -907,14 +907,14 @@ def build(bld):
appdata_i18n_xmlin(bld)
obj = bld(features = 'subst')
obj.source = 'ardour.appdata.xml.in'
obj.target = bld.env['lwrcase_dirname'] + '.appdata.xml'
obj.target = bld.env['INTERNAL_NAME'] + '.appdata.xml'
obj.chmod = Utils.O644
obj.dict = freedesktop_subst_dict
set_subst_dict(obj, freedesktop_subst_dict)
bld.install_files (os.path.join (bld.env['PREFIX'], 'share/appdata'), obj.target)

# install desktop icon files
icon_file_name = bld.env['lwrcase_dirname'] + '.png'
icon_file_name = bld.env['INTERNAL_NAME'] + '.png'
bld.install_as('${PREFIX}/share/icons/hicolor/16x16/apps/' + icon_file_name, 'resources/Ardour-icon_16px.png')
bld.install_as('${PREFIX}/share/icons/hicolor/22x22/apps/'+ icon_file_name, 'resources/Ardour-icon_22px.png')
bld.install_as('${PREFIX}/share/icons/hicolor/32x32/apps/'+ icon_file_name, 'resources/Ardour-icon_32px.png')
Expand Down
2 changes: 1 addition & 1 deletion libs/ardour/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def build(bld):
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"',
'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"'
'LIBARDOUR="' + bld.env['INTERNAL_NAME'] + '"'
]

if bld.is_defined('HAVE_SOUNDTOUCH'):
Expand Down
2 changes: 1 addition & 1 deletion libs/auscan/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def build(bld):
'AU_SCANNER_APP',
'VERSIONSTRING="' + bld.env['VERSION'] + '"',
'PACKAGE="' + I18N_PACKAGE + bld.env['MAJOR'] + '"',
'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"',
'LIBARDOUR="' + bld.env['INTERNAL_NAME'] + '"',
'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
]
obj.use = [ 'libpbd', 'libappleutility', 'libtemporal', 'libevoral' ]
Expand Down
4 changes: 2 additions & 2 deletions libs/fst/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def build(bld):
'VST3_SCANNER_APP',
'VERSIONSTRING="' + bld.env['VERSION'] + '"',
'PACKAGE="' + I18N_PACKAGE + bld.env['MAJOR'] + '"',
'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"',
'LIBARDOUR="' + bld.env['INTERNAL_NAME'] + '"',
'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
]
obj.use = [ 'libpbd' ]
Expand Down Expand Up @@ -65,7 +65,7 @@ def build(bld):
'USE_WS_PREFIX',
'VST_SCANNER_APP',
'PACKAGE="' + I18N_PACKAGE + bld.env['MAJOR'] + '"',
'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"',
'LIBARDOUR="' + bld.env['INTERNAL_NAME'] + '"',
'VERSIONSTRING="' + bld.env['VERSION'] + '"',
]
if re.search ("bsd", sys.platform) != None:
Expand Down
11 changes: 4 additions & 7 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ def configure(conf):
conf.env['MAJOR'] = MAJOR
conf.env['MINOR'] = MINOR
conf.env['MICRO'] = MICRO
conf.env['INTERNAL_NAME'] = 'ardour' + MAJOR
conf.line_just = 52
autowaf.set_recursive()
autowaf.configure(conf)
Expand Down Expand Up @@ -1590,18 +1591,14 @@ def build(bld):
#if bld.is_defined('YTK'):
# bld.path.find_dir ('libs/tk/ztkmm')

# set up target directories
lwrcase_dirname = 'ardour' + bld.env['MAJOR']

# configuration files go here
bld.env['CONFDIR'] = os.path.join(bld.env['SYSCONFDIR'], lwrcase_dirname)
bld.env['CONFDIR'] = os.path.join(bld.env['SYSCONFDIR'], bld.env['INTERNAL_NAME'])
# data files loaded at run time go here
bld.env['DATADIR'] = os.path.join(bld.env['DATADIR'], lwrcase_dirname)
bld.env['DATADIR'] = os.path.join(bld.env['DATADIR'], bld.env['INTERNAL_NAME'])
# shared objects loaded at runtime go here (two aliases)
bld.env['DLLDIR'] = os.path.join(bld.env['LIBDIR'], lwrcase_dirname)
bld.env['DLLDIR'] = os.path.join(bld.env['LIBDIR'], bld.env['INTERNAL_NAME'])
bld.env['LIBDIR'] = bld.env['DLLDIR']
bld.env['LOCALEDIR'] = os.path.join(bld.env['DATADIR'], 'locale')
bld.env['lwrcase_dirname'] = lwrcase_dirname

autowaf.set_recursive()

Expand Down

0 comments on commit 0c7dad6

Please sign in to comment.