| @@ -31,9 +31,11 @@ swift build -c release $arch_flags --product OrgstarWidgets |
| 31 | # shellcheck disable=SC2086 |
31 | # shellcheck disable=SC2086 |
| 32 | binary="$(swift build -c release $arch_flags --show-bin-path)/Orgstar" |
32 | binary="$(swift build -c release $arch_flags --show-bin-path)/Orgstar" |
| 33 | |
33 | |
| 34 | rm -rf "$app" |
34 | rm -rf "$app" .build/app/dSYMs |
| 35 | mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources" "$app/Contents/Frameworks" |
35 | mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources" "$app/Contents/Frameworks" .build/app/dSYMs |
| 36 | cp "$binary" "$app/Contents/MacOS/Orgstar" |
36 | cp "$binary" "$app/Contents/MacOS/Orgstar" |
| |
37 | # The build's debug symbols, for symbolicating crash reports; the executables ship stripped. |
| |
38 | for dsym in "$(dirname "$binary")"/*.dSYM; do ditto "$dsym" ".build/app/dSYMs/$(basename "$dsym")"; done |
| 37 | |
39 | |
| 38 | # Sparkle, from its SwiftPM artifact: the framework beside the binary, found through an rpath. |
40 | # Sparkle, from its SwiftPM artifact: the framework beside the binary, found through an rpath. |
| 39 | sparkle="$(find .build/artifacts -path '*Sparkle.xcframework/macos-*/Sparkle.framework' -maxdepth 7 | head -1)" |
41 | sparkle="$(find .build/artifacts -path '*Sparkle.xcframework/macos-*/Sparkle.framework' -maxdepth 7 | head -1)" |
| @@ -41,6 +43,7 @@ sparkle="$(find .build/artifacts -path '*Sparkle.xcframework/macos-*/Sparkle.fra |
| 41 | ditto "$sparkle" "$app/Contents/Frameworks/Sparkle.framework" |
43 | ditto "$sparkle" "$app/Contents/Frameworks/Sparkle.framework" |
| 42 | otool -l "$app/Contents/MacOS/Orgstar" | grep -q '@executable_path/../Frameworks' \ |
44 | otool -l "$app/Contents/MacOS/Orgstar" | grep -q '@executable_path/../Frameworks' \ |
| 43 | || install_name_tool -add_rpath @executable_path/../Frameworks "$app/Contents/MacOS/Orgstar" |
45 | || install_name_tool -add_rpath @executable_path/../Frameworks "$app/Contents/MacOS/Orgstar" |
| |
46 | strip -x "$app/Contents/MacOS/Orgstar" |
| 44 | |
47 | |
| 45 | # SwiftMath's math fonts, which it finds in the app's resources. |
48 | # SwiftMath's math fonts, which it finds in the app's resources. |
| 46 | cp -R "$(dirname "$binary")/SwiftMath_SwiftMath.bundle" "$app/Contents/Resources/" |
49 | cp -R "$(dirname "$binary")/SwiftMath_SwiftMath.bundle" "$app/Contents/Resources/" |
| @@ -176,6 +179,7 @@ appex() { # name, extension point, principal class (or ""), attributes, extra en |
| 176 | dir="$app/Contents/PlugIns/$1.appex/Contents" |
179 | dir="$app/Contents/PlugIns/$1.appex/Contents" |
| 177 | mkdir -p "$dir/MacOS" "$dir/Resources" |
180 | mkdir -p "$dir/MacOS" "$dir/Resources" |
| 178 | cp "$(dirname "$binary")/$1" "$dir/MacOS/$1" |
181 | cp "$(dirname "$binary")/$1" "$dir/MacOS/$1" |
| |
182 | strip -x "$dir/MacOS/$1" |
| 179 | scripts/localize.sh "$dir/Resources" |
183 | scripts/localize.sh "$dir/Resources" |
| 180 | cat > "$dir/Info.plist" <<PLIST |
184 | cat > "$dir/Info.plist" <<PLIST |
| 181 | <?xml version="1.0" encoding="UTF-8"?> |
185 | <?xml version="1.0" encoding="UTF-8"?> |