port names are NOT translatable
[ardour.git] / wscript
diff --git a/wscript b/wscript
index fc9b87748af4a069b889eefa817265e027e4374a..f7ba5dfb6aa7876af7144121de002fc238036d44 100644 (file)
--- a/wscript
+++ b/wscript
@@ -8,7 +8,7 @@ import subprocess
 import sys
 
 # Variables for 'waf dist'
-VERSION = '3.0rc1'
+VERSION = '3.0rc2'
 APPNAME = 'Ardour3'
 
 # Mandatory variables
@@ -46,18 +46,20 @@ i18n_children = [
         'libs/gtkmm2ext',
 ]
 
-if sys.platform != 'darwin':
+if sys.platform == 'linux2':
     children += [ 'tools/sanity_check' ]
     lxvst_default = True
-else:
+elif sys.platform == 'darwin':
     children += [ 'libs/appleutility' ]
     lxvst_default = False
+else:
+    lxvst_default = False
 
 # Version stuff
 
 def fetch_svn_revision (path):
-    cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'"
-    return subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
+    cmd = "svnversion | cut -d: -f1"
+    return subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].rstrip(os.linesep)
 
 def fetch_gcc_version (CC):
     cmd = "LANG= %s --version" % CC
@@ -67,10 +69,12 @@ def fetch_gcc_version (CC):
     return version
 
 def fetch_git_revision (path):
-    cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
+    cmd = "LANG= git log --abbrev HEAD^..HEAD"
     output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
     o = output[0].decode('utf-8')
     rev = o.replace ("commit", "git")[0:10]
+    cmd = "LANG= git log --abbrev -n1 --grep 'git-svn-id'"
+    output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
     for line in output:
         try:
             if "git-svn-id" in line:
@@ -108,7 +112,7 @@ def create_stored_revision():
     try:
         text =  '#include "ardour/svn_revision.h"\n'
         text += 'namespace ARDOUR { const char* svn_revision = \"%s\"; }\n' % rev
-        print('Writing svn revision info to libs/ardour/svn_revision.cc')
+        print('Writing svn revision info to libs/ardour/svn_revision.cc using ', rev)
         o = open('libs/ardour/svn_revision.cc', 'w')
         o.write(text)
         o.close()
@@ -436,8 +440,6 @@ def options(opt):
                     help='Add revision information to executable name inside the build directory')
     opt.add_option('--windows-vst', action='store_true', default=False, dest='windows_vst',
                     help='Compile with support for Windows VST')
-    opt.add_option('--wiimote', action='store_true', default=False, dest='wiimote',
-                    help='Build the wiimote control surface')
     opt.add_option('--windows-key', type='string', action='store', dest='windows_key', default='Mod4><Super',
                     help='X Modifier(s) (Mod1,Mod2, etc) for the Windows key (X11 builds only). ' +
                     'Multiple modifiers must be separated by \'><\'')
@@ -481,18 +483,28 @@ def configure(conf):
     #
     user_gtk_root = os.path.expanduser ('~/gtk/inst')
     pkg_config_path = os.getenv('PKG_CONFIG_PATH')
-    if not os.path.isfile ('/usr/include/libintl.h') or (pkg_config_path is not None and pkg_config_path.find (user_gtk_root) >= 0):
-        # XXXX hack hack hack
-        prefinclude = ''.join ([ '-I', user_gtk_root + '/include'])
-        preflib = ''.join ([ '-L', user_gtk_root + '/lib'])
-        conf.env.append_value('CFLAGS', [ prefinclude ])
-        conf.env.append_value('CXXFLAGS',  [prefinclude ])
-        conf.env.append_value('LINKFLAGS', [ preflib ])
-        conf.define ('NEED_INTL', 1)
-        autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ' + user_gtk_root, 'yes')
+    if os.path.isfile ('/usr/include/libintl.h'):
+        # libintl is part of the system., so use it
+        autowaf.display_msg(conf, 'Will reply on libintl built into libc', 'yes')
     else:
-        autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ', 'no')
+        if (pkg_config_path is not None):
+            # told to search for pkgconfig files
+            if pkg_config_path.find (user_gtk_root) >= 0:
+                # told to search user_gtk_root
+                prefinclude = ''.join ([ '-I', user_gtk_root + '/include'])
+                preflib = ''.join ([ '-L', user_gtk_root + '/lib'])
+                conf.env.append_value('CFLAGS', [ prefinclude ])
+                conf.env.append_value('CXXFLAGS',  [prefinclude ])
+                conf.env.append_value('LINKFLAGS', [ preflib ])
+                conf.define ('NEED_INTL', 1)
+                autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ' + user_gtk_root, 'yes')
+            else:
+                print ('\n\n**** Cannot locate libintl.h and PKG_CONFIG_PATH does not include ', user_gtk_root, '- this needs fixing before the build can continue')
+                sys.exit (-1)
+        else:
+                print ('\n\n**** Cannot locate libintl.h and PKG_CONFIG_PATH is not set - this needs fixing before the build can continue')
 
+            
     user_ardour_root = os.path.expanduser ('~/a3/inst')
     if pkg_config_path is not None and os.getenv('PKG_CONFIG_PATH').find (user_ardour_root) >= 0:
         # XXXX hack hack hack
@@ -636,9 +648,6 @@ def configure(conf):
         conf.env['LXVST_SUPPORT'] = True
     if bool(conf.env['JACK_SESSION']):
         conf.define('HAVE_JACK_SESSION', 1)
-    if opts.wiimote:
-        conf.define('WIIMOTE', 1)
-        conf.env['WIIMOTE'] = True
     conf.define('WINDOWS_KEY', opts.windows_key)
     conf.env['PROGRAM_NAME'] = opts.program_name
     if opts.rt_alloc_debug:
@@ -707,7 +716,7 @@ const char* const ardour_config_info = "\\n\\
     write_config_text('Universal binary',      opts.universal)
     write_config_text('Generic x86 CPU',       opts.generic)
     write_config_text('Windows VST support',   opts.windows_vst)
-    write_config_text('Wiimote support',       opts.wiimote)
+    write_config_text('Wiimote support',       conf.is_defined('BUILD_WIIMOTE'))
     write_config_text('Windows key',           opts.windows_key)
 
     write_config_text('C compiler flags',      conf.env['CFLAGS'])