From a3dc45e8d4898ca805636fc4ae66cbebb09102cb Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 4 Aug 2023 11:33:02 +0200 Subject: [PATCH] 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 --- build/Makefile.asciidoc.inc | 7 ++++++- build/Makefile.docbook.inc | 9 +++++++-- build/dblatex_config.xml | 16 ++++++++++++++++ check-depends.sh | 2 +- debian/control | 4 ++-- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 build/dblatex_config.xml 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 @@ + + + + + + + rsvg-convert -a -f %(dst)s -o %(output)s %(input)s + + + + 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,