Re: [PATCH] wpa_gui: Fix build with Inkscape 1.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2020-05-05 at 19:59 +0200, Jan Tojnar wrote:
> Inkscape 1.0 revamped their CLI flags, breaking the icon build.
> 
> https://wiki.inkscape.org/wiki/index.php?title=Using_the_Command_Line#Background
> ---
>  wpa_supplicant/wpa_gui-qt4/icons/Makefile | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/wpa_supplicant/wpa_gui-qt4/icons/Makefile
> b/wpa_supplicant/wpa_gui-qt4/icons/Makefile
> index 709514c..cd3df9f 100644
> --- a/wpa_supplicant/wpa_gui-qt4/icons/Makefile
> +++ b/wpa_supplicant/wpa_gui-qt4/icons/Makefile
> @@ -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 (, $(shell command -v inkscape))
> +$(error "No inkscape in PATH, it is required for exporting icons.")
> +else
> +ifeq (0, $(shell inkscape --without-gui 1>&2 2> /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/

I checked the following:

 * I successfully built the gui with:
    * Inkscape 0.92.5 (2060ec1f9f, 2020-04-08)
    * Inkscape 1.0 (4035a4fb49, 2020-05-01)
 * Verified with diffoscope that there were only minor changes,
   mostly PNG headers or few bytes here and there.
 * Visually checked that the icons still look the same.
 * Confirmed the fact using Imagick’s compare:
   a=/nix/store/m2l2xsnh5g44g1nfszc742kq710s8ns6-wpa_gui-2.9
   b=/nix/store/k8srkmrkyi4g42bc97w4cgnyz9pzpiyl-wpa_gui-2.9
   for f in $(cd $a/share/icons/; fd png); do
       echo Comparing $f
       compare -compose src $a/share/icons/$f $b/share/icons/$f /tmp/diffimg
       display /tmp/diffimg
   done


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux