summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-19 10:03:24 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-19 10:03:24 +0100
commit0cb46375414f69947d393c8e00cd66a00bd8f5bb (patch)
treed71d55c0bc4af1626cf3148f694cfb336e881ff6
parent6e732d6360e94f1950eec980e402ae6c601e8ba6 (diff)
Various build system adjustments.
-rw-r--r--cscript52
-rw-r--r--platform/osx/make_dmg.sh24
-rw-r--r--src/tools/wscript4
-rw-r--r--test/wscript2
-rw-r--r--wscript5
5 files changed, 45 insertions, 42 deletions
diff --git a/cscript b/cscript
index 47c71a335..f37255116 100644
--- 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')]
diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh
index f757eda34..fe48222ad 100644
--- a/platform/osx/make_dmg.sh
+++ b/platform/osx/make_dmg.sh
@@ -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/
diff --git a/src/tools/wscript b/src/tools/wscript
index ee4e7edef..13c5d7590 100644
--- a/src/tools/wscript
+++ b/src/tools/wscript
@@ -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
diff --git a/test/wscript b/test/wscript
index f1a508a53..71636a05d 100644
--- a/test/wscript
+++ b/test/wscript
@@ -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 478ac092c..c7707d95b 100644
--- 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