Cleanup: missing word in comment.
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index 17c9df38678fa593057af97f39d941bc10b80eaf..6f7399f55403bfcdddf7cddcee14adc56eeb9384 100644 (file)
--- a/cscript
+++ b/cscript
@@ -19,6 +19,7 @@
 #
 
 from __future__ import print_function
+import datetime
 import glob
 import shutil
 import os
@@ -532,19 +533,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
 
 def dependencies(target, options):
-
-    if target.platform == 'linux':
-        ffmpeg_options = { 'shared': False }
-    else:
-        ffmpeg_options = {}
-
-    if target.platform != 'linux' or target.distro != 'arch':
-        deps = [('ffmpeg', '0b73d2f5e70a04a67aa902902c42e3025ef3bb77', ffmpeg_options)]
-    else:
-        # Use distro-provided FFmpeg on Arch
-        deps = []
-
-    deps.append(('libdcp', '816365d20e0c6ef37b6bf499a42a0d3ecad22c05', {'c++17': target.platform == 'osx'}))
+    deps = [('libdcp', 'v1.9.7', {'c++17': target.platform == 'osx'})]
     deps.append(('libsub', 'v1.6.47'))
     deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
     deps.append(('rtaudio', 'f619b76'))
@@ -728,10 +717,7 @@ def build(target, options, for_package):
         target.command('./waf install')
 
 def package_windows(target):
-    identifier = ''
-    if target.version is not None:
-        identifier = '%s.' % target.version
-    identifier += '%d' % target.bits
+    identifier = '%d' % target.bits
     shutil.copyfile('build/platform/windows/installer.%s.nsi' % identifier, 'build/platform/windows/installer2.%s.nsi' % identifier)
     target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), identifier))
     target.command('sed -i "s~%%graphics%%~%s/graphics~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), identifier))
@@ -759,11 +745,17 @@ def package_debian(target, cpu, version, options):
 
     os.makedirs('build/deb')
     os.chdir('build/deb')
-    shutil.move(f'../../dcpomatic-{version}.tar.bz2', f'{name}_{version}.orig.tar.bz2')
-    target.command(f'tar xjf {name}_{version}.orig.tar.bz2')
+    shutil.move(f'../../dcpomatic-{version}.tar.bz2', f'{name}_1+{version}.orig.tar.bz2')
+    target.command(f'tar xjf {name}_1+{version}.orig.tar.bz2')
     os.chdir(f'dcpomatic-{version}')
-    target.set('EMAIL', 'carl@dcpomatic.com')
-    target.command('dch -b -v %s-1 "New upstream release."' % version)
+
+    with open('debian/changelog', 'w') as f:
+        print(f'{name} (1+{version}-1) unstable; urgency=medium', file=f)
+        print('', file=f)
+        print('  * New upstream release.', file=f)
+        print('', file=f)
+        print(f" -- Carl Hetherington <carl@dcpomatic.com>  {datetime.datetime.now().astimezone().strftime('%a, %d %b %Y %H:%M:%S %z')}", file=f)
+
     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'))
@@ -803,6 +795,8 @@ def package_rpm(target, cpu, version, options):
 
     make_spec('dcpomatic2.spec', version, target, options, requires)
     cmd = 'rpmbuild --define "_topdir %s" -bb dcpomatic2.spec' % topdir
+    # On Centos 7 we build and install boost ourselves, so we must look for it in the right place
+    target.set('LINKFLAGS', '-L/usr/local/lib')
     target.command(cmd)
     rpms = []
 
@@ -941,7 +935,11 @@ def test(target, options, test):
     if target.platform == 'windows':
         cmd = 'run\\tests '
     else:
-        cmd = 'run/tests --check --log_level=test_suite '
+        cmd = 'run/tests '
+    if target.environment_prefix:
+        cmd += '-e %s ' % target.environment_prefix
+    if target.platform != 'windows':
+        cmd += ' --check --log_level=test_suite '
     if target.debug:
         cmd += '--backtrace '
     if test is not None: