Skip to contentSkip to conversation

Makefile: Add command line for Inkscape 1.0

PATCH Applied Akira Yokosawa 2 participants 2 messages Feb 1, 2020 – Feb 3, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Add command line for Inkscape 1.0

From d29a7d4775aa9e8b148f17ea66d94b5ce661a00f Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Sat, 1 Feb 2020 22:19:52 +0900
Subject: [PATCH] Makefile: Add command line for Inkscape 1.0

Inkscape 1.0 (now in beta) has changed command-line options [1]. The option "--export-pdf" is no longer available in 1.0. Add a conditional command line with the right option of "--export-file".

Tested with inkscape-1.0-0.beta.fc31.4.x86_64.rpm on Fedora 31.

[1]: https://wiki.inkscape.org/wiki/index.php?title=Using_the_Command_Line#Deprecations_and_Replacements

---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)
Makefile +7 -0
index d39ab571..c1a51bae 100644
@@ -63,6 +63,9 @@ DOT := $(shell which dot 2>/dev/null)
 FIG2EPS := $(shell which fig2eps 2>/dev/null)
 A2PING := $(shell which a2ping 2>/dev/null)
 INKSCAPE := $(shell which inkscape 2>/dev/null)
+ifdef INKSCAPE
+  INKSCAPE_ONE := $(shell inkscape --version | grep -c "Inkscape 1")
+endif
 LATEXPAND := $(shell which latexpand 2>/dev/null)
 QPDF := $(shell which qpdf 2>/dev/null)
 
@@ -359,7 +362,11 @@ endif
 ifeq ($(NEEDMDSYMBOL),1)
 	$(error Font package 'mdsymbol' not found. See #9 in FAQ-BUILD.txt)
 endif
+ifeq ($(INKSCAPE_ONE),0)
 	@inkscape --export-pdf=$@ $<i > /dev/null 2>&1
+else
+	@inkscape --export-file=$@ $<i > /dev/null 2>&1
+endif
 	@rm -f $<i
 ifeq ($(chkpagegroup),on)
 ifndef QPDF
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · Akira Yokosawa
Quoted 1 line

From d29a7d4775aa9e8b148f17ea66d94b5ce661a00f Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Sat, 1 Feb 2020 22:19:52 +0900
Subject: [PATCH] Makefile: Add command line for Inkscape 1.0

Inkscape 1.0 (now in beta) has changed command-line options [1]. The option "--export-pdf" is no longer available in 1.0. Add a conditional command line with the right option of "--export-file".

Quoted 5 lines

Tested with inkscape-1.0-0.beta.fc31.4.x86_64.rpm on Fedora 31.

[1]: https://wiki.inkscape.org/wiki/index.php?title=Using_the_Command_Line#Deprecations_and_Replacements

I applied all three, thank you!

This patch causes make to output the following near the beginning:

Gtk-Message: 19:27:52.530: Failed to load module "canberra-gtk-module"

Ah, that is just "inkscape --version" complaining. I can suppress this complaint as shown below, but that seems inappropriate. A quick web search located this:

https://askubuntu.com/questions/342202/failed-to-load-module-canberra-gtk-module-but-already-installed

Which recommends this:

sudo apt install libcanberra-gtk-module libcanberra-gtk3-module

Which cleared things up for me even without the hack below. So all good!

Thanx, Paul

------------------------------------------------------------------------

Makefile +1 -1
index c1a51ba..b5f0224 100644
@@ -64,7 +64,7 @@ FIG2EPS := $(shell which fig2eps 2>/dev/null)
 A2PING := $(shell which a2ping 2>/dev/null)
 INKSCAPE := $(shell which inkscape 2>/dev/null)
 ifdef INKSCAPE
-  INKSCAPE_ONE := $(shell inkscape --version | grep -c "Inkscape 1")
+  INKSCAPE_ONE := $(shell inkscape --version 2> /dev/null | grep -c "Inkscape 1")
 endif
 LATEXPAND := $(shell which latexpand 2>/dev/null)
 QPDF := $(shell which qpdf 2>/dev/null)