From 16bf58e2e857ff298dfff5b8e3f8cada28d88513 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Thu, 20 Aug 2026 15:52:14 +0000 Subject: [PATCH] feat(brand): add make brand-sync for the icon theme The scalable app and status sources are copies from the brand source. The hicolor PNG ladder has no committed raster there, so each of the eight sizes is rendered straight from the vendored app SVG at its exact pixel size rather than downsampled from one raster. The status filenames are this theme's, not the brand source's; the mapping lives in the Makefile beside the target, because it is the contract crates/solstone-linux/build.rs embeds by constant. Output is deterministic. The assets themselves are deliberately not updated in this commit: the app icon is a generation behind and the next change to it supersedes the catch-up, so syncing now would churn every binary twice. --- Makefile | 32 +++++++++++++++++++++++++++++++- 1 file(s) changed, 31 insertion(s)(+), 1 deletion(s)(-) diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # solstone-linux Makefile # Standalone Linux desktop observer for solstone -.PHONY: all bootstrap install format test check-observer-contract check-rust-release-manifest check-transparency-minisign check-audit-signed-packet ci audit update-deps shellcheck install-service uninstall-service service-restart service-status service-logs versions clean clean-install release release-images release-candidate release-candidate-prove release-candidate-recover publish-release publish-transparency resign-transparency-pointer check-toolchain-env establish-toolchain rust-preflight check-cargo-deny +.PHONY: all bootstrap install format brand-sync test check-observer-contract check-rust-release-manifest check-transparency-minisign check-audit-signed-packet ci audit update-deps shellcheck install-service uninstall-service service-restart service-status service-logs versions clean clean-install release release-images release-candidate release-candidate-prove release-candidate-recover publish-release publish-transparency resign-transparency-pointer check-toolchain-env establish-toolchain rust-preflight check-cargo-deny APP := solstone-linux UNIT := solstone-linux.service @@ -72,6 +72,36 @@ format: rust-preflight $(CARGO) fmt + +# Re-vendor brand assets from the canonical brand source. CI verifies the +# committed output (it does not run brand-sync) — run this locally when the +# brand spec updates, then commit the diff. +# +# The scalable sources are copies. The hicolor PNG ladder has no committed +# raster in the brand source: each size is rendered straight from the vendored +# app SVG at its exact pixel size (never downsampled from one raster), which +# needs rsvg-convert (librsvg). +# apt: librsvg2-bin dnf: librsvg2-tools +# +# The status names are this theme's, not the brand source's — the mapping below +# is the contract crates/solstone-linux/build.rs embeds by constant. +BRAND_ICON_DIR = contrib/icons/hicolor +BRAND_STATUS_SYNC = solstone-recording:sol-ring-icon solstone-paused:sol-ring-icon-paused solstone-syncing:sol-ring-icon-half solstone-error:sol-ring-icon-error +BRAND_ICON_SIZES = 16 24 32 48 64 128 256 512 + +brand-sync: + @test -n "$(BRAND_DIR)" || { echo "brand: BRAND_DIR is required — point it at your brand asset directory (BRAND_DIR=/path/to/brand make brand-sync)"; exit 1; } + @test -d "$(BRAND_DIR)" || { echo "brand: BRAND_DIR=$(BRAND_DIR) not found"; exit 1; } + @command -v rsvg-convert >/dev/null 2>&1 || { echo "brand: rsvg-convert (librsvg) not found — apt install librsvg2-bin, or dnf install librsvg2-tools"; exit 1; } + @set -e; for pair in $(BRAND_STATUS_SYNC); do \ + cp "$(BRAND_DIR)/$${pair#*:}.svg" "$(BRAND_ICON_DIR)/scalable/status/$${pair%%:*}.svg"; \ + done + cp "$(BRAND_DIR)/app-icon/sol-app-icon-transparent.svg" $(BRAND_ICON_DIR)/scalable/apps/solstone-observer.svg + @set -e; for size in $(BRAND_ICON_SIZES); do \ + rsvg-convert -w $$size -h $$size $(BRAND_ICON_DIR)/scalable/apps/solstone-observer.svg \ + -o $(BRAND_ICON_DIR)/$${size}x$${size}/apps/solstone-observer.png; \ + done + @echo "brand: synced from $(BRAND_DIR)" test: rust-preflight $(CARGO) test $(CARGO_LOCKED) -p solstone-linux -- tangled.sh