All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -perfbook 0/3] Updates of docker/ and Makefile
@ 2021-10-17  8:13 Akira Yokosawa
  2021-10-17  8:15 ` [PATCH -perfbook 1/3] docker: Add some fonts and commands Akira Yokosawa
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Akira Yokosawa @ 2021-10-17  8:13 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

Hi Paul,

This patch set consists of updates under docker/ and Makefile.

Patch 1/3 updates Dockerfiles under docker/.
It adds a couple of font packages in Dockerfile.fedora and
adds "gnuplot" and "time" commands in all three Dockerfiles.

Patch 2/3 shortens progress reports from "make".

    Old example: intro/PPGrelation.svg --> intro/PPGrelation.pdf
    New example: intro/PPGrelation.svg --> .pdf

Patch 3/3 switches the default "esp --> pdf" rules to those in
epstopdf-rule.mk.

To see the effect of patches 2/3 and 3/3, a "make neatfreak"
before "make" or "make -jN" is needed.

        Thanks, Akira
--
Akira Yokosawa (3):
  docker: Add some fonts and commands
  Makefile: Shorten progress report (dir/filename.src --> .dst)
  Makefile: Promote epstopdf-rule.mk as the default

 Makefile                 | 16 ++++++++--------
 a2ping-rule.mk           |  6 +++---
 docker/Dockerfile        |  8 +++++---
 docker/Dockerfile.bionic |  8 +++++---
 docker/Dockerfile.fedora | 11 ++++++++---
 epstopdf-rule.mk         |  6 +++---
 6 files changed, 32 insertions(+), 23 deletions(-)


base-commit: d28c5aa8c1dad57c76554743cc4e59a18d367303
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH -perfbook 1/3] docker: Add some fonts and commands
  2021-10-17  8:13 [PATCH -perfbook 0/3] Updates of docker/ and Makefile Akira Yokosawa
@ 2021-10-17  8:15 ` Akira Yokosawa
  2021-10-17  8:17 ` [PATCH -perfbook 2/3] Makefile: Shorten progress report (dir/filename.src --> .dst) Akira Yokosawa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Akira Yokosawa @ 2021-10-17  8:15 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

To cover recent changes in commit cb1e3178533d ("Update on-the-fly
font-substitution patterns for .eps and .svg files") and some of
existing .svg figures, Dockerfile.fedora needs a couple of
additional font packages.

Also add packages for "gnuplot" and "time" commands in all three
Dockerfiles.

Other change:

  o Use "if -- then -- fi" constructs so that redundant groupadd
    and useradd commands can be skipped when "uid == 0".

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 docker/Dockerfile        |  8 +++++---
 docker/Dockerfile.bionic |  8 +++++---
 docker/Dockerfile.fedora | 11 ++++++++---
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 7527e08b..3a3991bb 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -8,11 +8,10 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y t
     rm -rf /var/lib/apt/lists/*
 RUN apt-get update && apt-get install -y fig2ps inkscape xfig graphviz psutils \
     texlive-publishers texlive-pstricks texlive-science texlive-fonts-extra \
-    make nano vim git && \
+    make nano vim git curl gnuplot-nox time && \
     rm -rf /var/lib/apt/lists/*
 COPY steel-city-comic.regular.ttf /usr/local/share/fonts/
 RUN fc-cache /usr/local/share/fonts/
-RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
 WORKDIR /opt
 RUN curl https://gitlab.com/latexpand/latexpand/-/archive/v1.3/latexpand-v1.3.tar.gz -o - | tar xfz - && \
     sed -i -e 's/@LATEXPAND_VERSION@/v1.3/' latexpand-v1.3/latexpand && \
@@ -21,7 +20,10 @@ ARG uid=1000
 ARG gid=1000
 ARG user=perfbook
 ARG group=perfbook
-RUN groupadd -g $gid $group && useradd -u $uid -g $gid -m $user
+RUN if [ $uid -ne 0 ] ; then \
+    groupadd -g $gid $group ; \
+    useradd -u $uid -g $gid -m $user ; \
+    fi
 VOLUME /work
 USER $uid:$gid
 WORKDIR /work
diff --git a/docker/Dockerfile.bionic b/docker/Dockerfile.bionic
index 56e6280e..207feca7 100644
--- a/docker/Dockerfile.bionic
+++ b/docker/Dockerfile.bionic
@@ -8,11 +8,10 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y t
     rm -rf /var/lib/apt/lists/*
 RUN apt-get update && apt-get install -y fig2ps inkscape xfig graphviz psutils \
     texlive-publishers texlive-pstricks texlive-science texlive-fonts-extra \
-    make nano vim git && \
+    make nano vim git curl gnuplot-nox time && \
     rm -rf /var/lib/apt/lists/*
 COPY steel-city-comic.regular.ttf /usr/local/share/fonts/
 RUN fc-cache /usr/local/share/fonts/
-RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
 WORKDIR /opt
 RUN curl https://mirrors.ctan.org/macros/latex/contrib/cleveref.zip -L -O && unzip cleveref.zip && \
     curl https://mirrors.ctan.org/macros/latex/contrib/epigraph.zip -L -O && unzip epigraph.zip && \
@@ -33,7 +32,10 @@ ARG uid=1000
 ARG gid=1000
 ARG user=perfbook
 ARG group=perfbook
-RUN groupadd -g $gid $group && useradd -u $uid -g $gid -m $user
+RUN if [ $uid -ne 0 ] ; then \
+    groupadd -g $gid $group ; \
+    useradd -u $uid -g $gid -m $user ; \
+    fi
 VOLUME /work
 USER $uid:$gid
 WORKDIR /work
diff --git a/docker/Dockerfile.fedora b/docker/Dockerfile.fedora
index 33add84d..91633948 100644
--- a/docker/Dockerfile.fedora
+++ b/docker/Dockerfile.fedora
@@ -1,11 +1,13 @@
 FROM fedora:latest
 
 RUN dnf -y update && dnf install -y --setopt=tsflags=nodocs \
-    fig2ps graphviz inkscape make git vim nano \
+    fig2ps graphviz inkscape make git vim nano gnuplot-minimal groff time \
+    liberation-mono-fonts liberation-sans-fonts \
+    dejavu-sans-mono-fonts \
     texlive-collection-plaingeneric texlive-collection-binextra \
     texlive-collection-latexextra texlive-epstopdf texlive-fontools \
     texlive-newtx texlive-newtxtt texlive-nimbus15 texlive-courier-scaled \
-    texlive-inconsolata texlive-newtxsf texlive-mdsymbol && \
+    texlive-inconsolata texlive-newtxsf texlive-mdsymbol texlive-gnu-freefont && \
     dnf clean all && \
     mktexlsr
 COPY steel-city-comic.regular.ttf /usr/local/share/fonts/
@@ -18,7 +20,10 @@ ARG uid=1000
 ARG gid=1000
 ARG user=perfbook
 ARG group=perfbook
-RUN groupadd -g $gid $group && useradd -u $uid -g $gid -m $user
+RUN if [ $uid -ne 0 ] ; then \
+    groupadd -g $gid $group ; \
+    useradd -u $uid -g $gid -m $user ; \
+    fi
 VOLUME /work
 USER $uid:$gid
 WORKDIR /work
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH -perfbook 2/3] Makefile: Shorten progress report (dir/filename.src --> .dst)
  2021-10-17  8:13 [PATCH -perfbook 0/3] Updates of docker/ and Makefile Akira Yokosawa
  2021-10-17  8:15 ` [PATCH -perfbook 1/3] docker: Add some fonts and commands Akira Yokosawa
@ 2021-10-17  8:17 ` Akira Yokosawa
  2021-10-17  8:18 ` [PATCH -perfbook 3/3] Makefile: Promote epstopdf-rule.mk as the default Akira Yokosawa
  2021-10-17 18:27 ` [PATCH -perfbook 0/3] Updates of docker/ and Makefile Paul E. McKenney
  3 siblings, 0 replies; 5+ messages in thread
From: Akira Yokosawa @ 2021-10-17  8:17 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

For brevity, instead of displaying a long and redundant report:

    intro/PPGrelation.svg --> intro/PPGrelation.pdf

, display a shorter one:

    intro/PPGrelation.svg --> .pdf

Also, for easy distinction of enabled rule, add hints in recipes
of a2ping-rule.mk as follows:

    CodeSamples/count/atomic.eps --> .pdf (by a2ping)

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile         | 14 +++++++-------
 a2ping-rule.mk   |  6 +++---
 epstopdf-rule.mk |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index 3202ad6f..6083cda4 100644
--- a/Makefile
+++ b/Makefile
@@ -394,14 +394,14 @@ perfbook-a4.tex:
 # Rules related to perfbook_html are removed as of May, 2016
 
 $(EPSSOURCES_FROM_TEX): %.eps: %.tex
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 	sh utilities/mpostcheck.sh
 	@latex -output-directory=$(shell dirname $<) $< > /dev/null 2>&1
 	@dvips -Pdownload35 -E $(patsubst %.tex,%.dvi,$<) -o $@ > /dev/null 2>&1
 	@sh $(FIXANEPSFONTS) $@
 
 $(EPSSOURCES_FROM_DOT): %.eps: %.dot
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 ifndef DOT
 	$(error $< --> $@: dot not found. Please install graphviz)
 endif
@@ -409,7 +409,7 @@ endif
 	@sh $(FIXANEPSFONTS) $@
 
 $(EPSSOURCES_FROM_FIG): %.eps: %.fig
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 ifndef FIG2EPS
 	$(error $< --> $@: fig2eps not found. Please install fig2ps)
 endif
@@ -424,7 +424,7 @@ else
 endif
 
 $(PDFTARGETS_OF_SVG): %.pdf: %.svg
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 ifeq ($(STEELFONT),0)
 	$(error "Steel City Comic" font not found. See #1 in FAQ.txt)
 endif
@@ -463,17 +463,17 @@ CodeSamples/snippets.d: $(SOURCES_OF_SNIPPET) $(GEN_SNIPPET_D)
 	sh ./utilities/gen_snippet_d.sh
 
 $(FCVSNIPPETS):
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 	@utilities/fcvextract.pl $< $(subst +,\\+,$(subst @,:,$(basename $(notdir $@)))) > $@
 	@utilities/checkfcv.pl $@
 
 $(FCVSNIPPETS_VIA_LTMS):
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 	@utilities/fcvextract.pl $< $(subst +,\\+,$(subst @,:,$(basename $(notdir $@)))) > $@
 	@utilities/checkfcv.pl $@
 
 $(FCVSNIPPETS_LTMS):
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 	@utilities/reorder_ltms.pl $< > $@
 
 help-official:
diff --git a/a2ping-rule.mk b/a2ping-rule.mk
index c0e170f1..2a312560 100644
--- a/a2ping-rule.mk
+++ b/a2ping-rule.mk
@@ -30,7 +30,7 @@ ifdef A2PING
 endif
 
 $(PDFTARGETS_OF_GNUPLOT_NEEDFIXFONTS): %.pdf: %.eps
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@) (by a2ping)"
 ifndef A2PING
 	$(error $< --> $@: a2ping not found. Please install it)
 endif
@@ -43,7 +43,7 @@ endif
 	@rm -f $<i
 
 $(PDFTARGETS_OF_TEX): %.pdf: %.eps
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@) (by a2ping)"
 ifndef A2PING
 	$(error $< --> $@: a2ping not found. Please install it)
 endif
@@ -59,7 +59,7 @@ else
 endif
 
 $(PDFTARGETS_OF_EPSORIG_NOFIXFONTS) $(PDFTARGETS_OF_EPSOTHER): %.pdf: %.eps
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@) (by a2ping)"
 ifndef A2PING
 	$(error $< --> $@: a2ping not found. Please install it)
 endif
diff --git a/epstopdf-rule.mk b/epstopdf-rule.mk
index 1c3a2041..8e824fbe 100644
--- a/epstopdf-rule.mk
+++ b/epstopdf-rule.mk
@@ -9,7 +9,7 @@ GS_953_OR_LATER := $(shell gs --version | grep -c -E "9\.5[3-9].?")
 GS_OPT=--gsopt=-dPDFSETTINGS=/ebook
 
 $(PDFTARGETS_OF_GNUPLOT_NEEDFIXFONTS): %.pdf: %.eps
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 ifndef EPSTOPDF
 	$(error $< --> $@: epstopdf not found. Please install it)
 endif
@@ -19,7 +19,7 @@ endif
 	@rm -f $(basename $<)__.eps $(basename $<)___.eps
 
 $(PDFTARGETS_OF_TEX): %.pdf: %.eps
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 ifndef EPSTOPDF
 	$(error $< --> $@: epstopdf not found. Please install it)
 endif
@@ -33,7 +33,7 @@ endif
 	@rm -f $(basename $<)__.eps
 
 $(PDFTARGETS_OF_EPSORIG_NOFIXFONTS) $(PDFTARGETS_OF_EPSOTHER): %.pdf: %.eps
-	@echo "$< --> $@"
+	@echo "$< --> $(suffix $@)"
 ifndef EPSTOPDF
 	$(error $< --> $@: epstopdf not found. Please install it)
 endif
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH -perfbook 3/3] Makefile: Promote epstopdf-rule.mk as the default
  2021-10-17  8:13 [PATCH -perfbook 0/3] Updates of docker/ and Makefile Akira Yokosawa
  2021-10-17  8:15 ` [PATCH -perfbook 1/3] docker: Add some fonts and commands Akira Yokosawa
  2021-10-17  8:17 ` [PATCH -perfbook 2/3] Makefile: Shorten progress report (dir/filename.src --> .dst) Akira Yokosawa
@ 2021-10-17  8:18 ` Akira Yokosawa
  2021-10-17 18:27 ` [PATCH -perfbook 0/3] Updates of docker/ and Makefile Paul E. McKenney
  3 siblings, 0 replies; 5+ messages in thread
From: Akira Yokosawa @ 2021-10-17  8:18 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: perfbook, Akira Yokosawa

It turns out that recipes in epstopdf-rule.mk work reasonably well
and is quicker than those in a2ping-rule.mk on most build environments
tested so far.

So promote epstopdf-rule.mk as the default by inverting the conditional.

a2ping-rule.mk can still be enabled by setting a make variable
"USE_A2PING" as follows:

    make USE_A2PING=1

, when you need to compare the two sets of recipes.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 6083cda4..0702fdb7 100644
--- a/Makefile
+++ b/Makefile
@@ -417,7 +417,7 @@ endif
 	@sh $(FIXANEPSFONTS) $@
 
 # .eps --> .pdf rules
-ifndef NO_A2PING
+ifdef USE_A2PING
   include a2ping-rule.mk
 else
   include epstopdf-rule.mk
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -perfbook 0/3] Updates of docker/ and Makefile
  2021-10-17  8:13 [PATCH -perfbook 0/3] Updates of docker/ and Makefile Akira Yokosawa
                   ` (2 preceding siblings ...)
  2021-10-17  8:18 ` [PATCH -perfbook 3/3] Makefile: Promote epstopdf-rule.mk as the default Akira Yokosawa
@ 2021-10-17 18:27 ` Paul E. McKenney
  3 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2021-10-17 18:27 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: perfbook

On Sun, Oct 17, 2021 at 05:13:37PM +0900, Akira Yokosawa wrote:
> Hi Paul,
> 
> This patch set consists of updates under docker/ and Makefile.
> 
> Patch 1/3 updates Dockerfiles under docker/.
> It adds a couple of font packages in Dockerfile.fedora and
> adds "gnuplot" and "time" commands in all three Dockerfiles.
> 
> Patch 2/3 shortens progress reports from "make".
> 
>     Old example: intro/PPGrelation.svg --> intro/PPGrelation.pdf
>     New example: intro/PPGrelation.svg --> .pdf
> 
> Patch 3/3 switches the default "esp --> pdf" rules to those in
> epstopdf-rule.mk.
> 
> To see the effect of patches 2/3 and 3/3, a "make neatfreak"
> before "make" or "make -jN" is needed.

The shorter progress reports are nice!  Queued and pushed, thank you!

							Thanx, Paul

>         Thanks, Akira
> --
> Akira Yokosawa (3):
>   docker: Add some fonts and commands
>   Makefile: Shorten progress report (dir/filename.src --> .dst)
>   Makefile: Promote epstopdf-rule.mk as the default
> 
>  Makefile                 | 16 ++++++++--------
>  a2ping-rule.mk           |  6 +++---
>  docker/Dockerfile        |  8 +++++---
>  docker/Dockerfile.bionic |  8 +++++---
>  docker/Dockerfile.fedora | 11 ++++++++---
>  epstopdf-rule.mk         |  6 +++---
>  6 files changed, 32 insertions(+), 23 deletions(-)
> 
> 
> base-commit: d28c5aa8c1dad57c76554743cc4e59a18d367303
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-17 18:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17  8:13 [PATCH -perfbook 0/3] Updates of docker/ and Makefile Akira Yokosawa
2021-10-17  8:15 ` [PATCH -perfbook 1/3] docker: Add some fonts and commands Akira Yokosawa
2021-10-17  8:17 ` [PATCH -perfbook 2/3] Makefile: Shorten progress report (dir/filename.src --> .dst) Akira Yokosawa
2021-10-17  8:18 ` [PATCH -perfbook 3/3] Makefile: Promote epstopdf-rule.mk as the default Akira Yokosawa
2021-10-17 18:27 ` [PATCH -perfbook 0/3] Updates of docker/ and Makefile Paul E. McKenney

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.