From 4c6f9918d4e3134543c077fc72d11adc2612f5cd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 9 Dec 2019 22:10:18 -0500 Subject: [PATCH 3/3] Makefile: use rsvg-convert to generate PNGs from SVGs. Our Makefile currently uses inkscape (via imagemagick's "convert" wrapper) to turn SVGs into PNGs. This has a few downsides: * media-gfx/inkscape is a huge dependency, * inkscape is slow to perform the conversion, * installing imagemagick[svg] doesn't ensure that "convert" can convert an SVG to a PNG if inkscape is missing (bug 684686). The good news is that there is another SVG -> PNG conversion tool called rsvg-convert that is installed by gnome-base/librsvg. Compared to inkscape, librsvg is a light dependency and rsvg-convert is lightning-fast. Moreover, installing gnome-base/librsvg guarantees that the latter will exist and can actually perform the conversion. Inkscape is supposedly more powerful, but so far in the devmanual we're only using SVG to put words in boxes. The simpler tool is sufficient for that, and therefore preferable. This commit updates the Makefile to use rsvg-convert. Bug: https://bugs.gentoo.org/684686 Closes: https://bugs.gentoo.org/700904 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9fa7a54..0dd5050 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ IMAGES := $(patsubst %.svg,%.png,$(SVGS)) all: prereq validate $(HTMLS) $(IMAGES) documents.js prereq: - @type convert >/dev/null 2>&1 || \ - { echo "media-gfx/imagemagick[corefonts,svg,truetype] required" >&2;\ + @type rsvg-convert >/dev/null 2>&1 || \ + { echo "gnome-base/librsvg required" >&2;\ exit 1; } @type xsltproc >/dev/null 2>&1 || \ { echo "dev-libs/libxslt is with python required" >&2;\ @@ -32,7 +32,7 @@ documents.js: bin/build_search_documents.py $(XMLS) mv _documents.js documents.js %.png : %.svg - convert $< $@ + rsvg-convert --output=$@ $< # Secondary expansion allows us to use the automatic variable $@ in # the prerequisites. When it is used (and we have no idea when that -- 2.24.1