]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_gui: Fix build with Inkscape 1.0
authorJan Tojnar <jtojnar@gmail.com>
Wed, 6 May 2020 22:29:53 +0000 (00:29 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 May 2020 13:13:33 +0000 (16:13 +0300)
Inkscape 1.0 revamped their CLI flags, breaking the icon build.

https://wiki.inkscape.org/wiki/index.php?title=Using_the_Command_Line#Background

Signed-off-by: Jan Tojnar <jtojnar@gmail.com>
wpa_supplicant/wpa_gui-qt4/icons/Makefile

index 709514c127467b784965b9d6a51de263dd96ec33..88efc3c5b258f8c0c2482fb23bc136400a5fa797 100644 (file)
@@ -5,14 +5,28 @@ SIZES := 16x16 22x22 32x32 48x48 64x64 128x128
 ICONS := $(addsuffix .png, $(foreach name, $(NAMES), $(foreach size, $(SIZES), $(size)/$(name))))
 ICONS += $(addsuffix .xpm, $(NAMES))
 
+ifeq (1, $(shell which inkscape; echo $$?))
+$(error "No inkscape in PATH, it is required for exporting icons.")
+else
+ifeq (0, $(shell inkscape --without-gui 2>&1 > /dev/null; echo $$?))
+# Inkscape < 1.0
+INKSCAPE_GUI_FLAG := --without-gui
+INKSCAPE_OUTPUT_FLAG := --export-png
+else
+# Inkscape >= 1.0
+INKSCAPE_GUI_FLAG :=
+INKSCAPE_OUTPUT_FLAG := --export-filename
+endif
+endif
+
 all: $(ICONS)
 
 %.png:
        mkdir -p hicolor/$(word 1, $(subst /, ,$(@)))/apps/
-       inkscape $(subst .png,.svg, $(word 2, $(subst /, , $(@)))) --without-gui \
+       inkscape $(subst .png,.svg, $(word 2, $(subst /, , $(@)))) $(INKSCAPE_GUI_FLAG) \
                --export-width=$(word 1, $(subst x, , $(@)))  \
                --export-height=$(word 2, $(subst x, , $(subst /, , $(@)))) \
-               --export-png=hicolor/$(word 1, $(subst /, ,$(@)))/apps/$(word 2, $(subst /, , $@))
+               $(INKSCAPE_OUTPUT_FLAG)=hicolor/$(word 1, $(subst /, ,$(@)))/apps/$(word 2, $(subst /, , $@))
 
 %.xpm:
        mkdir -p pixmaps/