Bump libdcp.
[dcpomatic.git] / wscript
diff --git a/wscript b/wscript
index f0165ce9f05736012ed6771720c1709befb448ab..2583d400af6e5f13e31cd4eec0a658d7b0db3860 100644 (file)
--- a/wscript
+++ b/wscript
@@ -27,12 +27,21 @@ import distutils.spawn
 from waflib import Logs, Context
 
 APPNAME = 'dcpomatic'
-VERSION = '2.11.33devel'
+
+this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
+last_version = subprocess.Popen(shlex.split('git describe --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+
+if this_version == '':
+    VERSION = '%sdevel' % last_version[1:].strip()
+else:
+    VERSION = this_version[1:].strip()
+
+print 'Version: %s' % VERSION
 
 def options(opt):
     opt.load('compiler_cxx')
     opt.load('winres')
-
+    
     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('--disable-tests',     action='store_true', default=False, help='disable building of tests')
@@ -54,6 +63,7 @@ def options(opt):
 
 def configure(conf):
     conf.load('compiler_cxx')
+    conf.load('clang_compilation_database', tooldir=['waf-tools'])
     if conf.options.target_windows:
         conf.load('winres')
 
@@ -78,8 +88,9 @@ def configure(conf):
                                        '-msse',
                                        '-fno-strict-aliasing',
                                        '-Wall',
-                                       '-Wno-attributes',
+                                       '-Wcast-align',
                                        '-Wextra',
+                                       '-Wwrite-strings',
                                        # Remove auto_ptr warnings from libxml++-2.6
                                        '-Wno-deprecated-declarations',
                                        '-D_FILE_OFFSET_BITS=64'])
@@ -137,6 +148,7 @@ def configure(conf):
     # POSIX
     if conf.env.TARGET_LINUX or conf.env.TARGET_OSX:
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_POSIX')
+        conf.env.append_value('CXXFLAGS', ['-Wunsafe-loop-optimizations', '-Wlogical-op'])
         boost_lib_suffix = ''
         boost_thread = 'boost_thread'
         conf.env.append_value('LINKFLAGS', '-pthread')
@@ -269,6 +281,15 @@ def configure(conf):
 
     # libzip
     conf.check_cfg(package='libzip', args='--cflags --libs', uselib_store='ZIP', mandatory=True)
+    conf.check_cxx(fragment="""
+                            #include <zip.h>
+                            int main() { zip_source_t* foo; }
+                            """,
+                   mandatory=False,
+                   msg="Checking for zip_source_t",
+                   uselib="ZIP",
+                   define_name='DCPOMATIC_HAVE_ZIP_SOURCE_T'
+                   )
 
     # fontconfig
     conf.check_cfg(package='fontconfig', args='--cflags --libs', uselib_store='FONTCONFIG', mandatory=True)
@@ -318,10 +339,10 @@ def configure(conf):
 
     # libcxml
     if conf.options.static_cxml:
-        conf.check_cfg(package='libcxml', atleast_version='0.15.1', args='--cflags', uselib_store='CXML', mandatory=True)
+        conf.check_cfg(package='libcxml', atleast_version='0.15.5', args='--cflags', uselib_store='CXML', mandatory=True)
         conf.env.STLIB_CXML = ['cxml']
     else:
-        conf.check_cfg(package='libcxml', atleast_version='0.15.1', args='--cflags --libs', uselib_store='CXML', mandatory=True)
+        conf.check_cfg(package='libcxml', atleast_version='0.15.5', args='--cflags --libs', uselib_store='CXML', mandatory=True)
 
     # libssh
     if conf.options.static_ssh:
@@ -343,21 +364,21 @@ def configure(conf):
 
     # libdcp
     if conf.options.static_dcp:
-        conf.check_cfg(package='libdcp-1.0', atleast_version='1.4.1', args='--cflags', uselib_store='DCP', mandatory=True)
+        conf.check_cfg(package='libdcp-1.0', atleast_version='1.5.1', 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-cth', 'kumu-cth', 'openjp2']
         conf.env.LIB_DCP = ['glibmm-2.4', 'ssl', 'crypto', 'bz2', 'xslt']
     else:
-        conf.check_cfg(package='libdcp-1.0', atleast_version='1.4.1', args='--cflags --libs', uselib_store='DCP', mandatory=True)
+        conf.check_cfg(package='libdcp-1.0', atleast_version='1.5.1', 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.2.1', args='--cflags', uselib_store='SUB', mandatory=True)
+        conf.check_cfg(package='libsub-1.0', atleast_version='1.3.0', 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.2.1', args='--cflags --libs', uselib_store='SUB', mandatory=True)
+        conf.check_cfg(package='libsub-1.0', atleast_version='1.3.0', args='--cflags --libs', uselib_store='SUB', mandatory=True)
         conf.env.DEFINES_SUB = [f.replace('\\', '') for f in conf.env.DEFINES_SUB]
 
     # libxml++
@@ -579,8 +600,12 @@ def configure(conf):
 
     Logs.pprint('YELLOW', '')
 
+def download_supporters():
+    os.system('curl https://dcpomatic.com/supporters.cc > build/supporters.cc')
+
 def build(bld):
     create_version_cc(VERSION, bld.env.CXXFLAGS)
+    download_supporters()
 
     bld.recurse('src')
     bld.recurse('graphics')