X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=cscript;h=47efefdba4761f1bee44de3ec9e7c5aae3b5ff42;hb=8b9b01ea76edb9fee8759b3aa88d43380e2db324;hp=e9317b0ade41b709a3edff240430385f97ac2ad8;hpb=4e10d277c6b052c18ec4e4aae14c26b0b9cb87af;p=dcpomatic.git diff --git a/cscript b/cscript index e9317b0ad..47efefdba 100644 --- 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', '5783efa', ffmpeg_options)] + else: + deps = [('ffmpeg-cdist', '27f25fb', ffmpeg_options)] + + deps.append(('libdcp', 'f2f2a2a')) + deps.append(('libsub', 'c2d6d92')) + 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', @@ -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')]