svg.mk: Unset DISPLAY in inkscape invocation

It appears that inkscape, if invoked from the command line, fires up a splash
screen if it has enough time to do so. This leads to strange flickering during
the build process. Unset DISPLAY in the attempt to keep that from happening.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-05-11 10:58:31 +00:00
commit bf94282ab5

View file

@ -1,7 +1,7 @@
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 = $(shell export -n DISPLAY; 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
@ -44,11 +44,11 @@ clean.images:
$(RM) -f $(GENERATED_IMAGES) $(COPIED_SVG)
%.png: $(COPIED_SVG)
inkscape -w $(shell echo $* | sed 's/.*-//') \
export -n DISPLAY; inkscape -w $(shell echo $* | sed 's/.*-//') \
$(INKSCAPE_EXPORT_PNG)=$@ copied-$(shell echo $* | sed 's/-[0-9]\+$$//').svg
%.pdf: copied-%.svg
inkscape --export-filename="$@" $<
export -n DISPLAY; inkscape --export-filename="$@" $<
copied-%.svg: $(SVG)
@echo $^