Typo.
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index c69d8f6a62cbe7796b50466453c4bfa9cc2eeb5a..2366ebdca0f9f0faacb0e91c284b5020c9ec689a 100644 (file)
--- a/cscript
+++ b/cscript
@@ -323,10 +323,16 @@ def dependencies(target):
     else:
         ffmpeg_options = {}
 
-    return (('ffmpeg-cdist', '5c90508', ffmpeg_options),
-            ('libdcp', '13a4ee8'),
-            ('libsub', '6fac211'),
-            ('rtaudio-cdist', '739969e'))
+    if target.platform == 'windows' and target.version == 'xp':
+        deps = [('ffmpeg-cdist', '65c6d93', ffmpeg_options)]
+    else:
+        deps = [('ffmpeg-cdist', '27f25fb', ffmpeg_options)]
+
+    deps.append(('libdcp', '348aaa6'))
+    deps.append(('libsub', '75d9785'))
+    deps.append(('rtaudio-cdist', '739969e'))
+
+    return deps
 
 def option_defaults():
     return { "gui": True }
@@ -372,8 +378,8 @@ def build(target, options):
         modules.append({'name': 'imagemagick',
                         'cleanup': ['/bin'],
                         'sources': [{'type': 'archive',
-                                    'url': 'https://www.imagemagick.org/download/ImageMagick-7.0.8-8.tar.bz2',
-                                    'sha256': 'bc678d7fe5fc7e22af0d0268fabc6559a3052a589220cec50d3da0c842de17c3'}]})
+                                    'url': 'https://www.imagemagick.org/download/ImageMagick-7.0.8-10.tar.bz2',
+                                    'sha256': 'f9d99573f8b8d7f90319fdf22a1a41a6764ac247b1c3f6ae08d9a3657ec977a5'}]})
         modules.append({'name': 'libsigc++',
                         'sources': [{'type': 'archive',
                                      'url': 'https://download.gnome.org/sources/libsigc++/2.10/libsigc++-2.10.0.tar.xz',
@@ -469,7 +475,7 @@ def build(target, options):
                         },
                        'sources': [{'type': 'dir', 'path': os.path.abspath('.')}]})
         desc = {'app-id': 'com.dcpomatic.DCP-o-matic',
-                'runtime': 'org.gnome.Platform',
+                'runtime': 'org.gnome.Sdk',
                 'runtime-version': '3.26',
                 'sdk': 'org.gnome.Sdk',
                 'command': 'dcpomatic2',
@@ -478,7 +484,7 @@ def build(target, options):
         os.makedirs('build/platform')
         with open('build/com.dcpomatic.DCP-o-matic.json', 'w') as outfile:
             json.dump(desc, outfile)
-        target.command('flatpak-builder --repo=build/platform/repo build/platform/flatpak build/com.dcpomatic.DCP-o-matic.json')
+        target.command('%s --repo=build/platform/repo build/platform/flatpak build/com.dcpomatic.DCP-o-matic.json' % target.flatpak_builder())
     else:
         target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target, options)))
         target.command('./waf')
@@ -570,20 +576,49 @@ def package_rpm(target, cpu, version, options):
 
     return rpms
 
+def make_appimage(target, nice_name, internal_name, version):
+    nice_filename = nice_name.replace(' ', '_')
+    os.makedirs('build/%s.AppDir/usr/bin' % nice_filename)
+    target.command('cp %s/bin/%s build/%s.AppDir/usr/bin' % (target.directory, internal_name, nice_filename))
+    with open('build/%s.AppDir/AppRun' % nice_filename, 'w') as f:
+        print('#!/bin/bash', file=f)
+        print('export APPDIR="$(dirname "$(readlink -f "$0")")"', file=f)
+        print('export PATH=$APPDIR/usr/bin:$PATH', file=f)
+        print('export XDG_DATA_DIRS="$APPDIR/usr/share/:/usr/share/:$XDG_DATA_DIRS"', file=f)
+        print('"$APPDIR"/usr/bin/%s $@' % internal_name, file=f)
+    target.command('chmod a+rx build/%s.AppDir/AppRun' % nice_filename)
+    with open('build/%s.AppDir/%s.desktop' % (nice_filename, internal_name), 'w') as f:
+        print('[Desktop Entry]', file=f)
+        print('Type=Application', file=f)
+        print('Name=%s' % nice_name, file=f)
+        print('Icon=%s' % internal_name, file=f)
+    target.command('cp graphics/linux/256/%s.png build/%s.AppDir' % (internal_name, nice_filename))
+    target.command('appimagetool-x86_64.AppImage build/%s.AppDir' % nice_filename)
+    target.command('mv %s-x86_64.AppImage build/%s-%s-x86_64.AppImage' % (nice_filename, nice_filename, version))
+    return os.path.abspath('build/%s-%s-x86_64.AppImage' % (nice_filename, version))
+
 def package(target, version, options):
     """version: DCP-o-matic version string"""
     if target.platform == 'windows':
         return package_windows(target)
     elif target.platform == 'linux':
-        if target.bits == 32:
-            cpu = 'i386'
+        if target.detail == 'appimage':
+            out = []
+            out.append(make_appimage(target, 'DCP-o-matic', 'dcpomatic2', version))
+            out.append(make_appimage(target, 'DCP-o-matic Player', 'dcpomatic2_player', version))
+            out.append(make_appimage(target, 'DCP-o-matic KDM Creator', 'dcpomatic2_kdm', version))
+            out.append(make_appimage(target, 'DCP-o-matic Batch Converter', 'dcpomatic2_batch', version))
+            return out
         else:
-            cpu = 'amd64'
-
-        if target.distro == 'debian' or target.distro == 'ubuntu':
-            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, options)
+            if target.bits == 32:
+                cpu = 'i386'
+            else:
+                cpu = 'amd64'
+
+            if target.distro == 'debian' or target.distro == 'ubuntu':
+                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, 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')]
@@ -603,7 +638,7 @@ def package(target, version, options):
         target.command('docker build build/platform/docker -t dcpomatic-server:%s' % version)
         target.command('docker save dcpomatic-server:%s -o dcpomatic-server-%s-docker.tar' % (version, version))
     elif target.platform == 'flatpak':
-        target.command('flatpak build-bundle build/platform/repo build/dcpomatic_%s.flatpak com.dcpomatic.DCP-o-matic' % version)
+        target.command('%s build-bundle build/platform/repo build/dcpomatic_%s.flatpak com.dcpomatic.DCP-o-matic' % (target.flatpak(), version))
         return os.path.abspath('build/dcpomatic_%s.flatpak' % version)
 
 def make_pot(target):