diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2019-12-09 22:10:18 -0500 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2020-01-27 20:57:02 +0100 |
commit | 6bff1eb8b62b9d07e1cc1098eb617f9302487907 (patch) | |
tree | 49404fb42a1c6a07a5669b02ad2ca36de8052215 /Makefile | |
parent | Makefile: add prereq check for the Open Sans font. (diff) | |
download | devmanual-6bff1eb8b62b9d07e1cc1098eb617f9302487907.tar.gz devmanual-6bff1eb8b62b9d07e1cc1098eb617f9302487907.tar.bz2 devmanual-6bff1eb8b62b9d07e1cc1098eb617f9302487907.zip |
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
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |