From 0c7cb68dba96b724595654cc756cc011d70584f1 Mon Sep 17 00:00:00 2001 From: Marvelous Akpotu Date: Tue, 20 Oct 2026 22:40:36 +0100 Subject: [PATCH 1/3] fix: add Frameworks directory to app bundle structure --- scripts/make-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make-app.sh b/scripts/make-app.sh index 2a46ec0..55bd655 100755 --- a/scripts/make-app.sh +++ b/scripts/make-app.sh @@ -35,7 +35,7 @@ else fi rm -rf "$APP_DIR" -mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Resources" +mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Frameworks" "$APP_DIR/Contents/Resources" cp "$BIN" "$APP_DIR/Contents/MacOS/PDFReader" # Copy Sparkle framework for update checking cp -R ".build/$CONFIG/Sparkle.framework" "$APP_DIR/Contents/Frameworks/" From 5406a4c53bfed562b5388a8ba860f565e3e8b49a Mon Sep 17 00:00:00 2001 From: Marvelous Akpotu Date: Tue, 20 Oct 2026 22:43:52 +0100 Subject: [PATCH 2/3] fix: pass release config to make-app.sh in CI --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89d71f2..7689eb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: - name: Package app bundle if: startsWith(github.ref, 'refs/tags/v') - run: APP_BINARY=.build/universal/PDFReader APP_VERSION="${GITHUB_REF_NAME}" APP_BUILD="${GITHUB_RUN_NUMBER}" ./scripts/make-app.sh release + run: ./scripts/make-app.sh release release APP_BINARY=.build/universal/PDFReader APP_VERSION="${GITHUB_REF_NAME}" APP_BUILD="${GITHUB_RUN_NUMBER}" - name: Build DMG if: startsWith(github.ref, 'refs/tags/v') From 257e9ccd1224b217cc4c4b6c4f6058614256603d Mon Sep 17 00:00:00 2001 From: Marvelous Akpotu Date: Wed, 21 Oct 2026 09:15:57 +0100 Subject: [PATCH 3/3] fix: add app-bundle rpath so Sparkle resolves from Contents/Frameworks --- scripts/make-app.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/make-app.sh b/scripts/make-app.sh index 55bd655..4afd6c5 100755 --- a/scripts/make-app.sh +++ b/scripts/make-app.sh @@ -37,6 +37,14 @@ fi rm -rf "$APP_DIR" mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Frameworks" "$APP_DIR/Contents/Resources" cp "$BIN" "$APP_DIR/Contents/MacOS/PDFReader" +# The binary's Sparkle load command uses @rpath, but SwiftPM only emits +# toolchain rpaths (/usr/lib/swift, …). Without an app-bundle rpath, dyld +# can never resolve @rpath/Sparkle.framework from Contents/Frameworks and +# the app aborts at launch (DYLD "Library missing"). Add it if absent. +EXEC="$APP_DIR/Contents/MacOS/PDFReader" +if ! otool -l "$EXEC" | grep -q 'path @executable_path/../Frameworks'; then + xcrun install_name_tool -add_rpath '@executable_path/../Frameworks' "$EXEC" +fi # Copy Sparkle framework for update checking cp -R ".build/$CONFIG/Sparkle.framework" "$APP_DIR/Contents/Frameworks/" # App icon (generated by scripts/generate-icon.swift).