Commit fe31f1cd94
fe31f1cd94ce7c191b990d0c23710eee989b423b
parent: 73230beed3
Verified · cmc
cmc <hello@cleberg.net> · 2026-10-11 05:06 UTC
Link Sparkle and bundle its framework
Layout: unified · split
Package.resolved
+10 −1
| @@ -1,5 +1,5 @@ |
| 1 | 1 | { |
| 2 | | "originHash" : "99f611db4aa216eecc3254d58a7ad6ee060533c7f899b1a0d0f72c21a75f90a9", |
| 2 | "originHash" : "13a9fcac60cd27fea1022731e52b785749d4a9dfb56c2e629b61c25a99e5464d", |
| 3 | 3 | "pins" : [ |
| 4 | 4 | { |
| 5 | 5 | "identity" : "grdb.swift", |
| @@ -10,6 +10,15 @@ |
| 10 | 10 | "version" : "7.11.1" |
| 11 | 11 | } |
| 12 | 12 | }, |
| 13 | { |
| 14 | "identity" : "sparkle", |
| 15 | "kind" : "remoteSourceControl", |
| 16 | "location" : "https://github.com/sparkle-project/Sparkle", |
| 17 | "state" : { |
| 18 | "revision" : "eef1a539a373c1f1a320624b1130fc5de7b2e100", |
| 19 | "version" : "2.10.0" |
| 20 | } |
| 21 | }, |
| 13 | 22 | { |
| 14 | 23 | "identity" : "swift-tree-sitter", |
| 15 | 24 | "kind" : "remoteSourceControl", |
Package.swift
+2 −1
| @@ -25,6 +25,7 @@ let package = Package( |
| 25 | 25 | ], |
| 26 | 26 | dependencies: [ |
| 27 | 27 | .package(url: "https://github.com/groue/GRDB.swift", from: "7.11.1"), |
| 28 | .package(url: "https://github.com/sparkle-project/Sparkle", from: "2.7.0"), |
| 28 | 29 | .package(url: "https://github.com/tree-sitter/swift-tree-sitter", from: "0.25.0"), |
| 29 | 30 | .package(url: "https://github.com/tree-sitter/tree-sitter-bash", exact: "0.25.1"), |
| 30 | 31 | .package(url: "https://github.com/tree-sitter/tree-sitter-c", exact: "0.24.2"), |
| @@ -82,7 +83,7 @@ let package = Package( |
| 82 | 83 | ), |
| 83 | 84 | .executableTarget(name: "OrgstarSpike", dependencies: ["OrgEditorAppKit"]), |
| 84 | 85 | .target(name: "OrgApp", dependencies: ["OrgWorkspace", "OrgDocument", "OrgPresentation"]), |
| 85 | | .executableTarget(name: "Orgstar", dependencies: ["OrgApp", "OrgEditorAppKit", "OrgHighlight"]), |
| 86 | .executableTarget(name: "Orgstar", dependencies: ["OrgApp", "OrgEditorAppKit", "OrgHighlight", .product(name: "Sparkle", package: "Sparkle")]), |
| 86 | 87 | // The iOS app, bundled by scripts/build-ios-app.sh. |
| 87 | 88 | .executableTarget(name: "OrgstarMobile", dependencies: ["OrgApp", "OrgHighlight"]), |
| 88 | 89 | // App extensions, bundled into orgstar.app by scripts/build-app.sh. |
scripts/build-app.sh
+26 −1
| @@ -30,8 +30,25 @@ swift build -c release $arch_flags --product OrgstarSpotlight |
| 30 | 30 | binary="$(swift build -c release $arch_flags --show-bin-path)/Orgstar" |
| 31 | 31 | |
| 32 | 32 | rm -rf "$app" |
| 33 | | mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources" |
| 33 | mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources" "$app/Contents/Frameworks" |
| 34 | 34 | cp "$binary" "$app/Contents/MacOS/Orgstar" |
| 35 | |
| 36 | # Sparkle, from its SwiftPM artifact: the framework beside the binary, found through an rpath. |
| 37 | sparkle="$(find .build/artifacts -path '*Sparkle.xcframework/macos-*/Sparkle.framework' -maxdepth 7 | head -1)" |
| 38 | [ -n "$sparkle" ] || { echo "Sparkle.framework not in .build/artifacts; swift build fetches it." >&2; exit 1; } |
| 39 | ditto "$sparkle" "$app/Contents/Frameworks/Sparkle.framework" |
| 40 | otool -l "$app/Contents/MacOS/Orgstar" | grep -q '@executable_path/../Frameworks' \ |
| 41 | || install_name_tool -add_rpath @executable_path/../Frameworks "$app/Contents/MacOS/Orgstar" |
| 42 | |
| 43 | # Updates: the appcast and its signing key, for signed builds only; a dev build never checks. |
| 44 | if [ "$sign" != "-" ]; then |
| 45 | feed_keys=" <key>SUFeedURL</key> |
| 46 | <string>https://krz.gitbay.site/orgstar/appcast.xml</string> |
| 47 | <key>SUPublicEDKey</key> |
| 48 | <string>${ORGSTAR_ED_PUBLIC_KEY:?set ORGSTAR_ED_PUBLIC_KEY to the key generate_keys printed}</string>" |
| 49 | else |
| 50 | feed_keys="" |
| 51 | fi |
| 35 | 52 | iconset="$(mktemp -d)/AppIcon.iconset" |
| 36 | 53 | swift scripts/make-icon.swift "$iconset" |
| 37 | 54 | iconutil -c icns "$iconset" -o "$app/Contents/Resources/AppIcon.icns" |
| @@ -108,6 +125,7 @@ cat > "$app/Contents/Info.plist" <<EOF |
| 108 | 125 | <string>${build}</string> |
| 109 | 126 | <key>LSMinimumSystemVersion</key> |
| 110 | 127 | <string>26.0</string> |
| 128 | ${feed_keys} |
| 111 | 129 | <key>LSApplicationCategoryType</key> |
| 112 | 130 | <string>public.app-category.productivity</string> |
| 113 | 131 | <key>NSCalendarsFullAccessUsageDescription</key> |
| @@ -188,6 +206,13 @@ appex OrgstarQuickLook com.apple.quicklook.preview PreviewProvider \ |
| 188 | 206 | appex OrgstarSpotlight com.apple.spotlight.import ImportExtension \ |
| 189 | 207 | "<key>CSSupportedContentTypes</key><array><string>org.orgmode.org</string></array>" |
| 190 | 208 | |
| 209 | # Sparkle's inner pieces are signed first, as its documentation has it, then the framework. |
| 210 | fw="$app/Contents/Frameworks/Sparkle.framework/Versions/B" |
| 211 | for item in "$fw/XPCServices/Installer.xpc" "$fw/XPCServices/Downloader.xpc" "$fw/Autoupdate" "$fw/Updater.app" "$app/Contents/Frameworks/Sparkle.framework"; do |
| 212 | # shellcheck disable=SC2086 |
| 213 | codesign --force --sign "$sign" $sign_flags "$item" |
| 214 | done |
| 215 | |
| 191 | 216 | # The hardened runtime needs Calendar access declared for the agenda's events. |
| 192 | 217 | cat > "$work/app.entitlements" <<PLIST |
| 193 | 218 | <?xml version="1.0" encoding="UTF-8"?> |