Support variants in the build scripts.
authorCarl Hetherington <cth@carlh.net>
Wed, 17 Apr 2024 08:01:03 +0000 (10:01 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 21 Apr 2024 20:07:15 +0000 (22:07 +0200)
cscript
platform/osx/dcpomatic2.Info.plist.in
platform/osx/dcpomatic2_kdm.Info.plist.in
platform/osx/dcpomatic2_player.Info.plist.in
platform/osx/dcpomatic2_verifier.Info.plist.in
platform/osx/make_dmg.sh
platform/osx/wscript
platform/windows/wscript
wscript

diff --git a/cscript b/cscript
index 6545f61900fcaf3bafdc0b967e6b8a69a1e24aec..17c9df38678fa593057af97f39d941bc10b80eaf 100644 (file)
--- a/cscript
+++ b/cscript
@@ -25,6 +25,12 @@ 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']
@@ -353,9 +359,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)
@@ -364,9 +370,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:
@@ -387,7 +393,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:
@@ -395,8 +401,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):
@@ -581,7 +587,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
@@ -738,7 +744,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)
@@ -747,14 +754,14 @@ 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)
+    shutil.move(f'../../dcpomatic-{version}.tar.bz2', f'{name}_{version}.orig.tar.bz2')
+    target.command(f'tar xjf {name}_{version}.orig.tar.bz2')
+    os.chdir(f'dcpomatic-{version}')
     target.set('EMAIL', 'carl@dcpomatic.com')
     target.command('dch -b -v %s-1 "New upstream release."' % version)
     target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS'))
@@ -763,7 +770,7 @@ def package_debian(target, cpu, version, options):
     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_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')
@@ -894,8 +901,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)
-        return glob.glob('build/platform/osx/DCP-o-matic*.dmg')
+        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')
index 00a7d99aa16c8a58cd788ab1d3391febb11d3646..a5550572bc79c6046be669fba8336e631ca893b3 100644 (file)
@@ -7,7 +7,7 @@
        <key>CFBundleExecutable</key>
        <string>dcpomatic2</string>
        <key>CFBundleGetInfoString</key>
-       <string>DCP-o-matic 2</string>
+       <string>@NAME@</string>
        <key>CFBundleIconFile</key>
        <string>dcpomatic2.icns</string>
        <key>CFBundleIdentifier</key>
@@ -15,7 +15,7 @@
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
-       <string>DCP-o-matic 2</string>
+       <string>@NAME@</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersions</key>
index 95016a97238ebd4f1898d85c2f904c67f977fbd2..151d20718479eb73e9fbbc33037fbac124e5a143 100644 (file)
@@ -7,7 +7,7 @@
        <key>CFBundleExecutable</key>
        <string>dcpomatic2_kdm</string>
        <key>CFBundleGetInfoString</key>
-       <string>DCP-o-matic 2 KDM creator</string>
+       <string>@NAME@</string>
        <key>CFBundleIconFile</key>
        <string>dcpomatic2_kdm.icns</string>
        <key>CFBundleIdentifier</key>
@@ -15,7 +15,7 @@
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
-       <string>DCP-o-matic 2 KDM Creator</string>
+       <string>@NAME@</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersions</key>
index 0a10e37271f544637cdabdec1da0e7e362d53425..54e688eaf204c63b45d5f9dbea442c9aee9047ff 100644 (file)
@@ -7,7 +7,7 @@
        <key>CFBundleExecutable</key>
        <string>dcpomatic2_player</string>
        <key>CFBundleGetInfoString</key>
-       <string>DCP-o-matic 2 Player</string>
+       <string>@NAME@</string>
        <key>CFBundleIconFile</key>
        <string>dcpomatic2_player.icns</string>
        <key>CFBundleIdentifier</key>
@@ -15,7 +15,7 @@
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
-       <string>DCP-o-matic 2 Player</string>
+       <string>@NAME@</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersions</key>
index d88a8ce507daaf0b8733c175c4cda7b775898562..28dba8f9b03cfcd24a64a62cf195328384807b37 100644 (file)
@@ -7,7 +7,7 @@
        <key>CFBundleExecutable</key>
        <string>dcpomatic2_verifier</string>
        <key>CFBundleGetInfoString</key>
-       <string>DCP-o-matic 2 Verifier</string>
+       <string>@NAME@</string>
        <key>CFBundleIconFile</key>
        <string>dcpomatic2_verifier.icns</string>
        <key>CFBundleIdentifier</key>
@@ -15,7 +15,7 @@
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
-       <string>DCP-o-matic 2 Verifier</string>
+       <string>@NAME@</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersions</key>
index a223556af3376ee7b957e81e9aad24dd56265bdb..633b830b72949b6762fce9f45d58c928ae899b5a 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-SYNTAX="make_dmg.sh -e <environment> -r <builddir> -i <apple-id> -p <apple-password> -a <arch1> [-a <arch2>] [-b <id>]"
+SYNTAX="make_dmg.sh -e <environment> -r <builddir> -i <apple-id> -p <apple-password> -a <arch1> [-a <arch2>] [-b <id>] [-v <variant>]"
 #
 # e.g. make_dmg.sh -e /Users/carl/osx-environment -r /Users/carl/cdist -i foo@bar.net -p opensesame -a x86_64/10.10 -a arm64/11.0 [-b dcpomatic2_player]
 
@@ -8,7 +8,7 @@ SYNTAX="make_dmg.sh -e <environment> -r <builddir> -i <apple-id> -p <apple-passw
 # were found.
 
 BUILD="main kdm server batch player playlist combiner editor disk verifier"
-while getopts "e:r:i:p:a:b:" o; do
+while getopts "e:r:i:p:a:b:v:" o; do
        case "${o}" in
                e)
                        ENV=${OPTARG}
@@ -28,9 +28,23 @@ while getopts "e:r:i:p:a:b:" o; do
                b)
                        BUILD=${OPTARG}
                        ;;
+               v)
+                       VARIANT=${OPTARG}
+                       ;;
        esac
 done
 
+VOLUME_PREFIX="DCP-o-matic-"
+GENERAL_NAME="DCP-o-matic"
+DCPOMATIC_APP="DCP-o-matic 2.app"
+KDM_CREATOR_NAME="DCP-o-matic KDM Creator"
+KDM_CREATOR_APP="DCP-o-matic 2 KDM Creator.app"
+PLAYER_APP="DCP-o-matic 2 Player.app"
+PLAYER_NAME="DCP-o-matic Player"
+VERIFIER_APP="DCP-o-matic 2 Verifier.app"
+VERIFIER_NAME="DCP-o-matic Verifier"
+SOURCE_NAME="dcpomatic"
+
 # Use a tag if what we've built is exactly on one
 version=$(git describe --tags --abbrev=0 --match=v2.*.* --exact-match 2> /dev/null)
 if [ "$?" == "0" ]; then
@@ -156,8 +170,8 @@ function copy_libs {
     copy_lib_root liblwext4 "$dest"
     copy_lib_root libblockdev "$dest"
     copy_lib_root libleqm_nrt "$dest"
-    copy $ROOT src/dcpomatic/build/src/lib/libdcpomatic2.dylib "$dest"
-    copy $ROOT src/dcpomatic/build/src/wx/libdcpomatic2-wx.dylib "$dest"
+    copy $ROOT src/$SOURCE_NAME/build/src/lib/libdcpomatic2.dylib "$dest"
+    copy $ROOT src/$SOURCE_NAME/build/src/wx/libdcpomatic2-wx.dylib "$dest"
     copy_lib_env libboost_atomic "$dest"
     copy_lib_env libboost_system "$dest"
     copy_lib_env libboost_filesystem "$dest"
@@ -216,46 +230,47 @@ function copy_resources {
        else
                local prefix=$ROOT/$ARCH1
        fi
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic_small_white.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic_small_black.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_kdm.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_server.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_player.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_batch.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_playlist.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_disk.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_combiner.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_editor.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_verifier.icns "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/defaults*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/kdm_email*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/email*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/servers*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/tms*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/keys*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/cover_sheet*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/notifications*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/sound*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/identifiers*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/general*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/advanced*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/locations*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/osx/preferences/non_standard*.png "$dest"
-    cp $prefix/src/dcpomatic/fonts/LiberationSans-Regular.ttf "$dest"
-    cp $prefix/src/dcpomatic/fonts/LiberationSans-Italic.ttf "$dest"
-    cp $prefix/src/dcpomatic/fonts/LiberationSans-Bold.ttf "$dest"
-    cp $prefix/src/dcpomatic/fonts/fonts.conf.osx "$dest"/fonts.conf
-    cp $prefix/src/dcpomatic/graphics/splash.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/zoom*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/zoom_all*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/select*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/snap*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/sequence*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/me.jpg "$dest"
-    cp $prefix/src/dcpomatic/graphics/link*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/add*.png "$dest"
-    cp $prefix/src/dcpomatic/graphics/pause*.png "$dest"
+       source=$prefix/src/$SOURCE_NAME
+    cp $source/graphics/osx/dcpomatic_small_white.png "$dest"
+    cp $source/graphics/osx/dcpomatic_small_black.png "$dest"
+    cp $source/graphics/osx/dcpomatic2.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_kdm.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_server.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_player.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_batch.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_playlist.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_disk.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_combiner.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_editor.icns "$dest"
+    cp $source/graphics/osx/dcpomatic2_verifier.icns "$dest"
+    cp $source/graphics/osx/preferences/defaults*.png "$dest"
+    cp $source/graphics/osx/preferences/kdm_email*.png "$dest"
+    cp $source/graphics/osx/preferences/email*.png "$dest"
+    cp $source/graphics/osx/preferences/servers*.png "$dest"
+    cp $source/graphics/osx/preferences/tms*.png "$dest"
+    cp $source/graphics/osx/preferences/keys*.png "$dest"
+    cp $source/graphics/osx/preferences/cover_sheet*.png "$dest"
+    cp $source/graphics/osx/preferences/notifications*.png "$dest"
+    cp $source/graphics/osx/preferences/sound*.png "$dest"
+    cp $source/graphics/osx/preferences/identifiers*.png "$dest"
+    cp $source/graphics/osx/preferences/general*.png "$dest"
+    cp $source/graphics/osx/preferences/advanced*.png "$dest"
+    cp $source/graphics/osx/preferences/locations*.png "$dest"
+    cp $source/graphics/osx/preferences/non_standard*.png "$dest"
+    cp $source/fonts/LiberationSans-Regular.ttf "$dest"
+    cp $source/fonts/LiberationSans-Italic.ttf "$dest"
+    cp $source/fonts/LiberationSans-Bold.ttf "$dest"
+    cp $source/fonts/fonts.conf.osx "$dest"/fonts.conf
+    cp $source/graphics/splash.png "$dest"
+    cp $source/graphics/zoom*.png "$dest"
+    cp $source/graphics/zoom_all*.png "$dest"
+    cp $source/graphics/select*.png "$dest"
+    cp $source/graphics/snap*.png "$dest"
+    cp $source/graphics/sequence*.png "$dest"
+    cp $source/graphics/me.jpg "$dest"
+    cp $source/graphics/link*.png "$dest"
+    cp $source/graphics/add*.png "$dest"
+    cp $source/graphics/pause*.png "$dest"
     cp -r $prefix/share/libdcp/xsd "$dest"
     cp -r $prefix/share/libdcp/tags "$dest"
     cp -r $prefix/share/libdcp/ratings "$dest"
@@ -263,9 +278,9 @@ function copy_resources {
     # i18n: DCP-o-matic .mo files
     for lang 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 ka_KA fa_IR; do
        mkdir -p "$dest/$lang/LC_MESSAGES"
-       cp $prefix/src/dcpomatic/build/src/lib/mo/$lang/*.mo "$dest/$lang/LC_MESSAGES"
-       cp $prefix/src/dcpomatic/build/src/wx/mo/$lang/*.mo "$dest/$lang/LC_MESSAGES"
-       cp $prefix/src/dcpomatic/build/src/tools/mo/$lang/*.mo "$dest/$lang/LC_MESSAGES"
+       cp $source/build/src/lib/mo/$lang/*.mo "$dest/$lang/LC_MESSAGES"
+       cp $source/build/src/wx/mo/$lang/*.mo "$dest/$lang/LC_MESSAGES"
+       cp $source/build/src/tools/mo/$lang/*.mo "$dest/$lang/LC_MESSAGES"
     done
 
     # i18n: wxWidgets .mo files
@@ -343,7 +358,7 @@ function make_dmg {
        else
                dmg="$full_name $version macOS10.10+.dmg"
        fi
-    vol_name=DCP-o-matic-$version
+    vol_name=$VOLUME_PREFIX$version
 
        find "$appdir/Contents/Frameworks" -iname "*.dylib" -type f -print0 | while IFS= read -r -d '' f; do
                sign "$f"
@@ -368,17 +383,17 @@ function make_dmg {
     fi
     ln -s /Applications "$vol_name/Applications"
     cat<<EOF > "$vol_name/READ ME.txt"
-Welcome to DCP-o-matic!  The first time you run the program there may be
+Welcome to $GENERAL_NAME  The first time you run the program there may be
 a long (several-minute) delay while macOS checks the code for viruses and
 other malware.  Please be patient!
 EOF
     cat<<EOF > "$vol_name/READ ME.de_DE.txt"
-Beim erstmaligen Start der DCP-o-matic Anwendungen kann ein längerer
+Beim erstmaligen Start der $GENERAL_NAME Anwendungen kann ein längerer
 Verifikationsvorgang auftreten.  Dies ist von der macOS Sicherheitsumgebung
 'Gatekeeper' verursacht.  Dieser je nach Rechner teils minutenlange
 Verifikationsvorgang ist gegenwärtig normal und nicht zu umgehen,
 es ist kein Programmfehler.  Warten sie die Verifikation für jede der
-DCP-o-matic Anwendungen ab, bei weiteren Programmstarts wird sie nicht
+$GENERAL_NAME Anwendungen ab, bei weiteren Programmstarts wird sie nicht
 mehr auftreten.
 EOF
 
@@ -485,44 +500,44 @@ fi
 
 if [[ "$BUILD" == *main* ]]; then
        # DCP-o-matic main
-       setup "DCP-o-matic 2.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2 "$approot/MacOS"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_cli "$approot/MacOS"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_create "$approot/MacOS"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_map "$approot/MacOS"
+       setup "$DCPOMATIC_APP"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2 "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_cli "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_create "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_map "$approot/MacOS"
        copy $ROOT bin/ffprobe "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2" "$approot/MacOS/dcpomatic2_cli" "$approot/MacOS/dcpomatic2_create" "$approot/MacOS/dcpomatic2_map" "$approot/MacOS/ffprobe" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
-       make_dmg "$appdir" "" "DCP-o-matic" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl ffprobe dcpomatic2_cli dcpomatic2_create dcpomatic2_map dcpomatic2"
+       make_dmg "$appdir" "" "$GENERAL_NAME" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl ffprobe dcpomatic2_cli dcpomatic2_create dcpomatic2_map dcpomatic2"
 fi
 
 if [[ "$BUILD" == *kdm* ]]; then
        # DCP-o-matic KDM Creator
-       setup "DCP-o-matic 2 KDM Creator.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_kdm "$approot/MacOS"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_kdm_cli "$approot/MacOS"
+       setup "$KDM_CREATOR_APP"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_kdm "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_kdm_cli "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_kdm.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_kdm.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_kdm" "$approot/MacOS/dcpomatic2_kdm_cli" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
-       make_dmg "$appdir" "" "DCP-o-matic KDM Creator" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_kdm_cli dcpomatic2_kdm"
+       make_dmg "$appdir" "" "$KDM_CREATOR_NAME" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_kdm_cli dcpomatic2_kdm"
 fi
 
 if [[ "$BUILD" == *server* ]]; then
        # DCP-o-matic Encode Server
        setup "DCP-o-matic 2 Encode Server.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server "$approot/MacOS"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server_cli "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_server "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_server_cli "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_server.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_server.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_server" "$approot/MacOS/dcpomatic2_server_cli" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
        make_dmg "$appdir" "" "DCP-o-matic Encode Server" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_server_cli dcpomatic2_server"
@@ -531,11 +546,11 @@ fi
 if [[ "$BUILD" == *batch* ]]; then
        # DCP-o-matic Batch Converter
        setup "DCP-o-matic 2 Batch converter.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_batch "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_batch "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_batch.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_batch.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_batch" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
        make_dmg "$appdir" "" "DCP-o-matic Batch Converter" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_batch"
@@ -543,25 +558,25 @@ fi
 
 if [[ "$BUILD" == *player* ]]; then
        # DCP-o-matic Player
-       setup "DCP-o-matic 2 Player.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_player "$approot/MacOS"
+       setup "$PLAYER_APP"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_player "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_player.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_player.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_player" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
-       make_dmg "$appdir" "" "DCP-o-matic Player" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_player"
+       make_dmg "$appdir" "" "$PLAYER_NAME" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_player"
 fi
 
 if [[ "$BUILD" == *playlist* ]]; then
        # DCP-o-matic Playlist Editor
        setup "DCP-o-matic 2 Playlist Editor.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_playlist "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_playlist "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_playlist.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_playlist.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_playlist" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
        make_dmg "$appdir" "" "DCP-o-matic Playlist Editor" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_playlist"
@@ -570,11 +585,11 @@ fi
 if [[ "$BUILD" == *combiner* ]]; then
        # DCP-o-matic Combiner
        setup "DCP-o-matic 2 Combiner.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_combiner "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_combiner "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_combiner.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_combiner.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_combiner" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
        make_dmg "$appdir" "" "DCP-o-matic Combiner" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_combiner"
@@ -583,11 +598,11 @@ fi
 if [[ "$BUILD" == *editor* ]]; then
        # DCP-o-matic Editor
        setup "DCP-o-matic 2 Editor.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_editor "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_editor "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_editor.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_editor.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_editor" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
        make_dmg "$appdir" "" "DCP-o-matic Editor" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_editor"
@@ -595,26 +610,26 @@ fi
 
 if [[ "$BUILD" == *verifier* ]]; then
        # DCP-o-matic Verifier
-       setup "DCP-o-matic 2 Verifier.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_verifier "$approot/MacOS"
+       setup "$VERIFIER_APP"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_verifier "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_verifier.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_verifier.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_verifier" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
-       make_dmg "$appdir" "" "DCP-o-matic Verifier" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_verifier"
+       make_dmg "$appdir" "" "$VERIFIER_NAME" "dcpomatic2_verify_cli dcpomatic2_kdm_inspect openssl dcpomatic2_verifier"
 fi
 
 if [[ "$BUILD" == *disk* ]]; then 
        # DCP-o-matic Disk Writer .app
        setup "DCP-o-matic 2 Disk Writer.app"
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_disk "$approot/MacOS"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_disk "$approot/MacOS"
        copy $ROOT src/openssl/apps/openssl "$approot/MacOS"
        copy_verify
        copy_kdm
-       cp $prefix/src/dcpomatic/platform/osx/uninstall_disk.applescript "$approot/Resources"
-       cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_disk.Info.plist "$approot/Info.plist"
+       cp $prefix/src/$SOURCE_NAME/platform/osx/uninstall_disk.applescript "$approot/Resources"
+       cp $prefix/src/$SOURCE_NAME/build/platform/osx/dcpomatic2_disk.Info.plist "$approot/Info.plist"
        rl=("$approot/MacOS/dcpomatic2_disk" "$approot/Frameworks/"*.dylib)
        relink_relative "${rl[@]}"
 
@@ -666,7 +681,7 @@ EOF
        # place with spaces in the filename to avoid some of the pain of escaping
 
        mkdir $pkgbin
-       copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_disk_writer "$pkgbin"
+       copy $ROOT src/$SOURCE_NAME/build/src/tools/dcpomatic2_disk_writer "$pkgbin"
        copy_libs "$pkgbin"
 
        rl=("$pkgbin/dcpomatic2_disk_writer" "$pkgbin/"*.dylib)
index 096109c6ecd61e90e6dd00f146ed1f8e90330bf9..39e8a581579796c5f9cb629723153f8840ca51e5 100644 (file)
@@ -1,11 +1,11 @@
 def build(bld):
-    bld(features='subst', source='dcpomatic2.Info.plist.in', target='dcpomatic2.Info.plist', version=bld.env.VERSION)
-    bld(features='subst', source='dcpomatic2_kdm.Info.plist.in', target='dcpomatic2_kdm.Info.plist', version=bld.env.VERSION)
+    bld(features='subst', source='dcpomatic2.Info.plist.in', target='dcpomatic2.Info.plist', version=bld.env.VERSION, NAME="DCP-o-matic 2")
+    bld(features='subst', source='dcpomatic2_kdm.Info.plist.in', target='dcpomatic2_kdm.Info.plist', version=bld.env.VERSION, NAME="DCP-o-matic 2 KDM Creator")
     bld(features='subst', source='dcpomatic2_server.Info.plist.in', target='dcpomatic2_server.Info.plist', version=bld.env.VERSION)
     bld(features='subst', source='dcpomatic2_batch.Info.plist.in', target='dcpomatic2_batch.Info.plist', version=bld.env.VERSION)
-    bld(features='subst', source='dcpomatic2_player.Info.plist.in', target='dcpomatic2_player.Info.plist', version=bld.env.VERSION)
+    bld(features='subst', source='dcpomatic2_player.Info.plist.in', target='dcpomatic2_player.Info.plist', version=bld.env.VERSION, NAME="DCP-o-matic 2 Player")
     bld(features='subst', source='dcpomatic2_playlist.Info.plist.in', target='dcpomatic2_playlist.Info.plist', version=bld.env.VERSION)
     bld(features='subst', source='dcpomatic2_disk.Info.plist.in', target='dcpomatic2_disk.Info.plist', version=bld.env.VERSION)
     bld(features='subst', source='dcpomatic2_combiner.Info.plist.in', target='dcpomatic2_combiner.Info.plist', version=bld.env.VERSION)
     bld(features='subst', source='dcpomatic2_editor.Info.plist.in', target='dcpomatic2_editor.Info.plist', version=bld.env.VERSION)
-    bld(features='subst', source='dcpomatic2_verifier.Info.plist.in', target='dcpomatic2_verifier.Info.plist', version=bld.env.VERSION)
+    bld(features='subst', source='dcpomatic2_verifier.Info.plist.in', target='dcpomatic2_verifier.Info.plist', version=bld.env.VERSION, NAME="DCP-o-matic 2 Verifier")
index c6718db41e0391044a09517e360e566634ee1de8..e0da35ed159f0181c9370d821417b1ff6d1f8a6f 100644 (file)
@@ -2,27 +2,58 @@ from __future__ import print_function
 import os
 
 
-def start_menu_shortcut(file, link, target, debug=False):
+def start_menu_shortcut_folder(variant):
+    return 'DCP-o-matic 2'
+
+def long_name(variant):
+    return 'DCP-o-matic 2'
+
+def short_name(variant):
+    return 'DCP-o-matic'
+
+def kdm_creator_name(variant):
+    return 'KDM Creator'
+
+def player_name(variant):
+    return 'Player'
+
+def verifier_name(variant):
+    return 'Verifier'
+
+def tool_name(variant, debug, tool):
+    name = f'DCP-o-matic 2 {tool}'
     if debug:
-        print(f'CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\{link}.lnk" "$INSTDIR\\{target}"', file=file)
-    else:
-        print(f'CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\{link}.lnk" "$INSTDIR\\{target}"', file=file)
+        name += ' debug'
+    return name
 
 
-def write_installer(bits, dcpomatic_version, debug, disk):
+
+def start_menu_shortcut(file, link, target, variant, debug=False):
+    folder = start_menu_shortcut_folder(variant)
+    if debug:
+        folder += ' debug'
+    print(f'CreateShortCut "$SMPROGRAMS\\{folder}\\{link}.lnk" "$INSTDIR\\{target}"', file=file)
+
+
+def write_installer(bits, dcpomatic_version, debug, disk, variant):
+    long_name_with_debug = long_name(variant)
+    short_name_with_debug = short_name(variant)
+    if debug:
+        long_name_with_debug += ' debug'
+        short_name_with_debug += ' debug'
 
     tools = [
+        ('kdm', kdm_creator_name(variant)),
+        ('player', player_name(variant)),
+        ('verifier', verifier_name(variant)),
         ('batch', 'Batch Converter'),
-        ('kdm', 'KDM Creator'),
         ('kdm_cli', 'KDM Creator CLI'),
-        ('player', 'Player'),
         ('cli', 'CLI'),
         ('create', 'Creator'),
         ('playlist', 'Playlist Editor'),
         ('combiner', 'Combiner'),
         ('editor', 'Editor'),
         ('map', 'Map'),
-        ('verifier', 'Verifier'),
     ]
 
     if disk:
@@ -41,19 +72,11 @@ def write_installer(bits, dcpomatic_version, debug, disk):
     if bits == 64:
         print('!include "x64.nsh"', file=f)
 
-    if debug:
-        print('Name "DCP-o-matic debug"', file=f)
-    else:
-        print('Name "DCP-o-matic"', file=f)
-
+    print(f'Name "{short_name_with_debug}"', file=f)
     print('RequestExecutionLevel admin', file=f)
     print('Unicode true', file=f)
 
-    outfile = 'DCP-o-matic '
-    if debug:
-        outfile += 'Debug '
-    outfile += '%s %d-bit Installer.exe' % (dcpomatic_version, bits)
-
+    outfile = f'{short_name_with_debug} {dcpomatic_version} {bits}-bit Installer.exe'
     print('outFile "%s"' % outfile, file=f)
 
     print("""
@@ -68,10 +91,7 @@ def write_installer(bits, dcpomatic_version, debug, disk):
     else:
         program_files = "$PROGRAMFILES"
 
-    if debug:
-        print('InstallDir "%s\\DCP-o-matic 2 debug"' % program_files, file=f)
-    else:
-        print('InstallDir "%s\\DCP-o-matic 2"' % program_files, file=f)
+    print(f'InstallDir "%s\\{long_name_with_debug}"' % program_files, file=f)
 
     print("""
 !insertmacro MUI_PAGE_WELCOME
@@ -384,18 +404,12 @@ File "%cdist_deps%/share/libdcp/ratings"
 SectionEnd
     """, file=f)
 
-    if debug:
-        print('Section "DCP-o-matic 2 debug" SEC_MASTER', file=f)
-    else:
-        print('Section "DCP-o-matic 2" SEC_MASTER', file=f)
+    print(f'Section "{long_name_with_debug}" SEC_MASTER', file=f)
 
     print('SetOutPath "$INSTDIR\\bin"', file=f)
     print("SetShellVarContext all", file=f)
 
-    if debug:
-        print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2 debug"', file=f)
-    else:
-        print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"', file=f)
+    print(f'CreateDirectory "$SMPROGRAMS\\{long_name_with_debug}"', file=f)
 
     print('File "%binaries%/src/tools/dcpomatic2.exe"', file=f)
     for s, l in tools:
@@ -407,33 +421,20 @@ File "%binaries%/src/tools/dcpomatic2_disk_writer.exe"
 File "%resources%/dcpomatic2_disk_writer.exe.manifest"
     """, file=f)
 
-    if debug:
-        start_menu_shortcut(f, 'DCP-o-matic 2 debug', 'bin\\dcpomatic2_debug.bat', debug=True)
-        for s, l in tools:
-            start_menu_shortcut(f, f'DCP-o-matic 2 {l} debug', f'bin\\dcpomatic2_{s}_debug.bat', debug=True)
-        start_menu_shortcut(f, 'Uninstall DCP-o-matic 2 debug', 'Uninstall.exe', debug=True)
-        print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "DisplayName" "DCP-o-matic 2 debug (remove only)"', file=f)
-        print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
-    else:
-        start_menu_shortcut(f, 'DCP-o-matic 2', 'bin\\dcpomatic2.exe')
-        for s, l in tools:
-            start_menu_shortcut(f, f'DCP-o-matic 2 {l}', f'bin\\dcpomatic2_{s}.exe')
-        start_menu_shortcut(f, 'Uninstall DCP-o-matic 2', 'Uninstall.exe')
-        print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "DisplayName" "DCP-o-matic 2 (remove only)"', file=f)
-        print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
+    suffix = '_debug.bat' if debug else '.exe'
+    start_menu_shortcut(f, long_name_with_debug, f'bin\\dcpomatic2{suffix}', variant, debug=True)
+    for s, l in tools:
+        start_menu_shortcut(f, tool_name(variant, debug, l), f'bin\\dcpomatic2_{s}{suffix}', variant, debug=True)
+    start_menu_shortcut(f, f'Uninstall {long_name_with_debug}', 'Uninstall.exe', variant, debug=True)
+    print(f'WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{long_name_with_debug}" "DisplayName" "{long_name_with_debug} (remove only)"', file=f)
+    print(f'WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{long_name_with_debug}" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
 
     print("SectionEnd", file=f)
 
-    if debug:
-        print('Section "DCP-o-matic 2 debug desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
-        print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 debug.lnk" "$INSTDIR\\bin\\dcpomatic2_debug.bat" ""', file=f)
-        for s, l in tools:
-            print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 %s debug.lnk" "$INSTDIR\\bin\\dcpomatic2_%s_debug.bat" ""' % (l, s), file=f)
-    else:
-        print('Section "DCP-o-matic 2 desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
-        print('CreateShortCut "$DESKTOP\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe" ""', file=f)
-        for s, l in tools:
-            print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 %s.lnk" "$INSTDIR\\bin\\dcpomatic2_%s.exe"' % (l, s), file=f)
+    print(f'Section "{long_name_with_debug} desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
+    print(f'CreateShortCut "$DESKTOP\\{long_name_with_debug}.lnk" "$INSTDIR\\bin\\dcpomatic2{suffix}" ""', file=f)
+    for s, l in tools:
+        print(f'CreateShortCut "$DESKTOP\\{tool_name(variant, debug, l)}.lnk" "$INSTDIR\\bin\\dcpomatic2_{s}{suffix}" ""', file=f)
 
     print("SectionEnd", file=f)
 
@@ -445,8 +446,8 @@ File "%binaries%/src/tools/dcpomatic2_server_cli.exe"
 File "%binaries%/src/tools/dcpomatic2_server.exe"
     """, file=f)
 
-    start_menu_shortcut(f, 'DCP-o-matic 2 Encode Server', 'bin\\dcpomatic2_server.exe')
-    start_menu_shortcut(f, 'Uninstall DCP-o-matic 2', 'Uninstall.exe')
+    start_menu_shortcut(f, 'DCP-o-matic 2 Encode Server', 'bin\\dcpomatic2_server.exe', variant)
+    start_menu_shortcut(f, 'Uninstall DCP-o-matic 2', 'Uninstall.exe', variant)
 
     print("""
 SectionEnd
@@ -517,5 +518,5 @@ DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\U
 
 
 def build(bld):
-    write_installer(32, bld.env.VERSION, bld.env.DEBUG, bld.env.ENABLE_DISK)
-    write_installer(64, bld.env.VERSION, bld.env.DEBUG, bld.env.ENABLE_DISK)
+    write_installer(32, bld.env.VERSION, bld.env.DEBUG, bld.env.ENABLE_DISK, bld.env.VARIANT)
+    write_installer(64, bld.env.VERSION, bld.env.DEBUG, bld.env.ENABLE_DISK, bld.env.VARIANT)
diff --git a/wscript b/wscript
index 19fd4260c2c6c9a6a7598d8ff2c54e64500c82e6..3c2e0bb00db5e6bda1d001e560636cc1c83dc024 100644 (file)
--- a/wscript
+++ b/wscript
@@ -81,6 +81,7 @@ def options(opt):
     opt.add_option('--enable-asan',       action='store_true', help='build with asan')
     opt.add_option('--disable-more-warnings', action='store_true', default=False, help='disable some warnings raised by Xcode 15 with the 2.16 branch')
     opt.add_option('--c++17', action='store_true', default=False, help='build with C++17 and libxml++-4.0')
+    opt.add_option('--variant', help="build with variant")
 
 def configure(conf):
     conf.load('compiler_cxx')
@@ -115,6 +116,7 @@ def configure(conf):
         conf.env.INSTALL_PREFIX = conf.options.prefix
     else:
         conf.env.INSTALL_PREFIX = conf.options.destdir
+    conf.env.VARIANT = conf.options.variant if conf.options.variant else "dcpomatic"
 
     conf.check_cxx(cxxflags=['-msse', '-mfpmath=sse'], msg='Checking for SSE support', mandatory=False, define_name='SSE')