diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-05 21:41:11 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-05 21:41:11 +0200 |
| commit | 78c305ddcbea2a467d115773c133a6ed0a33ee1b (patch) | |
| tree | acb9fbcda7af521081e63a35f227882aee3df2ef | |
| parent | eb7142c109081fb7e04ca4d9203307365e6c1086 (diff) | |
Untested build of disk writer .pkg.
| -rw-r--r-- | platform/osx/make_dmg.sh | 94 |
1 files changed, 82 insertions, 12 deletions
diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 1dfd813b4..95606e2e2 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -254,12 +254,14 @@ function relink { } # @param #1 .app directory -# @param #2 full name e.g. DCP-o-matic Batch Converter -# @param #3 bundle id e.g. com.dcpomatic.batch +# @param #2 .pkg or "" +# @param #3 full name e.g. DCP-o-matic Batch Converter +# @param #4 bundle id e.g. com.dcpomatic.batch function make_dmg { local appdir="$1" - local full_name="$2" - local bundle_id="$3" + local pkg="$2" + local full_name="$3" + local bundle_id="$4" tmp_dmg=dcpomatic_tmp.dmg dmg="$full_name $version.dmg" vol_name=DCP-o-matic-$version @@ -272,6 +274,9 @@ function make_dmg { mkdir -p $vol_name cp -a "$appdir" $vol_name + if [ "$pkg" != ""]; then + cp -a "$pkg" $vol_name + 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 @@ -399,7 +404,7 @@ copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2.Info.plist "$approot/Info.plist" rl=("$approot/MacOS/dcpomatic2" "$approot/MacOS/dcpomatic2_cli" "$approot/MacOS/dcpomatic2_create" "$approot/MacOS/ffprobe" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic" com.dcpomatic +make_dmg "$appdir" "" "DCP-o-matic" com.dcpomatic # DCP-o-matic KDM Creator setup "DCP-o-matic 2 KDM Creator.app" @@ -409,7 +414,7 @@ copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_kdm.Info.plist "$approot/Info.plist" rl=("$approot/MacOS/dcpomatic2_kdm" "$approot/MacOS/dcpomatic2_kdm_cli" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic KDM Creator" com.dcpomatic.kdm +make_dmg "$appdir" "" "DCP-o-matic KDM Creator" com.dcpomatic.kdm # DCP-o-matic Encode Server setup "DCP-o-matic 2 Encode Server.app" @@ -419,7 +424,7 @@ copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_server.Info.plist "$approot/Info.plist" rl=("$approot/MacOS/dcpomatic2_server" "$approot/MacOS/dcpomatic2_server_cli" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic Encode Server" com.dcpomatic.server +make_dmg "$appdir" "" "DCP-o-matic Encode Server" com.dcpomatic.server # DCP-o-matic Batch Converter setup "DCP-o-matic 2 Batch converter.app" @@ -428,7 +433,7 @@ copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_batch.Info.plist "$approot/Info.plist" rl=("$approot/MacOS/dcpomatic2_batch" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic Batch Converter" com.dcpomatic.batch +make_dmg "$appdir" "" "DCP-o-matic Batch Converter" com.dcpomatic.batch # DCP-o-matic Player setup "DCP-o-matic 2 Player.app" @@ -437,7 +442,7 @@ copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_player.Info.plist "$approot/Info.plist" rl=("$approot/MacOS/dcpomatic2_player" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic Player" com.dcpomatic.player +make_dmg "$appdir" "" "DCP-o-matic Player" com.dcpomatic.player # DCP-o-matic Playlist Editor setup "DCP-o-matic 2 Playlist Editor.app" @@ -446,12 +451,11 @@ copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_playlist.Info.plist "$approot/Info.plist" rl=("$approot/MacOS/dcpomatic2_playlist" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic Playlist Editor" com.dcpomatic.playlist +make_dmg "$appdir" "" "DCP-o-matic Playlist Editor" com.dcpomatic.playlist # DCP-o-matic Disk Writer setup "DCP-o-matic 2 Disk Writer.app" copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_disk "$approot/MacOS" -copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_disk_writer "$approot/MacOS" # XXX: this shouldn't really be necessary copy $ROOT src/openssl/apps/openssl "$approot/MacOS" cp $prefix/src/dcpomatic/build/platform/osx/dcpomatic2_disk.Info.plist "$approot/Info.plist" @@ -459,4 +463,70 @@ rl=("$approot/MacOS/dcpomatic2_disk" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" rl=("$approot/MacOS/dcpomatic2_disk_writer" "$approot/Frameworks/"*.dylib) relink "${rl[@]}" -make_dmg "$appdir" "DCP-o-matic Disk Writer" com.dcpomatic.disk + +# DCP-o-matic Disk Writer daemon .pkg +pkgbase=tmp-disk-writer +rm -rf $pkgbase +mkdir $pkgbase +pkgroot=$pkgbase/root +mkdir -p $pkgroot/Library/LaunchDaemons +cat > $pkgroot/Library/LaunchDaemons/com.dcpomatic.disk.writer.plist <<EOF +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>com.dcpomatic.disk.writer</string> + <key>ProgramArguments</key> + <array> + <string>/Library/Application Support/com.dcpomatic/dcpomatic2_disk_writer</string> + </array> + <key>EnvironmentVariables</key> + <dict> + <key>DYLD_LIBRARY_PATH</key> + <string><![CDATA[/Library/Application Support/com.dcpomatic]]></string> + </dict> + <key>KeepAlive</key> + <true/> + <key>RunAtLoad</key> + <true/> + <key>Debug</key> + <true/> + <key>StandardOutPath</key> + <string>/Users/carl/damon.out.log</string> + <key>StandardErrorPath</key> + <string>/Users/carl/damon.err.log</string> +</dict> +</plist> +EOF + +mkdir -p "$pkgroot/Library/Application Support/com.dcpomatic" +target="$pkgroot/Library/Application Support/com.dcpomatic" +copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_disk_writer "$target" +copy_lib_root libcxml "$target" +copy_lib_env libboost_system "$dest" +copy_lib_env libboost_filesystem "$dest" +copy_lib_env libboost_thread "$dest" +copy_lib_env libboost_date_time "$dest" +copy_lib_env libboost_locale "$dest" +copy_lib_env libboost_regex "$dest" +copy_lib_env libicui18n "$dest" +copy_lib_env libicudata "$dest" +copy_lib_env libicuio "$dest" +copy_lib_env libicule "$dest" +copy_lib_env libiculx "$dest" +copy_lib_env libicutest "$dest" +copy_lib_env libicutu "$dest" +copy_lib_env libicuuc "$dest" + +mkdir $pkgbase/scripts +cat > $pkgbase/scripts/postinstall <<EOF +#!/bin/sh +/bin/launchctl load "/Library/LaunchDaemons/com.dcpomatic.disk.writer.plist" +exit 0 +EOF +chmod gou+x scripts/postinstall + +pkgbuild --root $pkgroot --identifier com.dcpomatic.disk.writer --scripts $pkgbase/scripts "DCP-o-matic Disk Writer.pkg" + +make_dmg "$appdir" "DCP-o-matic Disk Writer.pkg" "DCP-o-matic Disk Writer" com.dcpomatic.disk |
