#!/usr/bin/make -f
%:
	dh $@

# GLib applies the LARGEST-NUMBERED gschema override last, so it wins.
# slick-greeter ships its own override at priority 15; the dh_installgsettings
# default (10) let it beat ours for the greeter "background" key (proven on
# tabula 2026-09-07). 90 wins over slick-greeter's 15_ file.
override_dh_installgsettings:
	dh_installgsettings --priority=90

D = desktop
B = $(D)/build
# Everything derived is produced HERE, at build time, from the installed stock
# artefacts (spec 2026-09-07-desktop-theme-design.md sec. 2-4):
#   wallpapers + logo   <- rsvg-convert on the brand SVG copies
#   GTK 3/4 themes      <- libgtk gresource, recoloured (gtk-colormap.txt)
#   Cinnamon theme      <- cinnamon-common's theme, recoloured (cinnamon-colormap.txt)
override_dh_auto_build:
	rm -rf $(B); mkdir -p $(B)/backgrounds $(B)/logo
	for s in 1920x1080 2560x1440 3840x2160; do \
	  rsvg-convert -w $${s%x*} -h $${s#*x} $(D)/svg/scutarius-banner-solid-dark.svg -o $(B)/backgrounds/banner-dark-$$s.png; done
	rsvg-convert -w 2560 -h 1440 $(D)/svg/scutarius-banner-dark.svg -o $(B)/backgrounds/banner-outline-dark-2560x1440.png
	for s in 96 192; do \
	  rsvg-convert -w $$s -h $$s --stylesheet $(D)/logo-bone.css $(D)/svg/scutarius-mark-solid.svg -o $(B)/logo/scutarius-mark-$$s.png; done
	$(D)/build-gtk-theme.sh $(B)/themes/Scutarius
	$(D)/build-cinnamon-theme.sh $(B)/themes/Scutarius

override_dh_auto_clean:
	rm -rf $(B)
