From 659c0d093da45cd8dbd74ebb572eaaa45aed9bf4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 8 Jan 2015 16:57:46 +0100 Subject: [PATCH] remove hardcoded major version in build scripts --- libs/ardour/wscript | 26 ++++++++++++-------------- libs/fst/wscript | 4 ++-- libs/timecode/wscript | 3 ++- wscript | 21 ++++++++++++++++++++- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/libs/ardour/wscript b/libs/ardour/wscript index c61da5149b..567439cf40 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -10,9 +10,7 @@ import sys # default state file version for this build CURRENT_SESSION_FILE_VERSION = 3001 -# Variables for 'waf dist' -APPNAME = 'libardour3' -I18N_PACKAGE = 'ardour3' +I18N_PACKAGE = 'ardour' # Mandatory variables top = '.' @@ -246,7 +244,7 @@ def configure(conf): autowaf.build_version_files( path_prefix + 'ardour/version.h', path_prefix + 'version.cc', - 'libardour3', conf.env['MAJOR'], conf.env['MINOR'], 0, + 'libardour' + str(conf.env['MAJOR']), conf.env['MAJOR'], conf.env['MINOR'], 0, 'LIBARDOUR_API', 'ardour/libardour_visibility.h') autowaf.configure(conf) autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', @@ -367,7 +365,7 @@ def build(bld): obj.vnum = LIBARDOUR_LIB_VERSION obj.install_path = bld.env['LIBDIR'] obj.defines += [ - 'PACKAGE="' + I18N_PACKAGE + '"', + 'PACKAGE="' + I18N_PACKAGE + str(bld.env['MAJOR']) + '"', 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"', @@ -418,7 +416,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 + '.mo'), + bld.install_as(os.path.join(bld.env['LOCALEDIR'], lang, 'LC_MESSAGES', I18N_PACKAGE + str(bld.env['MAJOR']) + '.mo'), mo) if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'): @@ -437,7 +435,7 @@ def build(bld): else: testcommon.use.extend(['libltc', 'librubberband']) testcommon.defines = [ - 'PACKAGE="libardour3test"', + 'PACKAGE="libardour' + str(bld.env['MAJOR']) + 'test"', 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"', @@ -516,7 +514,7 @@ def build(bld): session_load_tester.target = 'load-session' session_load_tester.install_path = '' session_load_tester.defines = [ - 'PACKAGE="libardour3profile"', + 'PACKAGE="libardour' + str(bld.env['MAJOR']) + 'profile"', 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"', @@ -548,7 +546,7 @@ def build(bld): profilingobj.target = p profilingobj.install_path = '' profilingobj.defines = [ - 'PACKAGE="libardour3profile"', + 'PACKAGE="libardour' + str(bld.env['MAJOR']) + 'profile"', 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"', @@ -579,7 +577,7 @@ def create_ardour_test_program(bld, includes, name, target, sources): # not sure about install path testobj.install_path = bld.env['LIBDIR'] testobj.defines = [ - 'PACKAGE="libardour3test"', + 'PACKAGE="libardour' + str(bld.env['MAJOR']) + 'test"', 'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"', 'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"', 'LOCALEDIR="' + os.path.normpath(bld.env['LOCALEDIR']) + '"', @@ -589,17 +587,17 @@ def shutdown(): autowaf.shutdown() def i18n(bld): - autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources, + autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE + str(bld.env['MAJOR']), libardour_sources, 'Paul Davis') def i18n_pot(bld): - autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources, + autowaf.build_i18n(bld, top, 'libs/ardour', I18N_PACKAGE + str(bld.env['MAJOR']), libardour_sources, 'Paul Davis') def i18n_po(bld): - autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources, + autowaf.build_i18n_po(bld, top, 'libs/ardour', I18N_PACKAGE + str(bld.env['MAJOR']), libardour_sources, 'Paul Davis') def i18n_mo(bld): - autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE, libardour_sources, + autowaf.build_i18n_mo(bld, top, 'libs/ardour', I18N_PACKAGE + str(bld.env['MAJOR']), libardour_sources, 'Paul Davis') diff --git a/libs/fst/wscript b/libs/fst/wscript index 7449d5921d..3e4605837d 100644 --- a/libs/fst/wscript +++ b/libs/fst/wscript @@ -18,7 +18,7 @@ scanner_app_src = [ ] # needed for code used from libardour -I18N_PACKAGE = 'ardour3' +I18N_PACKAGE = 'ardour' def options(opt): autowaf.set_options(opt) @@ -82,7 +82,7 @@ def build(bld): '_POSIX_SOURCE', 'USE_WS_PREFIX', 'VST_SCANNER_APP', - 'PACKAGE="' + I18N_PACKAGE + '"', + 'PACKAGE="' + I18N_PACKAGE + str(bld.env['MAJOR']) + '"', 'LIBARDOUR="' + bld.env['lwrcase_dirname'] + '"', ] obj.install_path = os.path.join(bld.env['LIBDIR']) diff --git a/libs/timecode/wscript b/libs/timecode/wscript index 77a23da088..fadeb0aebd 100644 --- a/libs/timecode/wscript +++ b/libs/timecode/wscript @@ -21,7 +21,8 @@ def build(bld): target = 'timecode', includes = ['.'], export_includes = ['.'], - defines = [ 'LIBTIMECODE_DLL_EXPORTS' ] + defines = [ 'LIBTIMECODE_DLL_EXPORTS' ], + install_path = bld.env['LIBDIR'] ) def shutdown(): diff --git a/wscript b/wscript index e722e3da5d..aecc85a5c2 100644 --- a/wscript +++ b/wscript @@ -9,6 +9,24 @@ import sys import platform as PLATFORM from waflib.Tools import winres +from waflib.Build import BuildContext +class i18n(BuildContext): + cmd = 'i18n' + fun = 'i18n' + +class i18n_pot(BuildContext): + cmd = 'i18n_pot' + fun = 'i18n_pot' + +class i18n_po(BuildContext): + cmd = 'i18n_po' + fun = 'i18n_po' + +class i18n_mo(BuildContext): + cmd = 'i18n_mo' + fun = 'i18n_mo' + + compiler_flags_dictionaries= { 'gcc' : { # Flags required when building a debug build @@ -1036,7 +1054,7 @@ def build(bld): bld.path.find_dir ('libs/pbd/pbd') # set up target directories - lwrcase_dirname = 'ardour3' + lwrcase_dirname = 'ardour' + bld.env['MAJOR'] if bld.is_defined ('TRX_BUILD'): lwrcase_dirname = 'trx' @@ -1069,6 +1087,7 @@ def build(bld): bld.add_post_fun(test) def i18n(bld): + print(bld.env) bld.recurse (i18n_children) def i18n_pot(bld):