From 1ad42fffb1989f8d4428c9c7187e22d609b9d2de Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:29:07 -0600 Subject: [PATCH] fix mac builds (#1557) --- scripts/macOS/bundle.sh | 11 +++++++++++ scripts/macOS/sign.sh | 13 ++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/macOS/bundle.sh b/scripts/macOS/bundle.sh index 168cae9d..45177cb5 100755 --- a/scripts/macOS/bundle.sh +++ b/scripts/macOS/bundle.sh @@ -18,6 +18,17 @@ cp -R "$REPO_ROOT/ErsatzTV-macOS/build/Release/ErsatzTV-macOS.app" "$APP_NAME" cp -a "$PUBLISH_OUTPUT_DIRECTORY" "$APP_NAME/Contents/MacOS" +# codesign fails with some files in directories that have periods in them, so move to resources and symlink +pushd "$APP_NAME"/Contents/MacOS/wwwroot/_content/ || exit +for file in *; do + if test -d "$file" && test ! -L "$file"; then + FOLDER=$(basename "$file") + mv "$file" "$APP_NAME/Contents/Resources/" + ln -s "../../../Resources/$FOLDER" "$file" + fi +done +popd || exit + chmod +x "$APP_NAME/Contents/MacOS/ErsatzTV" chmod +x "$APP_NAME/Contents/MacOS/ErsatzTV.Scanner" chmod +x "$APP_NAME/Contents/MacOS/ErsatzTV-macOS" diff --git a/scripts/macOS/sign.sh b/scripts/macOS/sign.sh index 46c8b449..49ecc45f 100755 --- a/scripts/macOS/sign.sh +++ b/scripts/macOS/sign.sh @@ -1,19 +1,10 @@ #! /bin/bash SCRIPT_FOLDER=$(dirname ${BASH_SOURCE[0]}) -REPO_ROOT="$SCRIPT_FOLDER/../.." +REPO_ROOT=$(realpath "$SCRIPT_FOLDER/../..") APP_NAME="$REPO_ROOT/ErsatzTV.app" ENTITLEMENTS="$SCRIPT_FOLDER/ErsatzTV.entitlements" SIGNING_IDENTITY="C3BBCFB2D6851FF0DCA6CAC06A3EF1ECE71F9FFF" -find "$APP_NAME/Contents/MacOS/"|while read fname; do - if [[ -f $fname ]]; then - echo "[INFO] Signing $fname" - codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$fname" - fi -done - -echo "[INFO] Signing app file" - -codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$APP_NAME" +codesign --force --verbose --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" --deep "$APP_NAME"