DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit eee65f06632be6b842f2dda4e833df15aca039f5
parent 3aeed6e3a31c546d52fd3244157dbca21097c4f6
Author: falkTX <falktx@falktx.com>
Date:   Mon, 11 Mar 2024 19:17:50 +0100

Allow to customize more macOS installer details

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mutils/package-osx-bundles.sh | 51++++++++++++++++++++++++++-------------------------
Mutils/plugin.pkg/package.xml.in | 32++++++++++++++++----------------
2 files changed, 42 insertions(+), 41 deletions(-)

diff --git 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="<!--" SKIP_END="-->" @@ -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 @@ -3,38 +3,38 @@ <title>@name@</title> <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true" /> <options customize="always" hostArchitectures="arm64,x86_64" require-scripts="false" rootVolumeOnly="true" /> - <pkg-ref id="studio.kx.distrho.@sname@" /> + <pkg-ref id="@symbol@" /> <welcome file="@builddir@/welcome.txt" mime-type="text/plain" /> @skip_au_start@ - <choice id="studio.kx.distrho.@sname@-au" title="AU" description="Install AU plugins" visible="true"> - <pkg-ref id="studio.kx.distrho.@sname@-components" version="0">@aubundleref@</pkg-ref> + <choice id="@symbol@-au" title="AU" description="Install AU plugins" visible="true"> + <pkg-ref id="@symbol@-components" version="0">dpf-@sname@-components.pkg</pkg-ref> </choice> @skip_au_end@ @skip_clap_start@ - <choice id="studio.kx.distrho.@sname@-clap" title="CLAP" description="Install CLAP plugins" visible="true"> - <pkg-ref id="studio.kx.distrho.@sname@-clapbundles" version="0">@clapbundleref@</pkg-ref> + <choice id="@symbol@-clap" title="CLAP" description="Install CLAP plugins" visible="true"> + <pkg-ref id="@symbol@-clapbundles" version="0">dpf-@sname@-clapbundles.pkg</pkg-ref> </choice> @skip_clap_end@ @skip_lv2_start@ - <choice id="studio.kx.distrho.@sname@-lv2" title="LV2" description="Install LV2 plugins" visible="true"> - <pkg-ref id="studio.kx.distrho.@sname@-lv2bundles" version="0">@lv2bundleref@</pkg-ref> + <choice id="@symbol@-lv2" title="LV2" description="Install LV2 plugins" visible="true"> + <pkg-ref id="@symbol@-lv2bundles" version="0">dpf-@sname@-lv2bundles.pkg</pkg-ref> </choice> @skip_lv2_end@ @skip_vst2_start@ - <choice id="studio.kx.distrho.@sname@-vst2" title="VST2" description="Install VST2 plugins" visible="true"> - <pkg-ref id="studio.kx.distrho.@sname@-vst2bundles" version="0">@vst2bundleref@</pkg-ref> + <choice id="@symbol@-vst2" title="VST2" description="Install VST2 plugins" visible="true"> + <pkg-ref id="@symbol@-vst2bundles" version="0">dpf-@sname@-vst2bundles.pkg</pkg-ref> </choice> @skip_vst2_end@ @skip_vst3_start@ - <choice id="studio.kx.distrho.@sname@-vst3" title="VST3" description="Install VST3 plugins" visible="true"> - <pkg-ref id="studio.kx.distrho.@sname@-vst3bundles" version="0">@vst3bundleref@</pkg-ref> + <choice id="@symbol@-vst3" title="VST3" description="Install VST3 plugins" visible="true"> + <pkg-ref id="@symbol@-vst3bundles" version="0">dpf-@sname@-vst3bundles.pkg</pkg-ref> </choice> @skip_vst3_end@ <choices-outline> - @skip_au_start@<line choice="studio.kx.distrho.@sname@-au"/>@skip_au_end@ - @skip_clap_start@<line choice="studio.kx.distrho.@sname@-clap"/>@skip_clap_end@ - @skip_lv2_start@<line choice="studio.kx.distrho.@sname@-lv2"/>@skip_lv2_end@ - @skip_vst2_start@<line choice="studio.kx.distrho.@sname@-vst2"/>@skip_vst2_end@ - @skip_vst3_start@<line choice="studio.kx.distrho.@sname@-vst3"/>@skip_vst3_end@ + @skip_au_start@<line choice="@symbol@-au"/>@skip_au_end@ + @skip_clap_start@<line choice="@symbol@-clap"/>@skip_clap_end@ + @skip_lv2_start@<line choice="@symbol@-lv2"/>@skip_lv2_end@ + @skip_vst2_start@<line choice="@symbol@-vst2"/>@skip_vst2_end@ + @skip_vst3_start@<line choice="@symbol@-vst3"/>@skip_vst3_end@ </choices-outline> </installer-gui-script>