chiark / gitweb /
Makefile: Tolerate inkscape flail
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Apr 2021 14:52:50 +0000 (15:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Apr 2021 14:53:38 +0000 (15:53 +0100)
Reported-by: Matthew Vernon <matthewv@chiark.greenend.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile

index 952089a9dd3475660130a5ce17dbe27159538bbb..fa09d22b8fb2ceb2b35e2d84846de3196fc9ec07 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,9 @@ SPHINXBUILD   = sphinx-build
 
 ifndef INKSCAPE_EXTENSIONS
 INKSCAPE ?= inkscape
-INKSCAPE_EXTENSIONS := $(shell $(INKSCAPE) -x)
+# inkscape 0.92.4: --extension-directory works, no --system-data-directory
+# inkscape 1.0.2: --system-data-directory, no --extension-directory
+INKSCAPE_EXTENSIONS := $(shell set -e; { sdd=$$( inkscape --system-data-directory ) && echo "$$sdd/extensions"; } || inkscape --extension-directory )
 endif
 RECOLOUR_SVG ?= $(INKSCAPE_EXTENSIONS)/color_replace.py