Various build system adjustments.
authorCarl Hetherington <cth@carlh.net>
Wed, 19 Jun 2013 09:03:24 +0000 (10:03 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 19 Jun 2013 09:03:24 +0000 (10:03 +0100)
cscript
platform/osx/make_dmg.sh
src/tools/wscript
test/wscript
wscript

diff --git a/cscript b/cscript
index 47c71a3355177adcd5705e16ff7ac05e9e2eb6be..f372551168b06d752415511f54bd7b60dd4642f3 100644 (file)
--- a/cscript
+++ b/cscript
@@ -6,32 +6,32 @@ def dependencies(target):
     if target.platform == 'windows':
         return ()
     else:
-        return (('openjpeg-cdist', None),
-                ('ffmpeg-cdist', 'e17deeb6f6c4fe0d56bb151342b2afb82b1fcefb'),
-                ('libdcp', 'v0.53'))
+       # XXX: should be some versions in here
+        return (('ffmpeg-cdist', ''),
+                ('libdcp', None))
 
-def build(env, target):
-    cmd = './waf configure --prefix=%s' % env.work_dir_cscript()
+def build(target):
+    cmd = './waf configure --prefix=%s' % target.work_dir_cscript()
     if target.platform == 'windows':
         cmd += ' --target-windows'
     elif target.platform == 'linux':
         cmd += ' --static'
-    env.command(cmd)
+    target.command(cmd)
 
-    env.command('./waf')
+    target.command('./waf')
 
     if target.platform == 'linux' or target.platform == 'osx':
-        env.command('./waf install')
+        target.command('./waf install')
 
 
-def package(env, target, version):
+def package(target, version):
     if target.platform == 'windows':
         shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits)
-        env.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
-        env.command('sed -i "s~%%deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (env.windows_prefix, target.bits))
-        env.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
-        env.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits)
-        env.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits)
+        target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
+        target.command('sed -i "s~%%deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits))
+        target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
+        target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits)
+        target.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits)
         return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0])
     elif target.platform == 'linux':
         if target.bits == 32:
@@ -40,7 +40,7 @@ def package(env, target, version):
             cpu = 'amd64'
 
         shutil.copyfile('platform/linux/control-%s-%d' % (target.version, target.bits), 'debian/control')
-        env.command('./waf dist')
+        target.command('./waf dist')
         f = open('debian/files', 'w')
         print >>f,'dvdomatic_%s-1_%s.deb video extra' % (version, cpu)
         shutil.rmtree('build/deb', ignore_errors=True)
@@ -48,13 +48,13 @@ def package(env, target, version):
         os.makedirs('build/deb')
         os.chdir('build/deb')
         shutil.move('../../dvdomatic-%s.tar.bz2' % version, 'dvdomatic_%s.orig.tar.bz2' % version)
-        env.command('tar xjf dvdomatic_%s.orig.tar.bz2' % version)
+        target.command('tar xjf dvdomatic_%s.orig.tar.bz2' % version)
         os.chdir('dvdomatic-%s' % version)
-        env.command('dch -b -v %s-1 "New upstream release."' % version)
-        env.set('CDIST_LINKFLAGS', env.get('LINKFLAGS'))
-        env.set('CDIST_CXXFLAGS', env.get('CXXFLAGS'))
-        env.set('CDIST_PKG_CONFIG_PATH', env.get('PKG_CONFIG_PATH'))
-        env.command('dpkg-buildpackage')
+        target.command('dch -b -v %s-1 "New upstream release."' % version)
+        target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS'))
+        target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS'))
+        target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
+        target.command('dpkg-buildpackage')
         
         debs = []
         for p in glob.glob('../*.deb'):
@@ -62,16 +62,16 @@ def package(env, target, version):
 
         return debs
     elif target.platform == 'osx':
-        env.command('bash platform/osx/make_dmg.sh')
+        target.command('bash platform/osx/make_dmg.sh')
         return os.path.abspath(glob.glob('build/platform/osx/DVD-o-matic*.dmg')[0])
 
-def make_pot(env):
-    env.command('./waf pot')
+def make_pot(target):
+    target.command('./waf pot')
     return [os.path.abspath('build/src/lib/libdvdomatic.pot'),
             os.path.abspath('build/src/wx/libdvdomatic-wx.pot'),
            os.path.abspath('build/src/tools/dvdomatic.pot')]
 
-def make_manual(env):
+def make_manual(target):
     os.chdir('doc/manual')
-    env.command('make')
+    target.command('make')
     return [os.path.abspath('pdf'), os.path.abspath('html')]
index f757eda34e39adaccaf383364994c700e3825c64..fe48222ad40561b59d50e947c178ffd7d9beec9c 100644 (file)
@@ -6,7 +6,7 @@ version=`cat wscript | egrep ^VERSION | awk '{print $3}' | sed -e "s/'//g"`
 DMG_SIZE=256
 WORK=build/platform/osx
 ENV=/Users/carl/Environments/osx/10.8
-DEPS=/Users/carl/cdist
+ROOT=/Users/carl/cdist
 
 appdir="DVD-o-matic.app"
 approot=$appdir/Contents
@@ -22,17 +22,17 @@ mkdir -p $WORK/$resources
 cp build/src/tools/dvdomatic $WORK/$macos/
 cp build/src/lib/libdvdomatic.dylib $WORK/$libs/
 cp build/src/wx/libdvdomatic-wx.dylib $WORK/$libs/
-cp $DEPS/lib/libdcp.dylib $WORK/$libs/
-cp $DEPS/lib/libasdcp-libdcp.dylib $WORK/$libs/
-cp $DEPS/lib/libkumu-libdcp.dylib $WORK/$libs/
-cp $DEPS/lib/libopenjpeg*.dylib $WORK/$libs/
-cp $DEPS/lib/libavformat*.dylib $WORK/$libs/
-cp $DEPS/lib/libavfilter*.dylib $WORK/$libs/
-cp $DEPS/lib/libavutil*.dylib $WORK/$libs/
-cp $DEPS/lib/libavcodec*.dylib $WORK/$libs/
-cp $DEPS/lib/libswscale*.dylib $WORK/$libs/
-cp $DEPS/lib/libpostproc*.dylib $WORK/$libs/
-cp $DEPS/lib/libswresample*.dylib $WORK/$libs/
+cp $ROOT/lib/libdcp.dylib $WORK/$libs/
+cp $ROOT/lib/libasdcp-libdcp.dylib $WORK/$libs/
+cp $ROOT/lib/libkumu-libdcp.dylib $WORK/$libs/
+cp $ROOT/lib/libopenjpeg*.dylib $WORK/$libs/
+cp $ROOT/lib/libavformat*.dylib $WORK/$libs/
+cp $ROOT/lib/libavfilter*.dylib $WORK/$libs/
+cp $ROOT/lib/libavutil*.dylib $WORK/$libs/
+cp $ROOT/lib/libavcodec*.dylib $WORK/$libs/
+cp $ROOT/lib/libswscale*.dylib $WORK/$libs/
+cp $ROOT/lib/libpostproc*.dylib $WORK/$libs/
+cp $ROOT/lib/libswresample*.dylib $WORK/$libs/
 cp $ENV/lib/libboost_system.dylib $WORK/$libs/
 cp $ENV/lib/libboost_filesystem.dylib $WORK/$libs/
 cp $ENV/lib/libboost_thread.dylib $WORK/$libs/
index ee4e7edefc38f8c2c500653fe926e02cbf1f0309..13c5d7590d799a5591205e6f5d66a19760300152 100644 (file)
@@ -6,7 +6,7 @@ import i18n
 def build(bld):
     for t in ['makedcp', 'servomatic_cli', 'servomatictest']:
         obj = bld(features = 'cxx cxxprogram')
-        obj.uselib = 'BOOST_THREAD OPENJPEG DCP AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC'
+        obj.uselib = 'BOOST_THREAD OPENJPEG DCP AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML'
         obj.includes = ['..']
         obj.use    = ['libdvdomatic']
         obj.source = '%s.cc' % t
@@ -15,7 +15,7 @@ def build(bld):
     if not bld.env.DISABLE_GUI:
         for t in ['dvdomatic', 'dvdomatic_batch', 'servomatic_gui']:
             obj = bld(features = 'cxx cxxprogram')
-            obj.uselib = 'DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC'
+            obj.uselib = 'DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML'
             obj.includes = ['..']
             obj.use    = ['libdvdomatic', 'libdvdomatic-wx']
             obj.source = '%s.cc' % t
index f1a508a538a9acb56ddabf48cc5a649fc9872145..71636a05d7fbaed510005fce9c00d4c866a118a0 100644 (file)
@@ -12,7 +12,7 @@ def configure(conf):
 def build(bld):
     obj = bld(features = 'cxx cxxprogram')
     obj.name   = 'unit-tests'
-    obj.uselib = 'BOOST_TEST DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC'
+    obj.uselib = 'BOOST_TEST DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML'
     obj.use    = 'libdvdomatic'
     obj.source = 'test.cc'
     obj.target = 'unit-tests'
diff --git a/wscript b/wscript
index 478ac092cdfae3b9319f78c3d6682f752c3edabd..c7707d95bef8c07e24a014ea424720be5c38de3f 100644 (file)
--- a/wscript
+++ b/wscript
@@ -77,12 +77,15 @@ def configure(conf):
     else:
         # This is hackio grotesquio for static builds (ie for .deb packages).  We need to link some things
         # statically and some dynamically, or things get horribly confused and the dynamic linker (I think)
-        # crashes horribly.  These calls do what the check_cfg calls would have done, but specify the
+        # crashes.  These calls do what the check_cfg calls would have done, but specify the
         # different bits as static or dynamic as required.  It'll break if you look at it funny, but
         # I think anyone else who builds would do so dynamically.
+        conf.env.HAVE_CXML = 1
+        conf.env.STLIB_CXML = ['cxml']
         conf.env.HAVE_DCP = 1
         conf.env.STLIB_DCP = ['dcp', 'asdcp-libdcp', 'kumu-libdcp']
         conf.env.LIB_DCP = ['glibmm-2.4', 'xml++-2.6', 'ssl', 'crypto', 'bz2']
+        conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='DCP', mandatory=True)
         conf.env.HAVE_AVFORMAT = 1
         conf.env.STLIB_AVFORMAT = ['avformat']
         conf.env.HAVE_AVFILTER = 1