Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Build Sparkle's tools apart from its framework, without arm64e

Țugui Dragoșa1f2613a2e34
diff --git a/Scripts/build_sparkle.sh b/Scripts/build_sparkle.sh
index 9de28fda..d9428a1b 100644
--- a/Scripts/build_sparkle.sh
+++ b/Scripts/build_sparkle.sh
@@ -1,7 +1,9 @@
#!/bin/zsh
# Builds Sparkle, which updates Peel, from its source at a fixed commit: the framework Peel embeds, and the tools a
# release signs its update with. Every program Peel ships has an arm64e slice, which Sparkle's prebuilt framework lacks,
-# and Sparkle's XPC services are left out, since Sparkle uses them only in a sandboxed app.
+# and Sparkle's XPC services are left out, since Sparkle uses them only in a sandboxed app. The tools run only on the
+# Mac that makes a release, so they are built without arm64e, in a folder of their own: they share Sparkle's static
+# libraries with the framework, and built in one folder with other settings, each would replace the other's.
#
# Usage: zsh Scripts/build_sparkle.sh (run once before building Peel, and again when the version below changes,
# after moving build/SparkleSource to the Trash)
@@ -25,14 +27,20 @@ if [ "$(git -C "$source" rev-parse HEAD)" != "$commit" ] || [ -n "$(git -C "$sou
exit 1
fi
-for scheme in Sparkle generate_keys sign_update generate_appcast; do
+build_scheme() {
+ local scheme=$1 folder=$2
+ shift 2
if ! xcodebuild -project "$source/Sparkle.xcodeproj" -scheme "$scheme" -configuration Release \
- -destination 'generic/platform=macOS' -derivedDataPath build/SparkleBuild ENABLE_POINTER_AUTHENTICATION=YES \
- SPARKLE_EMBED_INSTALLER_LAUNCHER_XPC_SERVICE=0 SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE=0 \
- build > build/SparkleBuild.log 2>&1; then
- tail -20 build/SparkleBuild.log
- echo "REFUSED: Sparkle's $scheme did not build. The whole log is build/SparkleBuild.log."
+ -destination 'generic/platform=macOS' -derivedDataPath "$folder" "$@" build > "$folder.log" 2>&1; then
+ tail -20 "$folder.log"
+ echo "REFUSED: Sparkle's $scheme did not build. The whole log is $folder.log."
exit 1
fi
+}
+
+build_scheme Sparkle build/SparkleBuild ENABLE_POINTER_AUTHENTICATION=YES \
+ SPARKLE_EMBED_INSTALLER_LAUNCHER_XPC_SERVICE=0 SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE=0
+for tool in generate_keys sign_update generate_appcast; do
+ build_scheme "$tool" build/SparkleTools
done
-echo "Sparkle $version: build/SparkleBuild/Build/Products/Release"
+echo "Sparkle $version: the framework in build/SparkleBuild, its tools in build/SparkleTools"
diff --git a/Scripts/release.sh b/Scripts/release.sh
index dde867f8..bf83f4a9 100755
--- a/Scripts/release.sh
+++ b/Scripts/release.sh
@@ -237,7 +237,7 @@ awk -v heading="## $version (" '
END { for (line = 1; line <= last; line++) print lines[line] }
' CHANGELOG.md > "$feed/Peel-$version.md"
[ -s "$feed/Peel-$version.md" ] || { echo "REFUSED: CHANGELOG.md has no entry for $version"; exit 1; }
-build/SparkleBuild/Build/Products/Release/generate_appcast --account peel --critical-update-version "" \
+build/SparkleTools/Build/Products/Release/generate_appcast --account peel --critical-update-version "" \
--embed-release-notes --download-url-prefix "$download" "$feed"
swift Scripts/check_appcast.swift "$feed/appcast.xml" "$app" "$image" "$download"