Skip to content

Commit

Permalink
Allow MACOS_PKG_LICENSE_FILE var for macos packaging
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Mar 23, 2024
1 parent 96b8ed4 commit a3ef9b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions utils/package-osx-bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ else
fi

# can be overridden by environment variables
MACOS_PKG_LICENSE_FILE=${MACOS_PKG_LICENSE_FILE:=""}
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}"}
Expand All @@ -41,6 +42,11 @@ fi
rm -rf pkg
mkdir pkg

if [ -z "${MACOS_PKG_LICENSE_FILE}" ]; then
SKIP_LICENSE_START="${SKIP_START}"
SKIP_LICENSE_END="${SKIP_END}"
fi

ENABLE_AU=$(find . -maxdepth 1 -name '*.component' -print -quit | grep -q '.component' && echo 1 || echo)
if [ -n "${ENABLE_AU}" ]; then
mkdir pkg/au
Expand Down Expand Up @@ -126,16 +132,19 @@ cd ..
mkdir -p build
sed -e "s|@name@|${MACOS_PKG_NAME}|" "${MACOS_PKG_WELCOME_TXT}" > build/welcome.txt
sed -e "s|@builddir@|${PWD}/build|" \
-e "s|@skip_license_start@|${SKIP_LICENSE_START}|" \
-e "s|@skip_au_start@|${SKIP_AU_START}|" \
-e "s|@skip_clap_start@|${SKIP_CLAP_START}|" \
-e "s|@skip_lv2_start@|${SKIP_LV2_START}|" \
-e "s|@skip_vst2_start@|${SKIP_VST2_START}|" \
-e "s|@skip_vst3_start@|${SKIP_VST3_START}|" \
-e "s|@skip_license_end@|${SKIP_LICENSE_END}|" \
-e "s|@skip_au_end@|${SKIP_AU_END}|" \
-e "s|@skip_clap_end@|${SKIP_CLAP_END}|" \
-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|@license_file@|${MACOS_PKG_LICENSE_FILE}|" \
-e "s|@name@|${MACOS_PKG_NAME}|g" \
-e "s|@sname@|${MACOS_PKG_SNAME}|g" \
-e "s|@symbol@|${MACOS_PKG_SYMBOL}|g" \
Expand Down
1 change: 1 addition & 0 deletions utils/plugin.pkg/package.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<installer-gui-script minSpecVersion="1">
<title>@name@</title>
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true" />
@skip_license_start@<license file="@license_file@" mime-type="text/plain" />@skip_license_end@
<options customize="always" hostArchitectures="arm64,x86_64" require-scripts="false" rootVolumeOnly="true" />
<pkg-ref id="@symbol@" />
<welcome file="@builddir@/welcome.txt" mime-type="text/plain" />
Expand Down

0 comments on commit a3ef9b8

Please sign in to comment.