All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@linux.ibm.com>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH 3/8] Makefile: Add check of font package availability
Date: Sun, 24 Feb 2019 09:05:51 +0900	[thread overview]
Message-ID: <64c78cdc-abf9-bc50-2c17-e910069a1f2e@gmail.com> (raw)
In-Reply-To: <3c30eb79-c675-2686-e2a1-1d0db5469178@gmail.com>

From 81b62c1185e0e9439bf201bca5921742f786efca Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 22 Feb 2019 20:59:22 +0900
Subject: [PATCH 3/8] Makefile: Add check of font package availability

Add existence check of relatively recent font packages required for
experimental targets.

Those targets used to just print info on required font, and to run
"pdflatex".  Now "make" aborts with a message indicating where to
see if any of required font packages is missing.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 89abea2..338669a 100644
--- a/Makefile
+++ b/Makefile
@@ -58,14 +58,30 @@ PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_
 
 BIBSOURCES := bib/*.bib alphapf.bst
 
+# required commands
 DOT := $(shell which dot 2>/dev/null)
 FIG2EPS := $(shell which fig2eps 2>/dev/null)
 A2PING := $(shell which a2ping 2>/dev/null)
 INKSCAPE := $(shell which inkscape 2>/dev/null)
 LATEXPAND := $(shell which latexpand 2>/dev/null)
+
+# required fonts
 STEELFONT := $(shell fc-list | grep -c -i steel)
 URWPS := $(shell fc-list | grep "Nimbus Mono PS" | wc -l)
 
+# required font packages
+FONTPACKAGES := $(shell kpsewhich nimbusmono.sty newtxtt.sty newtxsf.sty inconsolata.sty)
+NIMBUSMONO := $(findstring nimbusmono,$(FONTPACKAGES))
+NEWTXTT := $(findstring newtxtt,$(FONTPACKAGES))
+NEWTXSF := $(findstring newtxsf,$(FONTPACKAGES))
+INCONSOLATA := $(findstring inconsolata,$(FONTPACKAGES))
+
+# for line break in error text
+define n
+
+
+endef
+
 ifeq ($(URWPS),0)
 FIXSVGFONTS   = utilities/fixsvgfonts.sh
 FIXANEPSFONTS = utilities/fixanepsfonts.sh
@@ -168,27 +184,43 @@ perfbook-mstx.tex: perfbook.tex
 	sed -e 's/%msfontstub/\\renewcommand*\\ttdefault{txtt}/' < $< > $@
 
 perfbook-msr.tex: perfbook.tex
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/%msfontstub/\\usepackage[scaled=.94]{nimbusmono}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
-	@echo "## This target requires font package nimbus15. ##"
 
 perfbook-msn.tex: perfbook.tex
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/\\renewcommand\*\\ttdefault{lmtt}//' \
 	    -e 's/{lmttforcode}{true}/{lmttforcode}{false}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
-	@echo "## This target requires font package nimbus15. ##"
 
 perfbook-msnt.tex: perfbook.tex
+ifeq ($(NEWTXTT),)
+	$(error Font package 'newtxtt' not found.$nInstall it or try 'make mstx' instead. See #9 in FAQ-BUILD.txt)
+endif
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/%msfontstub/\\usepackage[zerostyle=a]{newtxtt}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' < $< > $@
-	@echo "## This target requires font packages newtxtt and nimbus15. ##"
-	@echo "## If build fails, try target 'mstx' instead.               ##"
 
 perfbook-1csf.tex: perfbook-1c.tex
+ifeq ($(NEWTXSF),)
+	$(error Font package 'newtxsf' not found. See #9 in FAQ-BUILD.txt)
+endif
+ifeq ($(INCONSOLATA),)
+	$(error Font package 'inconsolata' not found. See #9 in FAQ-BUILD.txt)
+endif
+ifeq ($(NIMBUSMONO),)
+	$(error Font package 'nimbus15' not found. See #9 in FAQ-BUILD.txt)
+endif
 	sed -e 's/setboolean{sansserif}{false}/setboolean{sansserif}{true}/' \
 	    -e 's/{nimbusavail}{false}/{nimbusavail}{true}/' \
 	    -e 's/%msfontstub/\\usepackage[var0]{inconsolata}[2013\/07\/17]/' < $< > $@
-	@echo "## This target requires math font packages newtxsf and nimbus15. ##"
 
 # Rules related to perfbook_html are removed as of May, 2016
 
-- 
2.7.4



  parent reply	other threads:[~2019-02-24  0:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-23 23:59 [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Akira Yokosawa
2019-02-24  0:00 ` [PATCH 1/8] defer/rcuapi: Force break between two API in Table 9.3 Akira Yokosawa
2019-02-24  0:01 ` [PATCH 2/8] Makefile: Fix recipe of target 'perfbook-msn.pdf' Akira Yokosawa
2019-02-24  0:05 ` Akira Yokosawa [this message]
2019-02-24  0:09 ` [PATCH 4/8] Specify PDF minor version 1.7 Akira Yokosawa
2019-02-24  0:11 ` [PATCH 5/8] Suppress warning from pdfTeX on figures transformed by Inkscape Akira Yokosawa
2019-02-24  0:14 ` [PATCH 6/8] Makefile: Add optional recipe to detect conflict in page group object Akira Yokosawa
2019-02-24  0:16 ` [PATCH 7/8] Makefile: Don't remove .fcv and .ltms files in target 'clean' Akira Yokosawa
2019-02-24  0:17 ` [PATCH 8/8] Widen tabsize of code snippets for 1c layout Akira Yokosawa
2019-02-25 16:56 ` [PATCH 0/8] Regression fixes & improvements in build scripts/preamble Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64c78cdc-abf9-bc50-2c17-e910069a1f2e@gmail.com \
    --to=akiyks@gmail.com \
    --cc=paulmck@linux.ibm.com \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.