More renaming.
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index 887978c3fe7159ab24f12717989e78cb5c315443..4820f73797fbd549a78a4281f216fdad446b20a9 100644 (file)
--- a/cscript
+++ b/cscript
@@ -45,6 +45,7 @@ deb_build_depends['9'].extend(['libssh-gcrypt-dev'])
 deb_build_depends['unstable'] = copy.deepcopy(deb_build_depends_base)
 
 deb_depends = dict()
+deb_depends_gui = dict()
 
 deb_depends_base = ['libc6', 'libsndfile1', 'libsamplerate0', 'libxmlsec1', 'libxmlsec1-openssl', 'libgtk2.0-0']
 
@@ -159,18 +160,19 @@ deb_depends['9'].extend(['libboost-filesystem1.62.0',
                          'libzip4',
                          'libcairomm-1.0-1v5',
                          'libpangomm-1.4-1v5',
-                         'libwxgtk3.0-0v5',
-                         'libxcb-xfixes0',
-                         'libxcb-shape0',
-                         'libasound2',
                          'libicu57',
                          'libssh-4',
                          'libssh-gcrypt-4',
                          'libnettle6',
                          'libx264-148',
-                         'libpulse0',
                          'libcurl3'])
 
+deb_depends_gui['9'] = [ 'libwxgtk3.0-0v5',
+                         'libxcb-xfixes0',
+                         'libxcb-shape0',
+                         'libasound2',
+                         'libpulse0' ]
+
 deb_depends['unstable'] = copy.deepcopy(deb_depends_base)
 deb_depends['unstable'].extend(['libboost-filesystem1.62.0',
                                 'libboost-thread1.62.0',
@@ -191,7 +193,7 @@ def packages(name, packages, f):
         s += str(p) + ', '
     print(s[:-2], file=f)
 
-def make_control(debian_version, bits, filename, debug):
+def make_control(debian_version, bits, filename, debug, gui):
     f = open(filename, 'w')
     print('Source: dcpomatic', file=f)
     print('Section: video', file=f)
@@ -199,7 +201,7 @@ def make_control(debian_version, bits, filename, debug):
     print('Maintainer: Carl Hetherington <carl@dcpomatic.com>', file=f)
     packages('Build-Depends', deb_build_depends[debian_version], f)
     print('Standards-Version: 3.9.3', file=f)
-    print('Homepage: http://dcpomatic.com/', file=f)
+    print('Homepage: https://dcpomatic.com/', file=f)
     print('', file=f)
     print('Package: dcpomatic', file=f)
     if bits == 32:
@@ -207,7 +209,11 @@ def make_control(debian_version, bits, filename, debug):
     else:
         print('Architecture: amd64', file=f)
 
-    packages('Depends', deb_depends[debian_version], f)
+    pkg = deb_depends[debian_version]
+    if gui and debian_version in deb_depends_gui:
+        pkg.extend(deb_depends_gui[debian_version])
+
+    packages('Depends', pkg, f)
 
     print('Description: Generator of Digital Cinema Packages (DCPs)', file=f)
     print('  DCP-o-matic generates Digital Cinema Packages (DCPs) from videos, images,', file=f)
@@ -223,12 +229,12 @@ def make_control(debian_version, bits, filename, debug):
             print('Architecture: amd64', file=f)
         print('Section: debug', file=f)
         print('Priority: extra', file=f)
-        packages('Depends', deb_depends[debian_version], f)
+        packages('Depends', pkg, f)
         print('Description: debugging symbols for dcpomatic', file=f)
         print('  This package contains the debugging symbols for dcpomatic.', file=f)
         print('', file=f)
 
-def make_spec(filename, version, target, requires=None):
+def make_spec(filename, version, target, options, requires=None):
     """Make a .spec file for a RPM build"""
     f = open(filename, 'w')
     print('Summary:A program that generates Digital Cinema Packages (DCPs) from video and audio files', file=f)
@@ -237,7 +243,7 @@ def make_spec(filename, version, target, requires=None):
     print('Release:1%{?dist}', file=f)
     print('License:GPL', file=f)
     print('Group:Applications/Multimedia', file=f)
-    print('URL:http://dcpomatic.com/', file=f)
+    print('URL:https://dcpomatic.com/', file=f)
     if requires is not None:
         print('Requires:%s' % requires, file=f)
     print('', file=f)
@@ -262,6 +268,11 @@ def make_spec(filename, version, target, requires=None):
     print('%{_datadir}/applications/dcpomatic2_kdm.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_player.desktop', file=f)
     print('%{_datadir}/dcpomatic2/dcpomatic2_server_small.png', file=f)
+    print('%{_datadir}/dcpomatic2/select.png', file=f)
+    print('%{_datadir}/dcpomatic2/sequence.png', file=f)
+    print('%{_datadir}/dcpomatic2/snap.png', file=f)
+    print('%{_datadir}/dcpomatic2/zoom.png', file=f)
+    print('%{_datadir}/dcpomatic2/zoom_all.png', file=f)
     print('%{_datadir}/dcpomatic2/LiberationSans-Regular.ttf', file=f)
     print('%{_datadir}/dcpomatic2/LiberationSans-Italic.ttf', file=f)
     print('%{_datadir}/dcpomatic2/LiberationSans-Bold.ttf', file=f)
@@ -286,7 +297,7 @@ def make_spec(filename, version, target, requires=None):
     print('export PKG_CONFIG_PATH=%s/lib/pkgconfig:%s/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig' % (target.directory, target.directory), file=f)
 
     print('CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%%{buildroot}/usr --install-prefix=/usr %s' %
-          (target.directory, target.directory, configure_options(target)), file=f)
+          (target.directory, target.directory, configure_options(target, options)), file=f)
     print('./waf', file=f)
     print('%install', file=f)
     print('cd dcpomatic-%s' % version, file=f)
@@ -312,11 +323,14 @@ def dependencies(target):
         ffmpeg_options = {}
 
     return (('ffmpeg-cdist', '5c90508', ffmpeg_options),
-            ('libdcp', '7b03aba'),
-            ('libsub', 'b24b081'),
+            ('libdcp', '13a4ee8'),
+            ('libsub', '6fac211'),
             ('rtaudio-cdist', '739969e'))
 
-def configure_options(target):
+def option_defaults():
+    return { "gui": True }
+
+def configure_options(target, options):
     opt = ''
     if target.debug:
         opt += ' --enable-debug'
@@ -336,7 +350,7 @@ def configure_options(target):
                 # a better solution.
                 opt += ' --force-cpp11'
 
-    if hasattr(target, 'gui') and target.gui == 'no':
+    if not options['gui']:
         opt += ' --disable-gui'
 
     # Build Windows debug versions with static linking as I think gdb works better then
@@ -346,7 +360,7 @@ def configure_options(target):
     return opt
 
 def build(target, options):
-    target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target)))
+    target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target, options)))
     target.command('./waf')
 
     if target.platform == 'linux' or target.platform == 'osx':
@@ -368,8 +382,8 @@ def package_windows(target):
     target.command('makensis build/platform/windows/installer2.%s.nsi' % identifier)
     return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0])
 
-def package_debian(target, cpu, version):
-    make_control(target.version, target.bits, 'debian/control', target.debug)
+def package_debian(target, cpu, version, options):
+    make_control(target.version, target.bits, 'debian/control', target.debug, options['gui'])
     target.command('./waf dist')
     f = open('debian/files', 'w')
     print('dcpomatic_%s-1_%s.deb video extra' % (version, cpu), file=f)
@@ -385,7 +399,7 @@ def package_debian(target, cpu, version):
     target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS'))
     target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
 
-    target.set('CDIST_CONFIGURE', '"' + configure_options(target) + '"')
+    target.set('CDIST_CONFIGURE', '"' + configure_options(target, options) + '"')
     if target.debug:
         target.set('CDIST_DEBUG_PACKAGE', '--dbg-package=dcpomatic-dbg')
     if target.version in ['7', '14.04']:
@@ -401,8 +415,7 @@ def package_debian(target, cpu, version):
 
     return debs
 
-def package_rpm(target, cpu, version):
-    print('package_rpm %s %s %s' % (target, cpu, version))
+def package_rpm(target, cpu, version, options):
     topdir = os.path.realpath('build/rpmbuild')
     os.makedirs('%s/BUILD' % topdir)
     os.makedirs('%s/RPMS' % topdir)
@@ -420,7 +433,7 @@ def package_rpm(target, cpu, version):
     if target.distro == 'mageia':
         requires = "lib64xmlsec1-devel"
 
-    make_spec('build/platform/linux/dcpomatic2.spec', version, target, requires)
+    make_spec('build/platform/linux/dcpomatic2.spec', version, target, options, requires)
     cmd = 'rpmbuild --define "_topdir %s" -bb build/platform/linux/dcpomatic2.spec' % topdir
     target.command(cmd)
     rpms = []
@@ -437,7 +450,7 @@ def package_rpm(target, cpu, version):
 
     return rpms
 
-def package(target, version):
+def package(target, version, options):
     if target.platform == 'windows':
         return package_windows(target)
     elif target.platform == 'linux':
@@ -447,9 +460,9 @@ def package(target, version):
             cpu = 'amd64'
 
         if target.distro == 'debian' or target.distro == 'ubuntu':
-            return package_debian(target, cpu, version)
+            return package_debian(target, cpu, version, options)
         elif target.distro == 'centos' or target.distro == 'fedora' or target.distro == 'mageia':
-            return package_rpm(target, cpu, version)
+            return package_rpm(target, cpu, version, options)
     elif target.platform == 'osx':
         target.command('bash platform/osx/make_dmg.sh %s' % target.directory)
         return [os.path.abspath(x) for x in glob.glob('build/platform/osx/DCP-o-matic*.dmg')]