Files
breeze/mk/package-freebsd.mk
waozi 017d3565d3 Build on Ziran 0.5.0 and Kryon's namespaced widgets, with the Tao picture page
Pin only pushed commits, with no local overrides: Ziran v0.5.0
(f9f92b46), Kryon b45cc524 (one lock entry, ref master, shared with the
Css and Plot master edges), Apps 352901e, Entity b30dd4a and practices
893e5b6f, whose sharpened banners and regenerated Lumi guide clips the
narration check now matches.

The Library opens each Tao Te Ching chapter on its own picture page: the
chapter art and its title, centered together; the text pages follow.
The reader keeps the picture page across reflow, and a chapter start or
a Contents pick opens it. The 81 approved chapter pictures are included.

Breeze now uses Kryon's namespaced widgets (Text.Draw/Text.Props,
Button, Image, Modal.ActionModal, Layout, TabBar, LoadingScreen,
LoadingIndicator, Shape.Circle) instead of the removed Kryon/Widgets
facades. Hosted apps import std/text explicitly, since a short "text"
import now names Kryon's widget. AGENTS.md and the Text/Button API checks
describe the namespaced forms; two unused test doubles are removed.

Build fixes for the new toolchain: the bundle runtime carries Ziran's
instruction engine (no BOOTSTRAP=1) and takes the pinned host zi2c for
cross builds; the Apps controller's lock context has the manifest's
module roots; the app codec generator lists Kryon's raw modules only;
the package scripts read ZX revision 28 bundle assets. The Apps
controller digest matches the Apps 352901e build.

Also included: the stopped lanes' work in this tree (Radio download,
Photos install, Lists, Lumi, Habits shop rewards, astral exercise
selection, appearance and download recovery) and the raylib-free desktop
lane's host modules (app_trace, host_input, host_window, host_clock),
inactive unless DESKTOP_HOST is defined.

Not included: the crash-recovery lane's picture-window and storage
crash-safety changes, which that lane commits itself.

Local tests: zi-check (510 modules), native and Android source checks,
hosted app checks, build-laws, clean-text-api-check, button-api-check,
library-reader-test, library-ui-test, storage-crash-zi-test and
native-image-decode-test pass. The bundled Arcade is still ZX revision 26
and waits for an Arcade build on these pins.
2026-11-16 14:20:12 -03:00

131 lines
5.4 KiB
Makefile

PREFIX ?= /usr/local
DESTDIR ?=
APP_NAME ?= app
APP_EXECUTABLE ?= $(APP_NAME)
APP_TITLE ?= $(APP_NAME)
APP_ID ?= $(APP_NAME)
APP_DESKTOP_ID ?= $(APP_ID)
APP_ICON_NAME ?= $(APP_DESKTOP_ID)
APP_DESKTOP_EXEC ?= $(APP_EXECUTABLE)
APP_VERSION ?= 0
APP_COMMENT ?= $(APP_TITLE)
APP_DESC ?= $(APP_COMMENT)
APP_CATEGORIES ?= Utility;
APP_MAINTAINER ?= Waozi <[email protected]>
APP_WWW ?= https://waozi.xyz/
APP_ORIGIN ?= local/$(APP_NAME)
APP_LICENSE ?=
APP_DESKTOP ?=
APP_METAINFO ?=
APP_ICON ?=
APP_ICON_SIZE ?= 512x512
FREEBSD_PKG_DEPS ?=
FREEBSD_PKG_STAGE_DIR ?= $(BUILD_DIR)/pkg/freebsd/root
FREEBSD_PKG_WORK_DIR ?= $(BUILD_DIR)/pkg/freebsd
FREEBSD_PKG_DIST_DIR ?= $(BUILD_DIST_DIR)/freebsd
FREEBSD_PKG_ARCH ?= $(shell uname -m 2>/dev/null | sed 's/^amd64$$/x86_64/')
FREEBSD_PKG_ABI ?= $(shell pkg config ABI 2>/dev/null)
FREEBSD_PKG_FILE ?= $(FREEBSD_PKG_DIST_DIR)/$(APP_NAME)-$(APP_VERSION)-freebsd-$(FREEBSD_PKG_ARCH).pkg
FREEBSD_PKG_MANIFEST ?= $(FREEBSD_PKG_WORK_DIR)/+MANIFEST
FREEBSD_PKG_PLIST ?= $(FREEBSD_PKG_WORK_DIR)/plist
.PHONY: install install-user uninstall stage package-freebsd freebsd-pkg-check validate-desktop
install: $(TARGET)
@$(MAKE) stage DESTDIR=
install-user: $(TARGET)
@$(MAKE) stage PREFIX="$(HOME)/.local" DESTDIR=
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/bin/$(APP_EXECUTABLE)"
rm -f "$(DESTDIR)$(PREFIX)/share/applications/$(APP_DESKTOP_ID).desktop"
rm -f "$(DESTDIR)$(PREFIX)/share/applications/$(APP_NAME).desktop"
rm -f "$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(APP_ICON_SIZE)/apps/$(APP_ICON_NAME).png"
rm -f "$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(APP_ICON_SIZE)/apps/$(APP_NAME).png"
rm -f "$(DESTDIR)$(PREFIX)/share/metainfo/$(APP_ID).metainfo.xml"
stage: $(TARGET)
@set -eu; \
bin_dir="$(DESTDIR)$(PREFIX)/bin"; \
app_dir="$(DESTDIR)$(PREFIX)/share/applications"; \
icon_dir="$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(APP_ICON_SIZE)/apps"; \
meta_dir="$(DESTDIR)$(PREFIX)/share/metainfo"; \
mkdir -p "$$bin_dir"; \
cp "$(TARGET)" "$$bin_dir/$(APP_EXECUTABLE).new"; \
chmod 755 "$$bin_dir/$(APP_EXECUTABLE).new"; \
mv -f "$$bin_dir/$(APP_EXECUTABLE).new" "$$bin_dir/$(APP_EXECUTABLE)"; \
if [ -n "$(strip $(APP_DESKTOP))" ]; then \
mkdir -p "$$app_dir"; \
sed -e 's/^Icon=.*/Icon=$(APP_ICON_NAME)/' \
-e 's#^Exec=.*#Exec="$(APP_DESKTOP_EXEC)"#' \
"$(APP_DESKTOP)" > "$$app_dir/$(APP_DESKTOP_ID).desktop"; \
fi; \
if [ -n "$(strip $(APP_ICON))" ]; then \
mkdir -p "$$icon_dir"; \
cp "$(APP_ICON)" "$$icon_dir/$(APP_ICON_NAME).png"; \
fi; \
if [ -n "$(strip $(APP_METAINFO))" ]; then \
mkdir -p "$$meta_dir"; \
sed -e 's/<release version="[^"]*"/<release version="$(APP_VERSION)"/' \
-e 's#<launchable type="desktop-id">[^<]*</launchable>#<launchable type="desktop-id">$(APP_DESKTOP_ID).desktop</launchable>#' \
"$(APP_METAINFO)" > "$$meta_dir/$(APP_ID).metainfo.xml"; \
fi; \
echo "Staged $(APP_NAME) under $(DESTDIR)$(PREFIX)"
validate-desktop:
@if [ -n "$(strip $(APP_DESKTOP))" ] && command -v desktop-file-validate >/dev/null 2>&1; then \
desktop-file-validate "$(APP_DESKTOP)"; \
else \
echo "desktop-file-validate not available; skipping"; \
fi
freebsd-pkg-check:
@if [ "$$(uname -s)" != "FreeBSD" ]; then \
echo "package-freebsd must run on FreeBSD"; \
exit 1; \
fi
@command -v pkg >/dev/null 2>&1 || { echo "pkg is required"; exit 1; }
package-freebsd: freebsd-pkg-check validate-desktop
@set -eu; \
rm -rf "$(FREEBSD_PKG_STAGE_DIR)" "$(FREEBSD_PKG_WORK_DIR)/manifest.deps"; \
mkdir -p "$(FREEBSD_PKG_STAGE_DIR)" "$(FREEBSD_PKG_WORK_DIR)" "$(FREEBSD_PKG_DIST_DIR)"; \
$(MAKE) stage DESTDIR="$(abspath $(FREEBSD_PKG_STAGE_DIR))" PREFIX="$(PREFIX)"; \
find "$(abspath $(FREEBSD_PKG_STAGE_DIR))$(PREFIX)" -type f | sed "s#^$(abspath $(FREEBSD_PKG_STAGE_DIR))$(PREFIX)/##" | sort > "$(FREEBSD_PKG_PLIST)"; \
{ \
printf 'name: "%s"\n' "$(APP_NAME)"; \
printf 'version: "%s"\n' "$(APP_VERSION)"; \
printf 'origin: "%s"\n' "$(APP_ORIGIN)"; \
printf 'comment: "%s"\n' "$(APP_COMMENT)"; \
printf 'desc: "%s"\n' "$(APP_DESC)"; \
printf 'maintainer: "%s"\n' "$(APP_MAINTAINER)"; \
printf 'www: "%s"\n' "$(APP_WWW)"; \
printf 'prefix: "%s"\n' "$(PREFIX)"; \
printf 'categories: [ '; \
first=1; \
for category in $$(printf '%s\n' "$(APP_CATEGORIES)" | tr ';' ' '); do \
if [ "$$first" -eq 0 ]; then printf ', '; fi; \
printf '"%s"' "$$category"; \
first=0; \
done; \
printf ' ]\n'; \
if [ -n "$(strip $(FREEBSD_PKG_ABI))" ]; then printf 'abi: "%s"\n' "$(FREEBSD_PKG_ABI)"; fi; \
if [ -n "$(strip $(APP_LICENSE))" ]; then printf 'licenselogic: "single"\nlicenses: [ "%s" ]\n' "$(APP_LICENSE)"; fi; \
printf 'deps: {\n'; \
for dep in $(FREEBSD_PKG_DEPS); do \
dep_name=$${dep%%:*}; \
dep_origin=$${dep#*:}; \
if [ "$$dep_origin" = "$$dep" ]; then dep_origin="ports/$$dep_name"; fi; \
printf ' "%s": { origin: "%s", version: "*" }\n' "$$dep_name" "$$dep_origin"; \
done; \
printf '}\n'; \
} > "$(FREEBSD_PKG_MANIFEST)"; \
rm -f "$(FREEBSD_PKG_FILE)"; \
pkg create -M "$(FREEBSD_PKG_MANIFEST)" -r "$(FREEBSD_PKG_STAGE_DIR)" -p "$(FREEBSD_PKG_PLIST)" -o "$(FREEBSD_PKG_DIST_DIR)"; \
created=$$(find "$(FREEBSD_PKG_DIST_DIR)" -maxdepth 1 -type f -name '$(APP_NAME)-$(APP_VERSION)*.pkg' | head -n 1); \
if [ -z "$$created" ]; then echo "pkg create did not produce a package"; exit 1; fi; \
if [ "$$created" != "$(FREEBSD_PKG_FILE)" ]; then mv "$$created" "$(FREEBSD_PKG_FILE)"; fi; \
echo "Created $(FREEBSD_PKG_FILE)"