Cleanup: missing word in comment.
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index 58f5be90e6528fddaa58cab04cc3127e0d257f38..6f7399f55403bfcdddf7cddcee14adc56eeb9384 100644 (file)
--- a/cscript
+++ b/cscript
 #
 
 from __future__ import print_function
+import datetime
 import glob
 import shutil
 import os
 import copy
 import json
 
+def dmg_prefix(variant):
+    return 'DCP-o-matic'
+
+def debian_name(variant):
+    return 'dcpomatic'
+
 deb_build_depends = dict()
 
 deb_build_depends_base = ['debhelper', 'g++', 'pkg-config', 'libsndfile1-dev', 'libgtk2.0-dev', 'libx264-dev']
 
-for v in ['16.04', '18.04', '20.04', '20.10', '21.04', '21.10']:
+for v in ['16.04', '18.04', '20.04']:
     deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
     deb_build_depends[v].extend(['libssh-dev', 'python'])
-for v in ['22.04', '22.10']:
+for v in ['22.04']:
     deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
     deb_build_depends[v].extend(['libssh-dev', 'python3.10'])
-for v in ['23.04']:
+for v in ['23.04', '23.10']:
     deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
     deb_build_depends[v].extend(['libssh-dev', 'python3.11'])
+for v in ['24.04']:
+    deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
+    deb_build_depends[v].extend(['libssh-dev', 'python3.12'])
 for v in ['9', '10']:
     deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
     deb_build_depends[v].extend(['libssh-gcrypt-dev', 'python'])
 for v in ['11']:
     deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
     deb_build_depends[v].extend(['libssh-gcrypt-dev', 'python3.9'])
+for v in ['12']:
+    deb_build_depends[v] = copy.deepcopy(deb_build_depends_base)
+    deb_build_depends[v].extend(['libssh-gcrypt-dev', 'python3.11'])
 deb_build_depends['unstable'] = copy.deepcopy(deb_build_depends_base)
 deb_build_depends['unstable'].extend(['python3'])
 
@@ -142,8 +155,8 @@ deb_depends['22.04'].extend(['libboost-filesystem1.74.0',
                              'libnanomsg5',
                              'libdav1d5'])
 
-deb_depends['22.10'] = copy.deepcopy(deb_depends_base)
-deb_depends['22.10'].extend(['libboost-filesystem1.74.0',
+deb_depends['23.04'] = copy.deepcopy(deb_depends_base)
+deb_depends['23.04'].extend(['libboost-filesystem1.74.0',
                              'libboost-thread1.74.0',
                              'libboost-regex1.74.0',
                              'libboost-date-time1.74.0',
@@ -151,17 +164,19 @@ deb_depends['22.10'].extend(['libboost-filesystem1.74.0',
                              'libpangomm-1.4-1v5',
                              'libxml++2.6-2v5',
                              'libzip4',
-                             'libicu71',
+                             'libicu72',
                              'libnettle8',
                              'libssh-4',
                              'libx264-164',
                              'libcurl4',
                              'libpulse0',
                              'libxerces-c3.2',
-                             'libnanomsg5'])
+                             'libnanomsg5',
+                             'libwxgtk3.2-1',
+                             'libwxgtk-gl3.2-1'])
 
-deb_depends['23.04'] = copy.deepcopy(deb_depends_base)
-deb_depends['23.04'].extend(['libboost-filesystem1.74.0',
+deb_depends['23.10'] = copy.deepcopy(deb_depends_base)
+deb_depends['23.10'].extend(['libboost-filesystem1.74.0',
                              'libboost-thread1.74.0',
                              'libboost-regex1.74.0',
                              'libboost-date-time1.74.0',
@@ -180,6 +195,30 @@ deb_depends['23.04'].extend(['libboost-filesystem1.74.0',
                              'libwxgtk3.2-1',
                              'libwxgtk-gl3.2-1'])
 
+def debs(boost, icu, x264):
+    output = copy.deepcopy(deb_depends_base)
+    output.extend(['libboost-filesystem' + boost,
+                   'libboost-thread' + boost,
+                   'libboost-regex' + boost,
+                   'libboost-date-time' + boost,
+                   'libcairomm-1.0-1v5',
+                   'libpangomm-1.4-1v5',
+                   'libxml++2.6-2v5',
+                   'libzip4',
+                   'libicu' + icu,
+                   'libnettle8',
+                   'libssh-4',
+                   'libx264-' + x264,
+                   'libcurl4',
+                   'libpulse0',
+                   'libxerces-c3.2',
+                   'libnanomsg5',
+                   'libwxgtk3.2-1',
+                   'libwxgtk-gl3.2-1'])
+    return output
+
+deb_depends['24.04'] = debs(boost='1.83.0', icu='74', x264='164')
+
 deb_depends['9'] = copy.deepcopy(deb_depends_base)
 deb_depends['9'].extend(['libboost-filesystem1.62.0',
                          'libboost-thread1.62.0',
@@ -251,6 +290,29 @@ deb_depends_gui['11'] = [ 'libxcb-xfixes0',
                           'libasound2',
                           'libpulse0' ]
 
+deb_depends['12'] = copy.deepcopy(deb_depends_base)
+deb_depends['12'].extend(['libboost-filesystem1.74.0',
+                          'libboost-thread1.74.0',
+                          'libboost-regex1.74.0',
+                          'libboost-date-time1.74.0',
+                          'libxml++2.6-2v5',
+                          'libzip4',
+                          'libcairomm-1.0-1v5',
+                          'libpangomm-1.4-1v5',
+                          'libicu72',
+                          'libssh-4',
+                          'libssh-gcrypt-4',
+                          'libnettle8',
+                          'libx264-164',
+                          'libcurl4',
+                          'libxerces-c3.2',
+                          'libnanomsg5'])
+
+deb_depends_gui['12'] = [ 'libxcb-xfixes0',
+                          'libxcb-shape0',
+                          'libasound2',
+                          'libpulse0' ]
+
 deb_depends['unstable'] = copy.deepcopy(deb_depends_base)
 deb_depends['unstable'].extend(['libboost-filesystem1.67.0',
                                 'libboost-thread1.67.0',
@@ -298,9 +360,9 @@ def packages(name, packages, f):
         s += str(p) + ', '
     print(s[:-2], file=f)
 
-def make_control(debian_version, bits, filename, debug, gui):
+def make_control(debian_version, bits, filename, debug, gui, name):
     f = open(filename, 'w')
-    print('Source: dcpomatic', file=f)
+    print(f'Source: {name}', file=f)
     print('Section: video', file=f)
     print('Priority: extra', file=f)
     print('Maintainer: Carl Hetherington <carl@dcpomatic.com>', file=f)
@@ -309,9 +371,9 @@ def make_control(debian_version, bits, filename, debug, gui):
     print('Homepage: https://dcpomatic.com/', file=f)
     print('', file=f)
     suffix = '' if gui else '-cli'
-    print(f'Package: dcpomatic{suffix}', file=f)
+    print(f'Package: {name}{suffix}', file=f)
     if gui:
-        print('Replaces: dcpomatic-cli', file=f)
+        print(f'Replaces: {name}-cli', file=f)
     if bits == 32:
         print('Architecture: i386', file=f)
     else:
@@ -332,7 +394,7 @@ def make_control(debian_version, bits, filename, debug, gui):
 
     if debug:
         print('', file=f)
-        print(f'Package: dcpomatic{suffix}-dbg', file=f)
+        print(f'Package: {name}{suffix}-dbg', file=f)
         if bits == 32:
             print('Architecture: i386', file=f)
         else:
@@ -340,8 +402,8 @@ def make_control(debian_version, bits, filename, debug, gui):
         print('Section: debug', file=f)
         print('Priority: extra', file=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(f'Description: debugging symbols for {name}', file=f)
+        print(f'  This package contains the debugging symbols for {name}.', file=f)
         print('', file=f)
 
 def make_spec(filename, version, target, options, requires=None):
@@ -375,7 +437,8 @@ def make_spec(filename, version, target, options, requires=None):
     print('%{_bindir}/dcpomatic2_playlist', file=f)
     print('%{_bindir}/dcpomatic2_openssl', file=f)
     print('%{_bindir}/dcpomatic2_combiner', file=f)
-    print('%{_bindir}/dcpomatic2_verify', file=f)
+    print('%{_bindir}/dcpomatic2_verify_cli', file=f)
+    print('%{_bindir}/dcpomatic2_verifier', file=f)
     print('%{_bindir}/dcpomatic2_kdm_inspect', file=f)
     print('%{_bindir}/dcpomatic2_map', file=f)
     if can_build_disk(target):
@@ -384,6 +447,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('%{_datadir}/applications/dcpomatic2.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_batch.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_editor.desktop', file=f)
+    print('%{_datadir}/applications/dcpomatic2_verifier.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_server.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_kdm.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_player.desktop', file=f)
@@ -402,9 +466,8 @@ def make_spec(filename, version, target, options, requires=None):
     print('%{_datadir}/dcpomatic2/zoom_black.png', file=f)
     print('%{_datadir}/dcpomatic2/zoom_all_white.png', file=f)
     print('%{_datadir}/dcpomatic2/zoom_all_black.png', file=f)
-    print('%{_datadir}/dcpomatic2/tick.png', file=f)
-    print('%{_datadir}/dcpomatic2/no_tick.png', file=f)
-    print('%{_datadir}/dcpomatic2/link.png', file=f)
+    print('%{_datadir}/dcpomatic2/link_black.png', file=f)
+    print('%{_datadir}/dcpomatic2/link_white.png', file=f)
     print('%{_datadir}/dcpomatic2/me.jpg', file=f)
     print('%{_datadir}/dcpomatic2/add_black.png', file=f)
     print('%{_datadir}/dcpomatic2/add_white.png', file=f)
@@ -418,6 +481,7 @@ def make_spec(filename, version, target, options, requires=None):
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2.png' % r, file=f)
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_batch.png' % r, file=f)
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_editor.png' % r, file=f)
+        print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_verifier.png' % r, file=f)
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_kdm.png' % r, file=f)
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_server.png' % r, file=f)
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_player.png' % r, file=f)
@@ -425,7 +489,8 @@ def make_spec(filename, version, target, options, requires=None):
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_disk.png' % r, file=f)
         print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_combiner.png' % r, file=f)
     for l in ['de_DE', 'es_ES', 'fr_FR', 'it_IT', 'sv_SE', 'nl_NL', 'ru_RU', 'pl_PL', 'da_DK',
-              'pt_PT', 'pt_BR', 'sk_SK', 'cs_CZ', 'uk_UA', 'zh_CN', 'tr_TR', 'sl_SI', 'hu_HU']:
+              'pt_PT', 'pt_BR', 'sk_SK', 'cs_CZ', 'uk_UA', 'zh_CN', 'tr_TR', 'sl_SI', 'hu_HU',
+              'ka_KA', 'fa_IR']:
         print('%%{_datadir}/locale/%s/LC_MESSAGES/dcpomatic2.mo' % l, file=f)
         print('%%{_datadir}/locale/%s/LC_MESSAGES/libdcpomatic2-wx.mo' % l, file=f)
         print('%%{_datadir}/locale/%s/LC_MESSAGES/libdcpomatic2.mo' % l, file=f)
@@ -451,7 +516,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('/bin/cp -r %s/src/libdcp/tags %%{buildroot}/usr/share/libdcp' % target.directory, file=f)
     print('/bin/cp -r %s/src/libdcp/xsd %%{buildroot}/usr/share/libdcp' % target.directory, file=f)
     print('/bin/cp %s/src/libdcp/ratings %%{buildroot}/usr/share/libdcp' % target.directory, file=f)
-    print('/bin/mv %s/bin/dcpverify %%{buildroot}/usr/bin/dcpomatic2_verify' % target.directory, file=f)
+    print('/bin/mv %s/bin/dcpverify %%{buildroot}/usr/bin/dcpomatic2_verify_cli' % target.directory, file=f)
     print('/bin/mv %s/bin/dcpkdm %%{buildroot}/usr/bin/dcpomatic2_kdm_inspect' % target.directory, file=f)
     print('', file=f)
     print('%post', file=f)
@@ -468,30 +533,18 @@ 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', '2fb5e99b45e92880bd7953cb98c2027a34884c14', ffmpeg_options)]
-    else:
-        # Use distro-provided FFmpeg on Arch
-        deps = []
-
-    deps.append(('libdcp', 'v1.8.69'))
-    deps.append(('libsub', 'v1.6.44'))
-    deps.append(('leqm-nrt', '4560105773c66ac9216b62313a24093bb0a027ae'))
+    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'))
     # We get our OpenSSL libraries from the environment, but we
     # also need a patched openssl binary to make certificates.
     # This dependency is to get that binary, which is added into
     # the appropriate place later
-    deps.append(('openssl', '7f29dd5'))
+    deps.append(('openssl', '54298369cacfe0ae01c5aa42ace8a463fd2e7a2e'))
     if can_build_disk(target):
-        deps.append(('lwext4', 'b98f55b806f9dfe9e9374faceed99b689c29f28e'))
-    deps.append(('ffcmp', '15e7fdf0b3896e3f7323a950105382a9c8ae3c39'))
+        deps.append(('lwext4', 'ab082923a791b58478d1d9939d65a0583566ac1f'))
+    deps.append(('ffcmp', '5ab6ed3b75d8ca7cf1f66bb9fb08792b92f4b419'))
 
     return deps
 
@@ -523,7 +576,7 @@ def configure_options(target, options, for_package=False):
     if not options['gui']:
         opt += ' --disable-gui'
 
-    if options['variant'] is not None:
+    if options['variant']:
         opt += ' --variant=%s' % options['variant']
 
     # Build Windows debug versions with static linking as I think gdb works better then
@@ -533,8 +586,13 @@ def configure_options(target, options, for_package=False):
     if can_build_disk(target):
         opt += ' --enable-disk'
 
-    if target.platform == 'osx' and target.arch == 'arm64':
-        opt += ' --target-macos-arm64 --wx-config=%s/wx-config' % target.bin
+    if target.platform == 'osx':
+        opt += ' --c++17'
+        if target.arch == 'arm64':
+            opt += ' --wx-config=%s/wx-config' % target.bin
+
+    if target.platform == 'linux' and target.distro == 'ubuntu' and target.version in ['22.04']:
+        opt += ' --enable-grok'
 
     return opt
 
@@ -659,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))
@@ -675,7 +730,8 @@ def package_windows(target):
     return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0])
 
 def package_debian(target, cpu, version, options):
-    make_control(target.version, target.bits, 'debian/control', target.debug, options['gui'])
+    name = debian_name(options['variant'])
+    make_control(target.version, target.bits, 'debian/control', target.debug, options['gui'], name)
     if target.version != '9' and target.version != '16.04' and options['gui']:
         with open('debian/postinst', 'w') as f:
             print('#!/bin/sh', file=f)
@@ -684,24 +740,30 @@ def package_debian(target, cpu, version, options):
     target.command('./waf dist')
     f = open('debian/files', 'w')
     suffix = '' if options['gui'] else '-cli'
-    print(f'dcpomatic{suffix}_{version}-1_{cpu}.deb video extra', file=f)
+    print(f'{name}{suffix}_{version}-1_{cpu}.deb video extra', file=f)
     shutil.rmtree('build/deb', ignore_errors=True)
 
     os.makedirs('build/deb')
     os.chdir('build/deb')
-    shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version)
-    target.command('tar xjf dcpomatic_%s.orig.tar.bz2' % version)
-    os.chdir('dcpomatic-%s' % version)
-    target.set('EMAIL', 'carl@dcpomatic.com')
-    target.command('dch -b -v %s-1 "New upstream release."' % version)
+    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}')
+
+    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'))
     target.set('CDIST_DIRECTORY', target.directory)
 
     target.set('CDIST_CONFIGURE', '"' + configure_options(target, options, for_package=True) + '"')
-    target.set('CDIST_PACKAGE', f'dcpomatic{suffix}')
-    target.set('CDIST_WX_VERSION', "3.2" if target.version == "23.04" else "3.1")
+    target.set('CDIST_PACKAGE', f'{name}{suffix}')
+    target.set('CDIST_WX_VERSION', "3.2" if target.version in ("23.04", "23.10", "24.04") else "3.1")
     if not target.debug:
         target.set('CDIST_DEBUG_PACKAGE_FLAG', '--no-ddebs')
 
@@ -733,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 = []
 
@@ -746,14 +810,17 @@ def package_rpm(target, cpu, version, options):
 
     return rpms
 
-def make_appimage(target, nice_name, internal_name, version):
+def make_appimage(target, nice_name, internal_name, version, extra_binaries=None):
     nice_filename = nice_name.replace(' ', '_')
     appdir = f'build/{nice_filename}.AppDir'
     os.makedirs(f'{appdir}/usr/bin')
     target.command(f'cp {target.directory}/bin/{internal_name} {appdir}/usr/bin')
     target.command(f'cp {target.directory}/src/openssl/apps/openssl {appdir}/usr/bin/dcpomatic2_openssl')
-    target.command(f'cp {target.directory}/bin/dcpverify {appdir}/usr/bin/dcpomatic2_verify')
+    target.command(f'cp {target.directory}/bin/dcpverify {appdir}/usr/bin/dcpomatic2_verify_cli')
     target.command(f'cp {target.directory}/bin/dcpkdm {appdir}/usr/bin/dcpomatic2_kdm_inspect')
+    if extra_binaries:
+        for bin in extra_binaries:
+            target.command(f'cp {target.directory}/bin/{bin} {appdir}/usr/bin')
     target.command(f'mkdir -p {appdir}/usr/share/libdcp')
     target.command(f'cp -r {target.directory}/share/dcpomatic2 {appdir}/usr/share/')
     target.command(f'cp -r {target.directory}/share/libdcp/xsd {appdir}/usr/share/libdcp/')
@@ -762,8 +829,8 @@ def make_appimage(target, nice_name, internal_name, version):
     lib = 'usr/lib/x86_64-linux-gnu'
     target.command(f'mkdir -p build/{nice_filename}.AppDir/{lib}/gdk-pixbuf-2.0/2.10.0')
     target.command(f'cp -a /{lib}/gdk-pixbuf-2.0 build/{nice_filename}.AppDir/usr/lib/x86_64-linux-gnu/')
-    target.command('apt update')
-    for package in ['libc6', 'libglib2.0-0', 'gnome-settings-daemon-schemas', 'librsvg2-common', 'libgdk-pixbuf2.0-0', 'libpango-1.0-0', 'libpangoft2-1.0-0', 'libpangocairo-1.0-0']:
+    target.command('sudo apt update')
+    for package in ['libc6', 'libglib2.0-0', 'gnome-settings-daemon-schemas', 'librsvg2-common', 'libgdk-pixbuf2.0-0', 'libpango-1.0-0', 'libpangoft2-1.0-0', 'libpangocairo-1.0-0', 'libthai0']:
         target.command(f'apt download {package}')
         target.command(f'dpkg-deb -x {package}*.deb {appdir}')
     target.command(f'glib-compile-schemas {appdir}/usr/share/glib-2.0/schemas')
@@ -803,7 +870,7 @@ def package(target, version, options):
     elif target.platform == 'linux':
         if target.detail == 'appimage':
             out = []
-            out.append(make_appimage(target, 'DCP-o-matic', 'dcpomatic2', version))
+            out.append(make_appimage(target, 'DCP-o-matic', 'dcpomatic2', version, ('dcpomatic2_map', 'dcpomatic2_cli')))
             out.append(make_appimage(target, 'DCP-o-matic Player', 'dcpomatic2_player', version))
             out.append(make_appimage(target, 'DCP-o-matic Playlist Editor', 'dcpomatic2_playlist', version))
             out.append(make_appimage(target, 'DCP-o-matic KDM Creator', 'dcpomatic2_kdm', version))
@@ -811,6 +878,7 @@ def package(target, version, options):
             out.append(make_appimage(target, 'DCP-o-matic Encode Server', 'dcpomatic2_server', version))
             out.append(make_appimage(target, 'DCP-o-matic Combiner', 'dcpomatic2_combiner', version))
             out.append(make_appimage(target, 'DCP-o-matic Editor', 'dcpomatic2_editor', version))
+            out.append(make_appimage(target, 'DCP-o-matic Verifier', 'dcpomatic2_verifier', version))
             return out
         else:
             if target.bits == 32:
@@ -827,29 +895,10 @@ def package(target, version, options):
         cmd = 'bash platform/osx/make_dmg.sh -e %s -r %s -i %s -p %s %s' % (target.environment_prefix, target.directory, target.apple_id, target.apple_password, archs)
         if 'part' in options:
             cmd += ' -b ' + options['part']
+        if options['variant']:
+            cmd += ' -v ' + options['variant']
         target.command(cmd)
-        packages = []
-        for x in glob.glob('build/platform/osx/DCP-o-matic*.dmg'):
-            a = os.path.abspath(x)
-            if x.find("Player") != -1:
-                packages.append((a, "com.dcpomatic.player"))
-            elif x.find("Playlist Editor") != -1:
-                packages.append((a, "com.dcpomatic.playlist"))
-            elif x.find("KDM Creator") != -1:
-                packages.append((a, "com.dcpomatic.kdm"))
-            elif x.find("Batch Converter") != -1:
-                packages.append((a, "com.dcpomatic.batch"))
-            elif x.find("Encode Server") != -1:
-                packages.append((a, "com.dcpomatic.server"))
-            elif x.find("Disk Writer") != -1:
-                packages.append((a, "com.dcpomatic.disk"))
-            elif x.find("Combiner") != -1:
-                packages.append((a, "com.dcpomatic.combiner"))
-            elif x.find("Editor") != -1:
-                packages.append((a, "com.dcpomatic.editor"))
-            else:
-                packages.append((a, "com.dcpomatic"))
-        return packages
+        return glob.glob('build/platform/osx/' + dmg_prefix(options['variant']) + '*.dmg')
     elif target.platform == 'docker':
         shutil.copyfile(target.deb, 'build/platform/docker')
         f = open('build/platform/docker/Dockerfile', 'w')
@@ -886,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: