#!/usr/bin/make -f

%:
	dh $@

create-icons:
	# requires inkscape to be installed
	@if [ ! -x /usr/bin/inkscape ]; then \
		echo "ERROR: inkscape not installed!" ; \
		false ; \
	fi
	
	for f in aptosid-icon aptosid aptosid2; do \
		[ -r  $(CURDIR)/calamares/branding/aptosid/$${f}.svg ] || false ; \
		inkscape --export-type="png" \
			 --export-filename="$(CURDIR)/calamares/branding/aptosid/$${f}.png" \
			$(CURDIR)/calamares/branding/aptosid/$${f}.svg ; \
	done

	# slideshow mascots (fred), rasterised larger than their small native
	# size so they stay crisp when scaled in the QML slideshow.
	# streaked-fred and unstreaked-fred share a canvas and are layered in
	# show.qml (sharp fred over motion streaks), so export both at the same
	# height to keep them pixel-aligned.
	inkscape --export-type="png" --export-height=480 \
		--export-filename="$(CURDIR)/calamares/branding/aptosid/streaked-fred.png" \
		$(CURDIR)/calamares/branding/aptosid/streaked-fred.svg
	inkscape --export-type="png" --export-height=480 \
		--export-filename="$(CURDIR)/calamares/branding/aptosid/unstreaked-fred.png" \
		$(CURDIR)/calamares/branding/aptosid/unstreaked-fred.svg
	# fred world map (thanatos sddm background), shrunk for slideshow slide 3;
	# rendered larger than displayed so the tiled freds stay legible
	inkscape --export-type="png" --export-height=480 \
		--export-filename="$(CURDIR)/calamares/branding/aptosid/fred-world.png" \
		$(CURDIR)/calamares/branding/aptosid/fred-world.svg
	# big fred (close-up) lunging from the corner on the sign-off slide;
	# rendered near native size so it stays crisp when shown large
	inkscape --export-type="png" --export-height=640 \
		--export-filename="$(CURDIR)/calamares/branding/aptosid/big-fred.png" \
		$(CURDIR)/calamares/branding/aptosid/big-fred.svg
