diff options
author | Akira Yokosawa <akiyks@gmail.com> | 2024-01-05 18:52:00 +0900 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2024-01-07 13:36:29 -0800 |
commit | a40ad326ea2245439fc3464d167e64dbc05a6813 (patch) | |
tree | 29ef14dd0d519db61f810319250993a0f3b07b6b | |
parent | 12c5daa32b75b45ddb894a2f448296e9523dcaf2 (diff) | |
download | perfbook-a40ad326ea2245439fc3464d167e64dbc05a6813.tar.gz |
Makefile: Allow rsvg-convert 2.52
rsvg-convert 2.52.5 (on Ubuntu 22.04 LTS) output PDF 1.5 by default
and is good enough for perfbook.
Add rules for using it in SVG --> PDF conversion.
rsvg-convert versions >= 2.54 and < 2.57 default to PDF 1.7 and don't
have option of --format pdf1.5. Avoid using those interim versions
by default.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rw-r--r-- | Makefile | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -119,12 +119,24 @@ ifdef RSVG_CONVERT RSVG_CONVERT_VER := $(shell rsvg-convert --version | $(SED) -e 's/rsvg-convert version //') RSVG_CONVERT_VER_MINOR := $(shell echo $(RSVG_CONVERT_VER) | $(SED) -E -e 's/^([0-9]+\.[0-9]+).*/\1/') RSVG_CONVERT_GOOD_VER ?= 2.57 + RSVG_CONVERT_PDFFMT_VER := 2.57 + RSVG_CONVERT_ACCEPTABLE_VER := 2.52 RSVG_CONVERT_GOOD := $(shell echo $(RSVG_CONVERT_VER_MINOR) $(RSVG_CONVERT_GOOD_VER) | awk '{if ($$1 >= $$2) print 1;}') + RSVG_CONVERT_ACCEPTABLE := $(shell echo $(RSVG_CONVERT_VER_MINOR) $(RSVG_CONVERT_ACCEPTABLE_VER) | awk '{if ($$1 == $$2) print 1;}') + ifeq ($(RSVG_CONVERT_ACCEPTABLE),1) + RSVG_CONVERT_GOOD := 1 + endif + RSVG_CONVERT_PDFFMT := $(shell echo $(RSVG_CONVERT_VER_MINOR) $(RSVG_CONVERT_PDFFMT_VER) | awk '{if ($$1 >= $$2) print 1;}') ifeq ($(RSVG_CONVERT_GOOD),1) SVG_PDF_CONVERTER = (rsvg-convert v$(RSVG_CONVERT_VER)) else SVG_PDF_CONVERTER = (inkscape) endif + ifeq ($(RSVG_CONVERT_PDFFMT),1) + RSVG_FMT_OPT := --format=pdf1.5 + else + RSVG_FMT_OPT := --format=pdf + endif else SVG_PDF_CONVERTER = (inkscape) endif @@ -503,7 +515,7 @@ ifeq ($(RECOMMEND_LIBERATIONMONO),1) endif ifeq ($(RSVG_CONVERT_GOOD),1) - @cat $<i | rsvg-convert --format=pdf1.5 > $@ + @cat $<i | rsvg-convert $(RSVG_FMT_OPT) > $@ else ifeq ($(INKSCAPE_ONE),0) @inkscape --export-pdf=$@ $<i > /dev/null 2>&1 |