X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=cscript;h=969e2632fe1ffffd8ed6226010a79743d901025f;hb=10b9dfec41caf38bd111e7a8a03c73ebe04489b5;hp=c69d8f6a62cbe7796b50466453c4bfa9cc2eeb5a;hpb=dc1ea89cf7f64e2e412c6113fe6da4cf5599d9df;p=dcpomatic.git diff --git a/cscript b/cscript index c69d8f6a6..969e2632f 100644 --- a/cscript +++ b/cscript @@ -323,7 +323,7 @@ def dependencies(target): else: ffmpeg_options = {} - return (('ffmpeg-cdist', '5c90508', ffmpeg_options), + return (('ffmpeg-cdist', '27f25fb', ffmpeg_options), ('libdcp', '13a4ee8'), ('libsub', '6fac211'), ('rtaudio-cdist', '739969e')) @@ -469,7 +469,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 +478,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 +570,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 +632,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):