svg.mk: Fix inkscape command line API change on --export-png

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2020-08-29 14:01:42 +00:00
commit 6846acbdf7

View file

@ -1,6 +1,13 @@
SVG_GENERATE_FORMATS ?= png svg
SVG ?= $(filter-out copied-%,$(wildcard *.svg))
COPIED_SVG = $(addprefix copied-,$(notdir $(SVG)))
INKSCAPE_VERSION = $(shell inkscape -V 2>&1 | sed '/Inkscape/ !d; s/Inkscape *\([0-9.]\+\) .*/\1/')
INKSCAPE_VERSION_MAJOR = $(word 1,$(subst ., ,$(INKSCAPE_VERSION)))
ifeq ($(INKSCAPE_VERSION_MAJOR),1)
INKSCAPE_EXPORT_PNG = --export-filename
else
INKSCAPE_EXPORT_PNG = --export-png
endif
GENERATED_ICON_WIDTHS += 16 32 48 64 72 96 128 144 168 192
GENERATED_WIDTHS ?= $(GENERATED_ICON_WIDTHS) $(GENERATED_EXTRA_WIDTHS)
@ -38,7 +45,7 @@ clean.images:
%.png: $(COPIED_SVG)
inkscape -w $(shell echo $* | sed 's/.*-//') \
--export-png=$@ copied-$(shell echo $* | sed 's/-[0-9]\+$$//').svg
$(INKSCAPE_EXPORT_PNG)=$@ copied-$(shell echo $* | sed 's/-[0-9]\+$$//').svg
%.pdf: copied-%.svg
inkscape --export-pdf=$@ $<