From 29ed9d79d219ce5f1a88189d9547cdd010b632bc Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Wed, 12 Jan 2022 08:24:18 +0100 Subject: [PATCH] PICARD-2395: Fixed building for macOS --- scripts/package/macos-package-app.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/package/macos-package-app.sh b/scripts/package/macos-package-app.sh index 0d6a29be8..1c154f523 100755 --- a/scripts/package/macos-package-app.sh +++ b/scripts/package/macos-package-app.sh @@ -57,10 +57,16 @@ mv "$APP_BUNDLE.tmp" "$APP_BUNDLE" # Fix placing text files in Resources instead of Contents to avoid signatures ending up in extended attributes. # This fixes the signature breaking if extended attributes get removed or modified. # Fixes https://tickets.metabrainz.org/browse/PICARD-1943 and related issues. -mkdir "$APP_BUNDLE/Contents/Resources/Qt/" -mv "$APP_BUNDLE/Contents/MacOS/PyQt5/Qt/translations" "$APP_BUNDLE/Contents/Resources/Qt/" -pushd "$APP_BUNDLE/Contents/MacOS/PyQt5/Qt/" -ln -s ../../../Resources/Qt/translations . +echo "Fixing location of Qt5 translation resources for code signing..." +if [[ -d "$APP_BUNDLE/Contents/MacOS/PyQt5/Qt5/" ]]; then + QT5_DIR=Qt5 +else # For older PyQt5 installs + QT5_DIR=Qt +fi +mkdir "$APP_BUNDLE/Contents/Resources/$QT5_DIR/" +mv "$APP_BUNDLE/Contents/MacOS/PyQt5/$QT5_DIR/translations" "$APP_BUNDLE/Contents/Resources/$QT5_DIR/" +pushd "$APP_BUNDLE/Contents/MacOS/PyQt5/$QT5_DIR/" +ln -s "../../../Resources/$QT5_DIR/translations" . popd if [ "$CODESIGN" = '1' ]; then