+import subprocess
+
APPNAME = 'dvdomatic'
-VERSION = '0.26pre'
+VERSION = '0.27pre'
def options(opt):
opt.load('compiler_cxx')
opt.add_option('--debug-hash', action='store_true', default = False, help = 'print hashes of data at various points')
opt.add_option('--enable-debug', action='store_true', default = False, help = 'build with debugging information and without optimisation')
opt.add_option('--disable-gui', action='store_true', default = False, help = 'disable building of GUI tools')
+ opt.add_option('--ffmpeg-083', action='store_true', default = False, help = 'Use FFmpeg version in Ubuntu 12.04')
def configure(conf):
conf.load('compiler_cxx')
else:
conf.env.append_value('CXXFLAGS', '-O3')
+ if conf.options.ffmpeg_083:
+ conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_FFMPEG_0_8_3')
+
conf.env.DISABLE_GUI = conf.options.disable_gui
conf.check_cfg(package = 'sigc++-2.0', args = '--cflags --libs', uselib_store = 'SIGC++', mandatory = True)
conf.check_cfg(package = 'libavcodec', args = '--cflags --libs', uselib_store = 'AVCODEC', mandatory = True)
conf.check_cfg(package = 'libavutil', args = '--cflags --libs', uselib_store = 'AVUTIL', mandatory = True)
conf.check_cfg(package = 'libswscale', args = '--cflags --libs', uselib_store = 'SWSCALE', mandatory = True)
- conf.check_cfg(package = 'libswresample', args = '--cflags --libs', uselib_store = 'SWRESAMPLE', mandatory = True)
conf.check_cfg(package = 'libpostproc', args = '--cflags --libs', uselib_store = 'POSTPROC', mandatory = True)
conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True)
conf.check_cfg(package = 'libdcp', args = '--cflags --libs', uselib_store = 'DCP', mandatory = True)
conf.recurse('test')
def build(bld):
+ create_version_cc(VERSION)
+
bld.recurse('src')
bld.recurse('test')
for r in ['22x22', '32x32', '48x48', '64x64', '128x128']:
bld.install_files('${PREFIX}/share/icons/hicolor/%s/apps' % r, 'icons/%s/dvdomatic.png' % r)
-
def dist(ctx):
- ctx.excl = 'TODO core *~ src/gtk/*~ src/lib/*~ .waf* build'
+ ctx.excl = 'TODO core *~ src/gtk/*~ src/lib/*~ .waf* build .git'
+
+def create_version_cc(version):
+ 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')
+ commit = o.replace ("commit ", "")[0:10]
+
+ try:
+ text = '#include "version.h"\n'
+ text += 'char const * dvdomatic_git_commit = \"%s\";\n' % commit
+ text += 'char const * dvdomatic_version = \"%s\";\n' % version
+ print('Writing version information to src/lib/version.cc')
+ o = open('src/lib/version.cc', 'w')
+ o.write(text)
+ o.close()
+ except IOError:
+ print('Could not open src/lib/version.cc for writing\n')
+ sys.exit(-1)