aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.macos
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-27 16:43:20 +0200
committeruser <user@clank>2026-08-27 16:43:20 +0200
commitfb62cf8181b6ba397eee7b167ce6ad8128a95a27 (patch)
treebb24da1079cf45099bab3285bd85874cbf27220f /Makefile.macos
parentmacos-remote-build: a synced tree must not read as dirty (diff)
downloadslosh-fb62cf8181b6ba397eee7b167ce6ad8128a95a27.tar.gz
slosh-fb62cf8181b6ba397eee7b167ce6ad8128a95a27.tar.xz
slosh-fb62cf8181b6ba397eee7b167ce6ad8128a95a27.zip
macos zip: carry the same paperwork as the linux tarballs
The zip held a bare binary while the tarballs ship README, LICENSE, THIRD-PARTY-LICENSES and both manpages. The licenses are not decoration on either platform -- libghostty-vt and stb_image are statically linked into the mac binary too, and THIRD-PARTY-LICENSES exists precisely for redistributed builds -- and a manpage is as useful on macOS as anywhere. The archive now stages slosh-VERSION-macos-ARCH/ with the binary and the same doc set, mirroring the tarballs' layout. The list is read out of the main Makefile's REL_DOCS rather than copied here, so the two artifacts cannot drift; both Makefiles travel to the builder together. Notarization is unchanged: the ticket is keyed to the binary, and inert documents beside it are nothing to Apple's scan.
Diffstat (limited to 'Makefile.macos')
-rw-r--r--Makefile.macos23
1 files changed, 17 insertions, 6 deletions
diff --git a/Makefile.macos b/Makefile.macos
index d53424b..7a2892e 100644
--- a/Makefile.macos
+++ b/Makefile.macos
@@ -188,15 +188,26 @@ verify: ## check the signature is valid and well-formed
# ── package for notarization ────────────────────────────────────────────────
# A bare CLI binary can't be submitted to Apple; it must be inside a .zip,
-# .pkg, or .dmg. --keepParent preserves the filename inside the archive.
+# .pkg, or .dmg. --keepParent preserves the directory name inside the archive.
# (The output dir is made in-recipe on purpose: a `$(DIST):` target would
# collide with the phony `dist` command below and create a circular rule.)
-zip: sign ## zip the signed binary for submission / Homebrew
+#
+# The zip carries the same paperwork as the linux tarballs -- the licenses are
+# not decoration (libghostty-vt and stb_image are statically linked into this
+# binary too) and the manpages are as useful here as anywhere. The list is
+# read out of the main Makefile's REL_DOCS rather than copied, so the two
+# artifacts cannot drift apart; both Makefiles travel to the builder together.
+REL_DOCS := $(shell sed -n 's/^REL_DOCS[[:space:]]*:=[[:space:]]*//p' Makefile)
+
+zip: sign ## zip the signed binary + docs for submission / users
+ @test -n "$(REL_DOCS)" || { echo " [FAIL] REL_DOCS not found in Makefile"; exit 1; }
@mkdir -p $(DIST)
- @rm -f "$(ZIP)" "$(DIST)/slosh"
- @cp "$(BIN)" "$(DIST)/slosh" # stage as a clean top-level name
- @ditto -c -k "$(DIST)/slosh" "$(ZIP)" # single file -> archive contains just 'slosh'
- @rm -f "$(DIST)/slosh"
+ @rm -rf "$(ZIP)" "$(DIST)/$(STEM)"
+ @mkdir -p "$(DIST)/$(STEM)"
+ @cp "$(BIN)" "$(DIST)/$(STEM)/slosh"
+ @cp $(REL_DOCS) "$(DIST)/$(STEM)/"
+ @ditto -c -k --keepParent "$(DIST)/$(STEM)" "$(ZIP)"
+ @rm -rf "$(DIST)/$(STEM)"
@echo " [ZIP] $(ZIP)"
# ── notarize ────────────────────────────────────────────────────────────────