Apply patch from timbyr to fix building with --test.
[ardour.git] / gtk2_ardour / wscript
index ef99f1e6ba2cd80e1848513313e645a4d7294b5c..3ca85c0e4d9f27f38ef9f3153c3ab67dd57d106d 100644 (file)
@@ -5,6 +5,8 @@ import waflib.Logs as Logs, waflib.Utils as Utils
 import os
 import sys
 import re
+import time
+from waflib.Task import Task
 
 # Version of this package (even if built as a child)
 MAJOR = '3'
@@ -29,6 +31,7 @@ gtk2_ardour_sources = [
         'add_route_dialog.cc',
         'ambiguous_file_dialog.cc',
         'analysis_window.cc',
+        'ardour_button.cc',
         'ardour_dialog.cc',
         'ardour_ui.cc',
         'ardour_ui2.cc',
@@ -145,6 +148,7 @@ gtk2_ardour_sources = [
         'midi_tracer.cc',
         'missing_file_dialog.cc',
         'missing_plugin_dialog.cc',
+        'mixer_actor.cc',
         'mixer_group_tabs.cc',
         'mixer_strip.cc',
         'mixer_ui.cc',
@@ -227,6 +231,7 @@ gtk2_ardour_sources = [
         'utils.cc',
         'verbose_cursor.cc',
         'version.cc',
+        'visibility_group.cc',
         'volume_controller.cc',
         'waveview.cc',
         'window_proxy.cc'
@@ -257,9 +262,12 @@ def configure(conf):
                       atleast_version='2.18')
     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
                       atleast_version='2.18')
+    autowaf.check_pkg(conf, 'libgnomecanvas-2.0',
+                      uselib_store='GNOMECANVAS', atleast_version='2.30')
     autowaf.check_pkg(conf, 'libgnomecanvasmm-2.6',
                       uselib_store='GNOMECANVASMM', atleast_version='2.16')
     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
+    autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.4', mandatory=False)
 
     conf.write_config_header('gtk2ardour-config.h', remove=False)
 
@@ -274,18 +282,11 @@ def set_winegcc(self):
     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
     self.env.CC = 'winegcc'
 
-#pre-processor-like operation to merge GTK RC files
-re_spaces = re.compile("\s+")
-
-def _doPyp(infileName):
-    """
-    Does the main work of preprocessing.
-    Takes 'infileName' as a filename, opens and processes it,
-    and returns the processed file as a string
-
-    Note - this works recursively.
-    """
+def _doPyp(infileName, deps = False):
     outStr = ''
+    out = []
+    re_spaces = re.compile("\s+")
+
     if infileName == '-':
         fd = sys.stdin
     else:
@@ -293,19 +294,27 @@ def _doPyp(infileName):
     inLines = fd.readlines()
     if fd != sys.stdin:
         fd.close()
+        
 
     for line in inLines:
         bits = re_spaces.split(line)
         if bits[0] == '##include':
             incName = bits[1]
-            # assume included file comes from same place as source file
-            incName = os.path.join (os.path.dirname (infileName), incName);
-            outStr += _doPyp(incName)
+            if (deps):
+                out += [ incName ]
+            else:
+                # assume included file comes from same place as source file
+                incName = os.path.join (os.path.dirname (infileName), incName);
+                outStr += _doPyp(incName)
         else:
-            outStr += line
+            if not deps:
+                outStr += line
 
     # done
-    return outStr
+    if deps:
+        return out
+    else:
+        return outStr
 
 def include_processor(task):
     infileName = task.inputs[0].srcpath()
@@ -332,7 +341,6 @@ def build_color_scheme(path, prefix):
     f.close()
     return color_scheme
 
-
 def build(bld):
     # GTK front-end; if we're using VST we build this as a shared library,
     # otherwise it's a normal executabale
@@ -352,10 +360,15 @@ def build(bld):
         obj.target = 'ardour-3.0'
     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
     obj.uselib       = 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
-    obj.uselib       += ' GTKMM GNOMECANVASMM '
+    obj.uselib       += ' GTKMM GNOMECANVASMM GNOMECANVAS '
     obj.uselib       += ' AUDIOUNITS OSX GTKOSX '
-    obj.use          = '''libpbd libmidipp libtaglib libardour libardour_cp
-                          libgtkmm2ext libtaglib libgnomecanvas-2'''
+    obj.use          = [ 'libpbd',
+                         'libmidipp',
+                         'libtaglib',
+                         'libardour',
+                         'libardour_cp',
+                         'libgtkmm2ext',
+                         'libtaglib' ]
     if sys.platform == 'darwin':
         obj.use += ' libappleutility'
     obj.defines     = [
@@ -380,17 +393,17 @@ def build(bld):
     if bld.is_defined('VST_SUPPORT'):
         obj.source += [ 'vst_pluginui.cc' ]
         obj.defines += [ 'VST_SUPPORT' ]
-        bld.env.append ('LINKFLAGS', '-lX11')
+        obj.uselib += ' X11 '
 
     if bld.is_defined('LXVST_SUPPORT'):
         obj.source += [ 'lxvst_pluginui.cc' ]
         obj.defines += [ 'LXVST_SUPPORT' ]
-        obj.linkflags += [ '-lX11' ]
+        obj.uselib += ' X11 '
 
     if bld.is_defined('PHONE_HOME'):
         obj.defines += [ 'PHONE_HOME' ]
 
-    if bld.is_defined('COREAUDIO'):
+    if bld.is_defined('HAVE_COREAUDIO'):
         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
         obj.source += [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
         obj.use += ' libappleutility '
@@ -550,19 +563,19 @@ def build(bld):
     obj.target       = 'ardour3_widgets.rc'
     obj.install_path = None
 
-    bld (
-        rule   = include_processor,
-        source = 'ardour3_ui_dark.rc.pre',
-        target = 'ardour3_ui_dark.rc',
-        install_path = '${SYSCONFDIR}/ardour3'
-        )
+    obj = bld (rule = include_processor)
+    obj.source = [ 'ardour3_ui_dark.rc.pre' ]
+    # find and add all ##include dependencies as sources
+    obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
+    obj.target = 'ardour3_ui_dark.rc'
+    obj.install_path = '${SYSCONFDIR}/ardour3'
 
-    bld (
-        rule   = include_processor,
-        source = 'ardour3_ui_light.rc.pre',
-        target = 'ardour3_ui_light.rc',
-        install_path = '${SYSCONFDIR}/ardour3'
-        )
+    obj = bld (rule = include_processor)
+    obj.source = [ 'ardour3_ui_light.rc.pre' ]
+    # find and add all ##include dependencies as sources
+    obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
+    obj.target = 'ardour3_ui_light.rc'
+    obj.install_path = '${SYSCONFDIR}/ardour3'
 
     # Menus
     menus_argv = []
@@ -589,13 +602,15 @@ def build(bld):
         obj = bld(
             target = b + '.bindings',
             source = b + '.bindings.in',
-            rule = '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld.env['WINDOWS_KEY']
+            rule = '../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap <${SRC} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
             )
         obj.install_path = os.path.join(bld.env['SYSCONFDIR'], 'ardour3')
 
     # not modified at present
     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
                       'step_editing.bindings')
+    bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
+                      'mixer.bindings')
 
     # Icons/Images
     bld.install_files('${DATADIR}/ardour3/icons', bld.path.ant_glob('icons/*.png'))
@@ -612,12 +627,13 @@ def build(bld):
 
     # i18n
     if bld.is_defined('ENABLE_NLS'):
-        mo_files = bld.path.ant_glob ('po/*.mo')
+        mo_files = bld.path.ant_glob('po/*.mo')
         for mo in mo_files:
-            lang = os.path.basename (mo).replace ('.mo', '')
-            bld.install_as (os.path.join(bld.env['PREFIX'], 'share', 'locale',
-                                         lang, 'LC_MESSAGES', APPNAME + '.mo'),
-                            mo)
+            lang = os.path.basename(mo.srcpath()).replace('.mo', '')
+            bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
+                                        lang, 'LC_MESSAGES', APPNAME + '.mo'),
+                           mo)
 
 def i18n(bld):
-    autowaf.build_i18n(bld, srcdir, 'gtk2_ardour', APPNAME, gtk2_ardour_sources)
+    autowaf.build_i18n(bld, top, 'gtk2_ardour', APPNAME, gtk2_ardour_sources,
+                       'Paul Davis')