X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=platform%2Fosx%2Fmake_dmg.sh;h=3775508915399f525786faa2c6a63fcd5230f345;hp=aefa94e2cdbbe50dc2c3f01e45979ca796f971dd;hb=3a1ddb9e182be28a22c5bbc85c06ee6629b72fe6;hpb=b7aa70911ed89511c2dc8b430e3c348a43b9c020 diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index aefa94e2c..377550891 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -1,22 +1,50 @@ #!/bin/bash # -SYNTAX="make_dmg.sh []" +SYNTAX="make_dmg.sh -e -r -i -p -a [-a ] [-b ]" # -# e.g. make_dmg.sh /Users/carl/osx-environment /Users/carl/cdist foo@bar.net opensesame x86_64/10.10 arm64/11.0 +# 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] # Don't set -e here as egrep (used a few times) returns 1 if no matches # were found. -version=`git describe --tags --abbrev=0 | sed -e "s/v//"` +BUILD="main kdm server batch player playlist combiner editor disk" +while getopts "e:r:i:p:a:b:" o; do + case "${o}" in + e) + ENV=${OPTARG} + ;; + r) + ROOT=${OPTARG} + ;; + i) + APPLE_ID=${OPTARG} + ;; + p) + APPLE_PASSWORD=${OPTARG} + ;; + a) + ARCHS+=("$OPTARG") + ;; + b) + BUILD=${OPTARG} + ;; + esac +done + +# 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 + version=$(echo $version | sed -e "s/^v//") +else + # Otherwise use - + version="$(basename $(git name-rev --name-only HEAD))-$(git rev-parse --short HEAD)" +fi # DMG size in megabytes DMG_SIZE=256 -ENV=$1 -ROOT=$2 -APPLE_ID=$3 -APPLE_PASSWORD=$4 -ARCH1=$5 -ARCH2=$6 + +ARCH1=${ARCHS[0]} +ARCH2=${ARCHS[1]} APPLICATION_IDENTITY="Developer ID Application: Carl Hetherington (R82DXSR997)" INSTALLER_IDENTITY="Developer ID Installer: Carl Hetherington (R82DXSR997)" @@ -84,19 +112,25 @@ function copy_lib_root { } function copy_lib_env { - for f in $ENV/$ARCH2/lib/$1*.dylib; do - if [ -h $f ]; then - ln -s $(readlink $f) "$2/`basename $f`" - else - if [ "$ARCH2" == "" ]; then + if [ "$ARCH2" == "" ]; then + for f in $ENV/$ARCH1/lib/$1*.dylib; do + if [ -h $f ]; then + ln -s $(readlink $f) "$2/`basename $f`" + else cp $f "$2/`basename $f`" + fi + done + else + for f in $ENV/$ARCH2/lib/$1*.dylib; do + if [ -h $f ]; then + ln -s $(readlink $f) "$2/`basename $f`" else g=`echo $f | sed -e "s@/$ARCH2/@/$ARCH1/@g"` mkdir -p "$2" lipo -create $f $g -output "$2/$(basename $f)" fi - fi - done + done + fi to_relink="$to_relink|$1" } @@ -168,6 +202,7 @@ function copy_libs { copy_lib_env libfribidi "$dest" copy_lib_env libgio "$dest" copy_lib_env libz "$dest" + copy_lib_env libdav1d "$dest" } # @param #1 directory to copy to @@ -188,51 +223,43 @@ function copy_resources { 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/preferences/defaults.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/defaults@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/kdm_email.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/kdm_email@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/email.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/email@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/servers.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/servers@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/tms.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/tms@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/keys.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/keys@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/cover_sheet.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/cover_sheet@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/notifications.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/notifications@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/sound.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/sound@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/identifiers.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/identifiers@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/general.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/general@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/advanced.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/advanced@2x.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/locations.png "$dest" - cp $prefix/src/dcpomatic/graphics/osx/preferences/locations@2x.png "$dest" + cp $prefix/src/dcpomatic/graphics/osx/dcpomatic2_editor.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/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/tick.png "$dest" cp $prefix/src/dcpomatic/graphics/no_tick.png "$dest" + cp $prefix/src/dcpomatic/graphics/add*.png "$dest" + cp $prefix/src/dcpomatic/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" # 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; do + 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; 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" @@ -240,7 +267,7 @@ function copy_resources { done # i18n: wxWidgets .mo files - for lang in de es fr it sv nl ru pl da cs; do + for lang in de es fr it sv nl ru pl da cs sl; do mkdir "$dest/$lang" cp $ENV/$ARCH1/share/locale/$lang/LC_MESSAGES/wxstd.mo "$dest/$lang" done @@ -256,7 +283,7 @@ function relink_relative { for arch in $arch1_name $arch2_name; do for obj in "${linkers[@]}"; do - deps=`otool -arch $arch -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|boost|libicu|libssh)"` + deps=`otool -arch $arch -L "$obj" | awk '{print $1}' | egrep "($to_relink)" | egrep "($ENV|$ROOT|@rpath|boost|libicu|libssh)"` changes="" for dep in $deps; do base=`basename $dep` @@ -308,8 +335,12 @@ function make_dmg { local pkg="$2" local full_name="$3" local exes="$4" - tmp_dmg=dcpomatic_tmp.dmg - dmg="$full_name $version.dmg" + tmp_dmg=dcpomatic_tmp.dmg + if [ "$ARCH2" == "" ]; then + dmg="$full_name $version macOS10.8+.dmg" + else + dmg="$full_name $version macOS10.10+.dmg" + fi vol_name=DCP-o-matic-$version find "$appdir/Contents/Frameworks" -iname "*.dylib" -type f -print0 | while IFS= read -r -d '' f; do @@ -437,107 +468,151 @@ function copy_verify { relink_relative "${rl[@]}" } +function copy_kdm { + copy $ROOT src/libdcp/build/tools/dcpkdm "$approot/MacOS" + mv "$approot/MacOS/dcpkdm" "$approot/MacOS/dcpomatic2_kdm_inspect" + rl=("$approot/MacOS/dcpomatic2_kdm_inspect" "$approot/Frameworks/"*.dylib) + relink_relative "${rl[@]}" +} + if [ "$ARCH2" == "" ]; then prefix=$ROOT else prefix=$ROOT/$ARCH2 fi -# 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 bin/ffprobe "$approot/MacOS" -copy $ROOT src/openssl/apps/openssl "$approot/MacOS" -copy_verify -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_relative "${rl[@]}" -make_dmg "$appdir" "" "DCP-o-matic" "dcpomatic2_verify openssl ffprobe dcpomatic2_cli dcpomatic2_create dcpomatic2" - -# 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" -copy $ROOT src/openssl/apps/openssl "$approot/MacOS" -copy_verify -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_relative "${rl[@]}" -make_dmg "$appdir" "" "DCP-o-matic KDM Creator" "dcpomatic2_verify openssl dcpomatic2_kdm_cli dcpomatic2_kdm" - -# 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/openssl/apps/openssl "$approot/MacOS" -copy_verify -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_relative "${rl[@]}" -make_dmg "$appdir" "" "DCP-o-matic Encode Server" "dcpomatic2_verify openssl dcpomatic2_server_cli dcpomatic2_server" - -# 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/openssl/apps/openssl "$approot/MacOS" -copy_verify -cp $prefix/src/dcpomatic/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 openssl dcpomatic2_batch" - -# DCP-o-matic Player -setup "DCP-o-matic 2 Player.app" -copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_player "$approot/MacOS" -copy $ROOT src/openssl/apps/openssl "$approot/MacOS" -copy_verify -cp $prefix/src/dcpomatic/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 openssl dcpomatic2_player" - -# 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/openssl/apps/openssl "$approot/MacOS" -copy_verify -cp $prefix/src/dcpomatic/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 openssl dcpomatic2_playlist" - -# 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/openssl/apps/openssl "$approot/MacOS" -copy_verify -cp $prefix/src/dcpomatic/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 openssl dcpomatic2_combiner" - -# 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/openssl/apps/openssl "$approot/MacOS" -copy_verify -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" -rl=("$approot/MacOS/dcpomatic2_disk" "$approot/Frameworks/"*.dylib) -relink_relative "${rl[@]}" - -# DCP-o-matic Disk Writer daemon .pkg - -pkgbase=tmp-disk-writer -rm -rf $pkgbase -mkdir $pkgbase -pkgbin=$pkgbase/bin -pkgroot=$pkgbase/root - -mkdir -p $pkgroot/Library/LaunchDaemons -cat > $pkgroot/Library/LaunchDaemons/com.dcpomatic.disk.writer.plist < $pkgroot/Library/LaunchDaemons/com.dcpomatic.disk.writer.plist < @@ -572,33 +647,34 @@ cat > $pkgroot/Library/LaunchDaemons/com.dcpomatic.disk.writer.plist < EOF -# Get the binaries together in $pkgbin then move them to the -# place with spaces in the filename to avoid some of the pain of escaping + # Get the binaries together in $pkgbin then move them to the + # 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_libs "$pkgbin" + mkdir $pkgbin + copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_disk_writer "$pkgbin" + copy_libs "$pkgbin" -rl=("$pkgbin/dcpomatic2_disk_writer" "$pkgbin/"*.dylib) -relink_absolute "/Library/Application Support/com.dcpomatic" "${rl[@]}" + rl=("$pkgbin/dcpomatic2_disk_writer" "$pkgbin/"*.dylib) + relink_absolute "/Library/Application Support/com.dcpomatic" "${rl[@]}" -mkdir $pkgbase/scripts -cat > $pkgbase/scripts/postinstall < $pkgbase/scripts/postinstall <