osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/34158
)
Change subject: build: replace inkscape with rsvg-convert
......................................................................
build: replace inkscape with rsvg-convert
Do not require having the graphical application inkscape and all its
dependencies installed, just to convert svgs to pdfs. This is still the
default in dblatex, even though converting on the command-line with
inkscape is deprecated. Use the lightweight rsvg-convert instead.
Merge at the same time as the docker-playground patch.
Depends: docker-playground I012c61eb777e6dc267dd4a52500da98c01ac1438
Change-Id: I0d132f8f6fd73fbe14b5bfa10a8659acaddf38f7
---
M build/Makefile.asciidoc.inc
M build/Makefile.docbook.inc
A build/dblatex_config.xml
M check-depends.sh
M debian/control
5 files changed, 49 insertions(+), 6 deletions(-)
Approvals:
osmith: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index 75aa36f..7dd38d6 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -46,7 +46,12 @@
-a srcdir='$(ABS_SRCDIR)' \
-a commondir='$(COMMONDIR)' \
$(NULL)
-DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0
+DBLATEX_OPTS := \
+ --config $(OSMO_GSM_MANUALS_DIR)/build/dblatex_config.xml \
+ -s $(ASCIIDOCSTYLE) \
+ -P draft.mode=yes \
+ -P draft.watermark=0 \
+ $(NULL)
ifeq (,$(BUILD_RELEASE))
REVNUMBER := DRAFT $(GIT_VERSION)
diff --git a/build/Makefile.docbook.inc b/build/Makefile.docbook.inc
index df17646..6eb48d0 100644
--- a/build/Makefile.docbook.inc
+++ b/build/Makefile.docbook.inc
@@ -50,6 +50,11 @@
export REVNUMBER="$(REVNUMBER)" && \
export TEMPFILE="$(INC_DIR)/_temp_$(notdir $<)" && \
$(OSMO_GSM_MANUALS_DIR)/build/docbook-set-revhistory.py "$<" && \
- dblatex --xslt-opts="--path $(realpath
$(OSMO_GSM_MANUALS_DIR))/common/chapters:$(INC_DIR)" \
- $(dblatex_quiet) -P draft.mode=no -o $@ "$$TEMPFILE" && \
+ dblatex \
+ --config $(OSMO_GSM_MANUALS_DIR)/build/dblatex_config.xml \
+ --xslt-opts="--path $(realpath
$(OSMO_GSM_MANUALS_DIR))/common/chapters:$(INC_DIR)" \
+ $(dblatex_quiet) \
+ -P draft.mode=no \
+ -o $@ \
+ "$$TEMPFILE" && \
rm $$TEMPFILE
diff --git a/build/dblatex_config.xml b/build/dblatex_config.xml
new file mode 100644
index 0000000..bd89ea7
--- /dev/null
+++ b/build/dblatex_config.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" ?>
+<!--
+ ====================================================================
+ Replace inkscape by rsvg-convert to convert SVG graphics
+
https://sourceforge.net/p/dblatex/mailman/message/37005820/
+ ====================================================================
+-->
+<config
xmlns="http://dblatex.sourceforge.net/config">
+ <imagedata>
+ <converter src="svg" dst="*" docformat="pdf">
+ <command>
+ rsvg-convert -a -f %(dst)s -o %(output)s %(input)s
+ </command>
+ </converter>
+ </imagedata>
+</config>
diff --git a/check-depends.sh b/check-depends.sh
index f072fd8..46da717 100755
--- a/check-depends.sh
+++ b/check-depends.sh
@@ -15,6 +15,6 @@
check_dep_bin dblatex dblatex
check_dep_bin packetdiag3 python3-nwdiag
check_dep_bin dot graphviz
-check_dep_bin inkscape inkscape
+check_dep_bin rsvg-convert librsvg2-bin
echo "All dependencies installed!"
diff --git a/debian/control b/debian/control
index cdf990c..908ca99 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@
dblatex,
docbook5-xml,
graphviz,
- inkscape,
+ librsvg2-bin,
libxml2-utils,
mscgen,
python3-nwdiag,
@@ -28,7 +28,7 @@
dblatex,
docbook5-xml,
graphviz,
- inkscape,
+ librsvg2-bin,
libxml2-utils,
mscgen,
python3-nwdiag,
--
To view, visit
https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/34158
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Change-Id: I0d132f8f6fd73fbe14b5bfa10a8659acaddf38f7
Gerrit-Change-Number: 34158
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged