Skip to content

Commit 42809c1

Browse files
committed
Embed Sparkle.framework and fix runtime crash
1 parent 0df3ad5 commit 42809c1

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Scripts/package_app.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ swift build -c "$CONF" --arch arm64
88

99
APP="$ROOT/CodexBar.app"
1010
rm -rf "$APP"
11-
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
11+
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" "$APP/Contents/Frameworks"
1212

1313
# Convert new .icon bundle to .icns if present (macOS 14+/IconStudio export)
1414
ICON_SOURCE="$ROOT/Icon.icon"
@@ -42,6 +42,12 @@ PLIST
4242

4343
cp ".build/$CONF/CodexBar" "$APP/Contents/MacOS/CodexBar"
4444
chmod +x "$APP/Contents/MacOS/CodexBar"
45+
# Embed Sparkle.framework
46+
if [[ -d ".build/$CONF/Sparkle.framework" ]]; then
47+
cp -R ".build/$CONF/Sparkle.framework" "$APP/Contents/Frameworks/"
48+
chmod -R a+rX "$APP/Contents/Frameworks/Sparkle.framework"
49+
install_name_tool -add_rpath "@executable_path/../Frameworks" "$APP/Contents/MacOS/CodexBar"
50+
fi
4551

4652
if [[ -f "$ICON_TARGET" ]]; then
4753
cp "$ICON_TARGET" "$APP/Contents/Resources/Icon.icns"

0 commit comments

Comments
 (0)