[bootlin/training-materials updates] master: Makefile: support Inkscape 1.0 (a47e1f87)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Feb 18 20:05:07 CET 2020


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/a47e1f87c201ac6562d139e63ae8590fbc5fd76c

>---------------------------------------------------------------

commit a47e1f87c201ac6562d139e63ae8590fbc5fd76c
Author: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date:   Tue Feb 18 20:05:07 2020 +0100

    Makefile: support Inkscape 1.0
    
    Inkscape 1.0 unfortunately changed the option used to generate a PDF,
    so we have to take that into account, and still support older Inkcape
    releases.
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>


>---------------------------------------------------------------

a47e1f87c201ac6562d139e63ae8590fbc5fd76c
 Makefile | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 168419cf..4770f65e 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,14 @@ PDFLATEX = xelatex
 DIA      = dia
 EPSTOPDF = epstopdf
 
+INKSCAPE_IS_NEW = $(shell inkscape --version | grep -q "^Inkscape 1.0" && echo YES)
+
+ifeq ($(INKSCAPE_IS_NEW),YES)
+INKSCAPE_PDF_OPT = -o
+else
+INKSCAPE_PDF_OPT = -A
+endif
+
 # Needed macros
 UPPERCASE = $(shell echo $1 | tr "[:lower:]" "[:upper:]")
 
@@ -239,9 +247,9 @@ $(OUTDIR)/%.pdf: %.svg
 	@printf "%-15s%-20s->%20s\n" INKSCAPE $(notdir $^) $(notdir $@)
 	@mkdir -p $(dir $@)
 ifeq ($(V),)
-	$(INKSCAPE) -D -A $@ $< > /dev/null 2>&1
+	$(INKSCAPE) -D $(INKSCAPE_PDF_OPT) $@ $< > /dev/null 2>&1
 else
-	$(INKSCAPE) -D -A $@ $<
+	$(INKSCAPE) -D $(INKSCAPE_PDF_OPT) $@ $<
 endif
 
 $(OUTDIR)/%.pdf: $(OUTDIR)/%.eps




More information about the training-materials-updates mailing list