1 |
commit: 6bff1eb8b62b9d07e1cc1098eb617f9302487907 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 10 03:10:18 2019 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 27 19:57:02 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=6bff1eb8 |
7 |
|
8 |
Makefile: use rsvg-convert to generate PNGs from SVGs. |
9 |
|
10 |
Our Makefile currently uses inkscape (via imagemagick's "convert" |
11 |
wrapper) to turn SVGs into PNGs. This has a few downsides: |
12 |
|
13 |
* media-gfx/inkscape is a huge dependency, |
14 |
* inkscape is slow to perform the conversion, |
15 |
* installing imagemagick[svg] doesn't ensure that "convert" can |
16 |
convert an SVG to a PNG if inkscape is missing (bug 684686). |
17 |
|
18 |
The good news is that there is another SVG -> PNG conversion tool |
19 |
called rsvg-convert that is installed by gnome-base/librsvg. Compared |
20 |
to inkscape, librsvg is a light dependency and rsvg-convert is |
21 |
lightning-fast. Moreover, installing gnome-base/librsvg guarantees |
22 |
that the latter will exist and can actually perform the conversion. |
23 |
|
24 |
Inkscape is supposedly more powerful, but so far in the devmanual |
25 |
we're only using SVG to put words in boxes. The simpler tool is |
26 |
sufficient for that, and therefore preferable. |
27 |
|
28 |
This commit updates the Makefile to use rsvg-convert. |
29 |
|
30 |
Bug: https://bugs.gentoo.org/684686 |
31 |
Closes: https://bugs.gentoo.org/700904 |
32 |
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org> |
33 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
34 |
|
35 |
Makefile | 6 +++--- |
36 |
1 file changed, 3 insertions(+), 3 deletions(-) |
37 |
|
38 |
diff --git a/Makefile b/Makefile |
39 |
index 9cccb38..e7131ed 100644 |
40 |
--- a/Makefile |
41 |
+++ b/Makefile |
42 |
@@ -10,8 +10,8 @@ IMAGES := $(patsubst %.svg,%.png,$(SVGS)) |
43 |
all: prereq validate $(HTMLS) $(IMAGES) documents.js |
44 |
|
45 |
prereq: |
46 |
- @type convert >/dev/null 2>&1 || \ |
47 |
- { echo "media-gfx/imagemagick[corefonts,svg,truetype] required" >&2;\ |
48 |
+ @type rsvg-convert >/dev/null 2>&1 || \ |
49 |
+ { echo "gnome-base/librsvg required" >&2;\ |
50 |
exit 1; } |
51 |
@type xsltproc >/dev/null 2>&1 || \ |
52 |
{ echo "dev-libs/libxslt is with python required" >&2;\ |
53 |
@@ -32,7 +32,7 @@ documents.js: bin/build_search_documents.py $(XMLS) |
54 |
mv _documents.js documents.js |
55 |
|
56 |
%.png : %.svg |
57 |
- convert $< $@ |
58 |
+ rsvg-convert --output=$@ $< |
59 |
|
60 |
# Secondary expansion allows us to use the automatic variable $@ in |
61 |
# the prerequisites. When it is used (and we have no idea when that |