X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=5f5942d117d43f2c92959f538a8fc1d1dbb42931;hb=d2118a1cc5dfce446caa33a9917ef9129fc576e1;hp=3e84dcac56156e4da4bbc0197c9199763e5705bd;hpb=2d5922e23644b723d6144df91720ffbd3d15457b;p=dcpomatic.git diff --git a/wscript b/wscript index 3e84dcac5..5f5942d11 100644 --- a/wscript +++ b/wscript @@ -23,10 +23,10 @@ import sys import glob import distutils import distutils.spawn -from waflib import Logs +from waflib import Logs, Context APPNAME = 'dcpomatic' -VERSION = '2.3.4devel' +VERSION = '2.6.14devel' def options(opt): opt.load('compiler_cxx') @@ -39,7 +39,6 @@ def options(opt): opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package') opt.add_option('--static-dcpomatic', action='store_true', default=False, help='link to components of DCP-o-matic statically') opt.add_option('--static-boost', action='store_true', default=False, help='link statically to Boost') - opt.add_option('--static-openjpeg', action='store_true', default=False, help='link statically to OpenJPEG') opt.add_option('--static-wxwidgets', action='store_true', default=False, help='link statically to wxWidgets') opt.add_option('--static-ffmpeg', action='store_true', default=False, help='link statically to FFmpeg') opt.add_option('--static-xmlpp', action='store_true', default=False, help='link statically to libxml++') @@ -83,7 +82,7 @@ def configure(conf): '-D_FILE_OFFSET_BITS=64']) if conf.options.enable_debug: - conf.env.append_value('CXXFLAGS', ['-g', '-DDCPOMATIC_DEBUG']) + conf.env.append_value('CXXFLAGS', ['-g', '-DDCPOMATIC_DEBUG', '-fno-omit-frame-pointer']) else: conf.env.append_value('CXXFLAGS', '-O2') @@ -140,7 +139,7 @@ def configure(conf): # OSX if conf.env.TARGET_OSX: - conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX', '-Wno-unused-function', '-Wno-unused-parameter']) + conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX', '-Wno-unused-function', '-Wno-unused-parameter', '-Wno-unused-local-typedef']) conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names') # @@ -159,6 +158,22 @@ def configure(conf): else: conf.check_cfg(package='libcurl', args='--cflags --libs', uselib_store='CURL', mandatory=True) + # libicu + if conf.check_cfg(package='icu-i18n', args='--cflags --libs', uselib_store='ICU', mandatory=False) is None: + if conf.check_cfg(package='icu', args='--cflags --libs', uselib_store='ICU', mandatory=False) is None: + conf.check_cxx(fragment=""" + #include + int main(void) { + UErrorCode status = U_ZERO_ERROR; + UCharsetDetector* detector = ucsdet_open (&status); + return 0; }\n + """, + mandatory=True, + msg='Checking for libicu', + okmsg='yes', + libpath=['/usr/local/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu'], + lib=['icuio', 'icui18n', 'icudata', 'icuuc'], + uselib_store='ICU') # libsndfile conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True) @@ -222,21 +237,21 @@ def configure(conf): # libdcp if conf.options.static_dcp: - conf.check_cfg(package='libdcp-1.0', atleast_version='1.2.4', args='--cflags', uselib_store='DCP', mandatory=True) + conf.check_cfg(package='libdcp-1.0', atleast_version='1.2.8', args='--cflags', uselib_store='DCP', mandatory=True) conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP] - conf.env.STLIB_DCP = ['dcp-1.0', 'asdcp-libdcp-1.0', 'kumu-libdcp-1.0'] + conf.env.STLIB_DCP = ['dcp-1.0', 'asdcp-libdcp-1.0', 'kumu-libdcp-1.0', 'openjp2'] conf.env.LIB_DCP = ['glibmm-2.4', 'ssl', 'crypto', 'bz2', 'xslt'] else: - conf.check_cfg(package='libdcp-1.0', atleast_version='1.2.4', args='--cflags --libs', uselib_store='DCP', mandatory=True) + conf.check_cfg(package='libdcp-1.0', atleast_version='1.2.8', args='--cflags --libs', uselib_store='DCP', mandatory=True) conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP] # libsub if conf.options.static_sub: - conf.check_cfg(package='libsub-1.0', atleast_version='1.1.5', args='--cflags', uselib_store='SUB', mandatory=True) + conf.check_cfg(package='libsub-1.0', atleast_version='1.1.8', args='--cflags', uselib_store='SUB', mandatory=True) conf.env.DEFINES_SUB = [f.replace('\\', '') for f in conf.env.DEFINES_SUB] conf.env.STLIB_SUB = ['sub-1.0'] else: - conf.check_cfg(package='libsub-1.0', atleast_version='1.1.5', args='--cflags --libs', uselib_store='SUB', mandatory=True) + conf.check_cfg(package='libsub-1.0', atleast_version='1.1.8', args='--cflags --libs', uselib_store='SUB', mandatory=True) conf.env.DEFINES_SUB = [f.replace('\\', '') for f in conf.env.DEFINES_SUB] # libxml++ @@ -252,18 +267,9 @@ def configure(conf): else: conf.env.LIB_XMLSEC = ['xmlsec1-openssl', 'xmlsec1'] - # OpenJPEG - if conf.options.static_openjpeg: - conf.check_cfg(package='libopenjpeg', args='--cflags', atleast_version='1.5.0', uselib_store='OPENJPEG', mandatory=True) - conf.check_cfg(package='libopenjpeg', args='--cflags', max_version='1.5.2', mandatory=True) - conf.env.STLIB_OPENJPEG = ['openjpeg'] - else: - conf.check_cfg(package='libopenjpeg', args='--cflags --libs', atleast_version='1.5.0', uselib_store='OPENJPEG', mandatory=True) - conf.check_cfg(package='libopenjpeg', args='--cflags --libs', max_version='1.5.2', mandatory=True) - # FFmpeg if conf.options.static_ffmpeg: - names = ['avformat', 'avfilter', 'avcodec', 'avutil', 'swscale', 'swresample', 'postproc'] + names = ['avformat', 'avfilter', 'avcodec', 'avutil', 'swscale', 'postproc'] for name in names: static = subprocess.Popen(shlex.split('pkg-config --static --libs lib%s' % name), stdout=subprocess.PIPE).communicate()[0] libs = [] @@ -291,9 +297,22 @@ def configure(conf): 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) + # Check to see if we have our version of FFmpeg that allows us to get at EBUR128 results + conf.check_cxx(fragment=""" + extern "C" {\n + #include \n + }\n + int main () { av_ebur128_get_true_peaks (0); }\n + """, + msg='Checking for patched FFmpeg', + libpath='/usr/local/lib', + lib=['avfilter'], + uselib_store='PATCHED_FFMPEG', + defines_name='DCPOMATIC_HAVE_PATCHED_FFMPEG', + mandatory=False) + # Boost if conf.options.static_boost: conf.env.STLIB_BOOST_THREAD = ['boost_thread'] @@ -357,6 +376,15 @@ def configure(conf): lib=['boost_regex%s' % boost_lib_suffix], uselib_store='BOOST_REGEX') + # libxml++ requires glibmm and versions of glibmm 2.45.31 and later + # must be built with -std=c++11 as they use c++11 + # features and c++11 is not (yet) the default in gcc. + glibmm_version = conf.cmd_and_log(['pkg-config', '--modversion', 'glibmm-2.4'], output=Context.STDOUT, quiet=Context.BOTH) + s = glibmm_version.split('.') + v = (int(s[0]) << 16) | (int(s[1]) << 8) | int(s[2]) + if v >= 0x022D1F: + conf.env.append_value('CXXFLAGS', '-std=c++11') + # Other stuff conf.find_program('msgfmt', var='MSGFMT') @@ -390,7 +418,6 @@ def configure(conf): report('DCP-o-matic libraries', conf.options.static_dcpomatic) report('Boost', conf.options.static_boost) - report('OpenJPEG', conf.options.static_openjpeg) report('wxWidgets', conf.options.static_wxwidgets) report('FFmpeg', conf.options.static_ffmpeg) report('libxml++', conf.options.static_xmlpp) @@ -406,6 +433,8 @@ def build(bld): create_version_cc(VERSION, bld.env.CXXFLAGS) bld.recurse('src') + bld.recurse('graphics') + if not bld.env.DISABLE_TESTS: bld.recurse('test') if bld.env.TARGET_WINDOWS: @@ -415,13 +444,10 @@ def build(bld): if bld.env.TARGET_OSX: bld.recurse('platform/osx') - for r in ['22x22', '32x32', '48x48', '64x64', '128x128']: - bld.install_files('${PREFIX}/share/icons/hicolor/%s/apps' % r, 'graphics/%s/dcpomatic2.png' % r) - if not bld.env.TARGET_WINDOWS: - bld.install_files('${PREFIX}/share/dcpomatic2', 'graphics/taskbar_icon.png') - bld.install_files('${PREFIX}/share/dcpomatic2', 'graphics/splash.png') - bld.install_files('${PREFIX}/share/dcpomatic2', 'LiberationSans-Regular.ttf') + bld.install_files('${PREFIX}/share/dcpomatic2', 'fonts/LiberationSans-Regular.ttf') + bld.install_files('${PREFIX}/share/dcpomatic2', 'fonts/LiberationSans-Italic.ttf') + bld.install_files('${PREFIX}/share/dcpomatic2', 'fonts/LiberationSans-Bold.ttf') bld.add_post_fun(post) @@ -486,15 +512,7 @@ def pot_merge(bld): bld.recurse('src') def tags(bld): - os.system('etags src/lib/*.cc src/lib/*.h src/wx/*.cc src/wx/*.h src/tools/*.cc src/tools/*.h') - -def zanata_pull(bld): - os.system('zanata-cli -B -q pull -t .') - for f in glob.glob('src/lib/po/*.po'): - l = os.path.basename(f) - os.rename('dcpomatic_%s' % l, 'src/tools/po/%s' % l) - os.rename('libdcpomatic_%s' % l, 'src/lib/po/%s' % l) - os.rename('libdcpomatic-wx_%s' % l, 'src/wx/po/%s' % l) + os.system('etags src/lib/*.cc src/lib/*.h src/wx/*.cc src/wx/*.h src/tools/*.cc') def cppcheck(bld): os.system('cppcheck --enable=all --quiet .')