diff --git a/utils/package-osx-bundles.sh b/utils/package-osx-bundles.sh index 087f9c56..9aa86065 100755 --- a/utils/package-osx-bundles.sh +++ b/utils/package-osx-bundles.sh @@ -11,9 +11,6 @@ set -e DPF_UTILS_DIR="$(dirname $(realpath ${0}))" -# can be overridden by environment variables -WELCOME_TXT=${WELCOME_TXT:=${DPF_UTILS_DIR}/plugin.pkg/welcome.txt.in} - if [ -d bin ]; then cd bin elif [ -d build/bin ]; then @@ -23,8 +20,16 @@ else exit fi -NAME="$(basename $(git rev-parse --show-toplevel))" -SNAME="$(echo ${NAME} | tr -d ' ' | tr '/' '-')" +# can be overridden by environment variables +MACOS_PKG_NAME=${MACOS_PKG_NAME:="$(basename $(git rev-parse --show-toplevel))"} +MACOS_PKG_SNAME=${MACOS_PKG_SNAME:="$(echo ${MACOS_PKG_NAME} | tr -d ' ' | tr '/' '-')"} +MACOS_PKG_SYMBOL=${MACOS_PKG_SYMBOL:="studio.kx.distrho.plugins.${MACOS_PKG_SNAME}"} +MACOS_PKG_WELCOME_TXT=${MACOS_PKG_WELCOME_TXT:=${DPF_UTILS_DIR}/plugin.pkg/welcome.txt.in} + +# backwards compat +if [ -n "${WELCOME_TXT}" ]; then + MACOS_PKG_WELCOME_TXT="${WELCOME_TXT}" +fi SKIP_START="" @@ -42,11 +47,11 @@ if [ -n "${ENABLE_AU}" ]; then cp -RL *.component pkg/au/ [ -n "${MACOS_APP_DEV_ID}" ] && codesign -s "${MACOS_APP_DEV_ID}" --deep --force --verbose --option=runtime pkg/au/*.component pkgbuild \ - --identifier "studio.kx.distrho.plugins.${SNAME}.components" \ + --identifier "${MACOS_PKG_SYMBOL}-components" \ --install-location "/Library/Audio/Plug-Ins/Components/" \ --root "${PWD}/pkg/au/" \ "${PKG_SIGN_ARGS[@]}" \ - ../dpf-${SNAME}-components.pkg + ../dpf-${MACOS_PKG_SNAME}-components.pkg else SKIP_AU_START="${SKIP_START}" SKIP_AU_END="${SKIP_END}" @@ -58,11 +63,11 @@ if [ -n "${ENABLE_CLAP}" ]; then cp -RL *.clap pkg/clap/ [ -n "${MACOS_APP_DEV_ID}" ] && codesign -s "${MACOS_APP_DEV_ID}" --deep --force --verbose --option=runtime pkg/clap/*.clap pkgbuild \ - --identifier "studio.kx.distrho.plugins.${SNAME}.clapbundles" \ + --identifier "${MACOS_PKG_SYMBOL}-clapbundles" \ --install-location "/Library/Audio/Plug-Ins/CLAP/" \ --root "${PWD}/pkg/clap/" \ "${PKG_SIGN_ARGS[@]}" \ - ../dpf-${SNAME}-clapbundles.pkg + ../dpf-${MACOS_PKG_SNAME}-clapbundles.pkg else SKIP_CLAP_START="${SKIP_START}" SKIP_CLAP_END="${SKIP_END}" @@ -74,11 +79,11 @@ if [ -n "${ENABLE_LV2}" ]; then cp -RL *.lv2 pkg/lv2/ [ -n "${MACOS_APP_DEV_ID}" ] && codesign -s "${MACOS_APP_DEV_ID}" --force --verbose --option=runtime pkg/lv2/*.lv2/*.dylib pkgbuild \ - --identifier "studio.kx.distrho.plugins.${SNAME}.lv2bundles" \ + --identifier "${MACOS_PKG_SYMBOL}-lv2bundles" \ --install-location "/Library/Audio/Plug-Ins/LV2/" \ --root "${PWD}/pkg/lv2/" \ "${PKG_SIGN_ARGS[@]}" \ - ../dpf-${SNAME}-lv2bundles.pkg + ../dpf-${MACOS_PKG_SNAME}-lv2bundles.pkg else SKIP_LV2_START="${SKIP_START}" SKIP_LV2_END="${SKIP_END}" @@ -90,11 +95,11 @@ if [ -n "${ENABLE_VST2}" ]; then cp -RL *.vst pkg/vst2/ [ -n "${MACOS_APP_DEV_ID}" ] && codesign -s "${MACOS_APP_DEV_ID}" --deep --force --verbose --option=runtime pkg/vst2/*.vst pkgbuild \ - --identifier "studio.kx.distrho.plugins.${SNAME}.vst2bundles" \ + --identifier "${MACOS_PKG_SYMBOL}-vst2bundles" \ --install-location "/Library/Audio/Plug-Ins/VST/" \ --root "${PWD}/pkg/vst2/" \ "${PKG_SIGN_ARGS[@]}" \ - ../dpf-${SNAME}-vst2bundles.pkg + ../dpf-${MACOS_PKG_SNAME}-vst2bundles.pkg else SKIP_VST2_START="${SKIP_START}" SKIP_VST2_END="${SKIP_END}" @@ -106,11 +111,11 @@ if [ -n "${ENABLE_VST3}" ]; then cp -RL *.vst3 pkg/vst3/ [ -n "${MACOS_APP_DEV_ID}" ] && codesign -s "${MACOS_APP_DEV_ID}" --deep --force --verbose --option=runtime pkg/vst3/*.vst3 pkgbuild \ - --identifier "studio.kx.distrho.plugins.${SNAME}.vst3bundles" \ + --identifier "${MACOS_PKG_SYMBOL}-vst3bundles" \ --install-location "/Library/Audio/Plug-Ins/VST3/" \ --root "${PWD}/pkg/vst3/" \ "${PKG_SIGN_ARGS[@]}" \ - ../dpf-${SNAME}-vst3bundles.pkg + ../dpf-${MACOS_PKG_SNAME}-vst3bundles.pkg else SKIP_VST3_START="${SKIP_START}" SKIP_VST3_END="${SKIP_END}" @@ -119,7 +124,7 @@ fi cd .. mkdir -p build -sed -e "s|@name@|${NAME}|" "${WELCOME_TXT}" > build/welcome.txt +sed -e "s|@name@|${MACOS_PKG_NAME}|" "${MACOS_PKG_WELCOME_TXT}" > build/welcome.txt sed -e "s|@builddir@|${PWD}/build|" \ -e "s|@skip_au_start@|${SKIP_AU_START}|" \ -e "s|@skip_clap_start@|${SKIP_CLAP_START}|" \ @@ -131,22 +136,18 @@ sed -e "s|@builddir@|${PWD}/build|" \ -e "s|@skip_lv2_end@|${SKIP_LV2_END}|" \ -e "s|@skip_vst2_end@|${SKIP_VST2_END}|" \ -e "s|@skip_vst3_end@|${SKIP_VST3_END}|" \ - -e "s|@aubundleref@|dpf-${SNAME}-components.pkg|" \ - -e "s|@clapbundleref@|dpf-${SNAME}-clapbundles.pkg|" \ - -e "s|@lv2bundleref@|dpf-${SNAME}-lv2bundles.pkg|" \ - -e "s|@vst2bundleref@|dpf-${SNAME}-vst2bundles.pkg|" \ - -e "s|@vst3bundleref@|dpf-${SNAME}-vst3bundles.pkg|" \ - -e "s|@name@|${NAME}|g" \ - -e "s|@sname@|${SNAME}|g" \ + -e "s|@name@|${MACOS_PKG_NAME}|g" \ + -e "s|@sname@|${MACOS_PKG_SNAME}|g" \ + -e "s|@symbol@|${MACOS_PKG_SYMBOL}|g" \ ${DPF_UTILS_DIR}/plugin.pkg/package.xml.in > build/package.xml productbuild \ --distribution build/package.xml \ - --identifier "studio.kx.distrho.${SNAME}" \ + --identifier "${MACOS_PKG_SYMBOL}" \ --package-path "${PWD}" \ --version 0 \ "${PKG_SIGN_ARGS[@]}" \ - ${SNAME}-macOS.pkg + ${MACOS_PKG_SNAME}-macOS.pkg # xcrun notarytool submit build/*-macOS.pkg --keychain-profile "build-notary" --wait # xcrun notarytool log --keychain-profile "build-notary" 00000000-0000-0000-0000-000000000000 diff --git a/utils/plugin.pkg/package.xml.in b/utils/plugin.pkg/package.xml.in index 7d81e66e..99785c04 100644 --- a/utils/plugin.pkg/package.xml.in +++ b/utils/plugin.pkg/package.xml.in @@ -3,38 +3,38 @@ @name@ - + @skip_au_start@ - - @aubundleref@ + + dpf-@sname@-components.pkg @skip_au_end@ @skip_clap_start@ - - @clapbundleref@ + + dpf-@sname@-clapbundles.pkg @skip_clap_end@ @skip_lv2_start@ - - @lv2bundleref@ + + dpf-@sname@-lv2bundles.pkg @skip_lv2_end@ @skip_vst2_start@ - - @vst2bundleref@ + + dpf-@sname@-vst2bundles.pkg @skip_vst2_end@ @skip_vst3_start@ - - @vst3bundleref@ + + dpf-@sname@-vst3bundles.pkg @skip_vst3_end@ - @skip_au_start@@skip_au_end@ - @skip_clap_start@@skip_clap_end@ - @skip_lv2_start@@skip_lv2_end@ - @skip_vst2_start@@skip_vst2_end@ - @skip_vst3_start@@skip_vst3_end@ + @skip_au_start@@skip_au_end@ + @skip_clap_start@@skip_clap_end@ + @skip_lv2_start@@skip_lv2_end@ + @skip_vst2_start@@skip_vst2_end@ + @skip_vst3_start@@skip_vst3_end@