From: Matthew Newton Date: Sat, 2 Feb 2019 11:52:18 +0000 (+0000) Subject: Test for pandoc --latex-engine or --pdf-engine X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea205a339f04c9f74690d1e87b255b3bd287caef;p=thirdparty%2Ffreeradius-server.git Test for pandoc --latex-engine or --pdf-engine Thankfully they both work in exactly the same way. Fixes #2460 --- diff --git a/Makefile b/Makefile index 551cf5e382f..d03d2e8b1d0 100644 --- a/Makefile +++ b/Makefile @@ -345,6 +345,16 @@ ADOC_FILES += $(patsubst raddb/%.md,asciidoc/%.adoc,$(shell find raddb -name "*\ PDF_FILES := $(patsubst asciidoc/%.adoc,asciidoc/%.pdf,$(ADOC_FILES)) HTML_FILES := $(patsubst asciidoc/%.adoc,asciidoc/%.html,$(ADOC_FILES)) +# +# Pandoc v2 onwards renamed --latex-engine to --pdf-engine +# +PANDOC_ENGINE=pdf +ifneq ($(shell which pandoc),) +ifneq ($(shell pandoc --help | grep latex-engine),) +PANDOC_ENGINE=latex +endif +endif + # # Markdown files get converted to asciidoc via pandoc. # @@ -372,14 +382,14 @@ asciidoc/%.html: asciidoc/%.adoc asciidoc/%.pdf: asciidoc/%.adoc @echo PDF $^ @asciidoctor $< -b docbook5 -o - | \ - pandoc -f docbook -t latex --pdf-engine=xelatex \ + pandoc -f docbook -t latex --${PANDOC_ENGINE}-engine=xelatex \ -V papersize=letter \ -V images=yes \ --template=./scripts/asciidoc/freeradius.template -o $@ asciidoc/%.pdf: raddb/%.md @echo PDF $^ - pandoc -f markdown -t latex --pdf-engine=xelatex \ + pandoc -f markdown -t latex --${PANDOC_ENGINE}-engine=xelatex \ -V papersize=letter \ --template=./scripts/asciidoc/freeradius.template -o $@ $<