aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2023-08-04 11:33:02 +0200
committerOliver Smith <osmith@sysmocom.de>2023-08-04 13:09:19 +0200
commitc67b8969ed9fa3f8117496b83a02aeeb8c5816a9 (patch)
treeb9d0c466d58d94a88054924db0e2d3ff4912d195
parentcc71aeb2e772e91ed93fcecc600f812d8dfa6669 (diff)
build: replace inkscape with rsvg-convertosmith/wip-no-inkscape
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. Change-Id: I0d132f8f6fd73fbe14b5bfa10a8659acaddf38f7
-rw-r--r--build/Makefile.asciidoc.inc7
-rw-r--r--build/Makefile.docbook.inc9
-rw-r--r--build/dblatex_config.xml16
-rwxr-xr-xcheck-depends.sh2
-rw-r--r--debian/control4
5 files changed, 32 insertions, 6 deletions
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 @@ ASCIIDOC_OPTS := \
-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 @@ endif
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 asciidoc asciidoc
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 @@ Build-Depends: autotools-dev,
dblatex,
docbook5-xml,
graphviz,
- inkscape,
+ librsvg2-bin,
libxml2-utils,
mscgen,
python3-nwdiag,
@@ -28,7 +28,7 @@ Depends: ${misc:Depends},
dblatex,
docbook5-xml,
graphviz,
- inkscape,
+ librsvg2-bin,
libxml2-utils,
mscgen,
python3-nwdiag,