X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=wscript;h=4b4c1342ddf758efb72856fe27ed32af28dfed48;hb=89ea093ab1ed7a526b9332922c674d9eca42d7f2;hp=ddf0a240cecf863d1d3c74375f03d64e4d894e20;hpb=33dd911e6c2cc3c42425d4260bd22dbe462d01be;p=dcpomatic.git diff --git a/wscript b/wscript index ddf0a240c..4b4c1342d 100644 --- a/wscript +++ b/wscript @@ -86,7 +86,7 @@ def configure(conf): # Dependencies which are dynamically linked everywhere except --static # Get libs only when we are dynamically linking - conf.check_cfg(package='libdcp', atleast_version='0.66', args=pkg_config_args(conf), uselib_store='DCP', mandatory=True) + conf.check_cfg(package='libdcp', atleast_version='0.67', args=pkg_config_args(conf), uselib_store='DCP', mandatory=True) # Remove erroneous escaping of quotes from xmlsec1 defines conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP] conf.check_cfg(package='libcxml', atleast_version='0.01', args=pkg_config_args(conf), uselib_store='CXML', mandatory=True) @@ -118,6 +118,7 @@ def configure(conf): conf.env.STLIB_SWSCALE = ['swscale'] conf.env.STLIB_POSTPROC = ['postproc'] conf.env.STLIB_SWRESAMPLE = ['swresample'] + conf.env.STLIB_OPENJPEG = ['openjpeg'] # Dependencies which are always dynamically linked conf.check_cfg(package='sndfile', args='--cflags --libs', uselib_store='SNDFILE', mandatory=True) @@ -216,20 +217,36 @@ def build(bld): bld.add_post_fun(post) +def git_revision(): + if not os.path.exists('.git'): + return None + + 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') + return o.replace("commit ", "")[0:10] + def dist(ctx): + r = git_revision() + if r is not None: + f = open('.git_revision', 'w') + print >>f,r + f.close() + ctx.excl = """ TODO core *~ src/wx/*~ src/lib/*~ builds/*~ doc/manual/*~ src/tools/*~ *.pyc .waf* build .git deps alignment hacks sync *.tar.bz2 *.exe .lock* *build-windows doc/manual/pdf doc/manual/html GRSYMS GRTAGS GSYMS GTAGS """ + def create_version_cc(version, cxx_flags): - if os.path.exists('.git'): - 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] - else: + commit = git_revision() + if commit is None and os.path.exists('.git_revision'): + f = open('.git_revision', 'r') + commit = f.readline().strip() + + if commit is None: commit = 'release' try: