All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
@ 2021-01-03 11:23 Akira Yokosawa
  2021-01-03 14:47 ` Felipe Balbi
  2021-01-03 23:38 ` [PATCH v2 " Akira Yokosawa
  0 siblings, 2 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-01-03 11:23 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Дмитрий Дьяченко,
	Felipe Balbi, perfbook, Akira Yokosawa

From f04ab9441df5256aa9df73bb4fa005b43517f2f2 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 3 Jan 2021 19:15:25 +0900
Subject: [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Combination of GhostScript 9.53.x and pstricks-base 3.01 requires
an additional option of "gs" to enable transparency.

Current version of a2ping can not cope with this change.

Instead, use the pair of commands "ps2pdf" and "pdfcrop" for .eps
files originated from .tex sources.

Reported-by: Дмитрий Дьяченко <dimhen@gmail.com>
Reported-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Hi all,

My previous comment on the build error reported by Dmitry and Felipe
was not accurate.

pstricks-base 3.01 did what the update announcement said and is
compatible with GhostScript 9.53.x or later by adding prologue code
to enable transparency support when gs version is larger than 9.52.

Due to the behavior change, for "gs" to accept eps files generated from
pstricks-base 3.01, it (9.53.0 or later) needs an additional option
-dALLOWPSTRANSPARENCY.

Current version of a2ping doesn't know of this change and it invokes
"gs" without the option. This is the root cause of the build error.
I tried a2ping's "--gsextra=" option to add it, but couldn't resovle
the error.

Instead of a2ping, the pair of ps2pdf and pdfcrop can do the same
auto cropping of PDF figures.  ps2pdf is distributed among GhostScript
releases and if you have gs 9.53.x, you should also have a compatible ps2pdf.

This patch fixes the build error by detecting GhostScript 9.53.0 or
later (up to 9.59.x for the moment) and switching the command to use.

Minor nit:

I tried to test this patch on Ubuntu 18.04 with up-to-date TeX Live
and manually installed GhostScript 9.53.3.
However, I couldn't setup font info properly for it to work with the
font replacement (Adobe -> Nimbus) scripts enabled.

On Fedora 33 and CentOS 8, this patch works just fine.

For those who stick with distro versions of TeX Live and GhostScript,
this patch should have no effect until those packages are upgraded.

        Thanks, Akira

PS. (especially to Paul)

This mail is sent in UTF-8 encoding due to Dmitry's name in Reported-by.
I don't think it would break this message in git-am incompatible way,
but if it does, please let me know.
--
 Makefile | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 56ce62bf..bf2e89ba 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,8 @@ EPSSOURCES_FROM_TEX := \
 	SMPdesign/DiningPhilosopher4part-b.eps \
 	SMPdesign/DiningPhilosopher5PEM.eps
 
+PDFTARGETS_OF_TEX := $(EPSSOURCES_FROM_TEX:%.eps=%.pdf)
+
 DOTSOURCES := $(wildcard */*.dot)
 
 EPSSOURCES_FROM_DOT := $(DOTSOURCES:%.dot=%.eps)
@@ -70,7 +72,7 @@ EPSORIGIN := $(filter-out $(EPSSOURCES_FROM_TEX) $(EPSSOURCES_FROM_DOT) $(EPSSOU
 
 PDFTARGETS_OF_EPSORIG := $(EPSORIGIN:%.eps=%.pdf)
 
-PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_EPS))
+PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG) $(PDFTARGETS_OF_TEX),$(PDFTARGETS_OF_EPS))
 
 BIBSOURCES := bib/*.bib alphapf.bst
 
@@ -124,19 +126,23 @@ ifdef A2PING
   GS_950_OR_LATER := $(shell gs --version | grep -c -E "9\.[5-9].?")
   A2PING_277P := $(shell a2ping --help 2>&1 | grep -c "2.77p,")
   A2PING_283P := $(shell a2ping --help 2>&1 | grep -c "2.83p,")
+  GS_953_OR_LATER := $(shell gs --version | grep -c -E "9\.5[3-9].?")
   ifeq ($(A2PING_277P),1)
-    A2PING_GSCNFL := 1
+    A2PING_GSCNFL = 1
   else
     ifeq ($(A2PING_283P),1)
       ifeq ($(GS_950_OR_LATER),1)
-        A2PING_GSCNFL := 1
+        A2PING_GSCNFL = 1
       else
-        A2PING_GSCNFL := 0
+        A2PING_GSCNFL = 0
       endif
     else
-      A2PING_GSCNFL := 0
+      A2PING_GSCNFL = 0
     endif
   endif
+  ifeq ($(GS_953_OR_LATER),1)
+    A2PING_GSCNFL = 2
+  endif
 endif
 
 LINELABEL_ENV_BEGIN := $(shell grep -l -F '\begin{linelabel}' $(LATEXSOURCES))
@@ -395,6 +401,20 @@ endif
 	@a2ping --below --hires --bboxfrom=compute-gs $<i $@ > /dev/null 2>&1
 	@rm -f $<i
 
+$(PDFTARGETS_OF_TEX): %.pdf: %.eps
+	@echo "$< --> $@"
+ifndef A2PING
+	$(error $< --> $@: a2ping not found. Please install it)
+endif
+ifeq ($(A2PING_GSCNFL),1)
+	$(error a2ping version conflict. See #7 in FAQ-BUILD.txt)
+endif
+ifeq ($(A2PING_GSCNFL),2)
+	@ps2pdf -dALLOWPSTRANSPARENCY -dNOSAFER $< - | pdfcrop -hires - $@  > /dev/null 2>&1
+else
+	@a2ping --below --hires --bboxfrom=compute-gs $< $@ > /dev/null 2>&1
+endif
+
 $(PDFTARGETS_OF_EPSOTHER): %.pdf: %.eps
 	@echo "$< --> $@"
 ifndef A2PING
-- 
2.17.1



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

* Re: [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
  2021-01-03 11:23 [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later Akira Yokosawa
@ 2021-01-03 14:47 ` Felipe Balbi
  2021-01-03 15:13   ` Akira Yokosawa
  2021-01-03 23:38 ` [PATCH v2 " Akira Yokosawa
  1 sibling, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2021-01-03 14:47 UTC (permalink / raw)
  To: Akira Yokosawa, Paul E. McKenney
  Cc: Дмитрий Дьяченко,
	perfbook, Akira Yokosawa


Hi,

Akira Yokosawa <akiyks@gmail.com> writes:

> From f04ab9441df5256aa9df73bb4fa005b43517f2f2 Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Sun, 3 Jan 2021 19:15:25 +0900
> Subject: [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Combination of GhostScript 9.53.x and pstricks-base 3.01 requires
> an additional option of "gs" to enable transparency.
>
> Current version of a2ping can not cope with this change.
>
> Instead, use the pair of commands "ps2pdf" and "pdfcrop" for .eps
> files originated from .tex sources.
>
> Reported-by: Дмитрий Дьяченко <dimhen@gmail.com>
> Reported-by: Felipe Balbi <balbi@kernel.org>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>

This seems to work fine, a few warnings during compilation of affected images:

SMPdesign/DiningPhilosopher4part-b.eps --> SMPdesign/DiningPhilosopher4part-b.pdf
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
SMPdesign/DiningPhilosopher5.eps --> SMPdesign/DiningPhilosopher5.pdf
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
SMPdesign/DiningPhilosopher5PEM.eps --> SMPdesign/DiningPhilosopher5PEM.pdf
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
SMPdesign/DiningPhilosopher5TB.eps --> SMPdesign/DiningPhilosopher5TB.pdf
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution
   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution

Tested-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

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

* Re: [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
  2021-01-03 14:47 ` Felipe Balbi
@ 2021-01-03 15:13   ` Akira Yokosawa
  0 siblings, 0 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-01-03 15:13 UTC (permalink / raw)
  To: Felipe Balbi, Paul E. McKenney
  Cc: Дмитрий Дьяченко,
	perfbook, Akira Yokosawa

On Sun, 03 Jan 2021 16:47:33 +0200, Felipe Balbi wrote:
> 
> Hi,
> 
> Akira Yokosawa <akiyks@gmail.com> writes:
> 
>> From f04ab9441df5256aa9df73bb4fa005b43517f2f2 Mon Sep 17 00:00:00 2001
>> From: Akira Yokosawa <akiyks@gmail.com>
>> Date: Sun, 3 Jan 2021 19:15:25 +0900
>> Subject: [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>>
>> Combination of GhostScript 9.53.x and pstricks-base 3.01 requires
>> an additional option of "gs" to enable transparency.
>>
>> Current version of a2ping can not cope with this change.
>>
>> Instead, use the pair of commands "ps2pdf" and "pdfcrop" for .eps
>> files originated from .tex sources.
>>
>> Reported-by: Дмитрий Дьяченко <dimhen@gmail.com>
>> Reported-by: Felipe Balbi <balbi@kernel.org>
>> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> 
> This seems to work fine, a few warnings during compilation of affected images:

Thank you for testing this, Felipe.

I'm aware of these messages and should have mentioned them in the commit
log.

.setopacityalpha comes from pstricks-base package's pstricks.pro, which
defines prologue code.  So pstricks-base will need yet another update when
it becomes actually unavailable.

I plan to keep these warning messages for a while.
New commands in a Makefile might behave unexpectedly.
I'm just cautious.  ;-)

> 
> SMPdesign/DiningPhilosopher4part-b.eps --> SMPdesign/DiningPhilosopher4part-b.pdf
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
[...]
> 
> Tested-by: Felipe Balbi <balbi@kernel.org>
> 

I'll send a v2 with the updated commit log and your Tested-by:

        Thanks, Akira



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

* [PATCH v2 -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
  2021-01-03 11:23 [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later Akira Yokosawa
  2021-01-03 14:47 ` Felipe Balbi
@ 2021-01-03 23:38 ` Akira Yokosawa
  2021-01-04  0:44   ` Paul E. McKenney
  2021-01-04 13:22   ` Дмитрий Дьяченко
  1 sibling, 2 replies; 6+ messages in thread
From: Akira Yokosawa @ 2021-01-03 23:38 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Дмитрий Дьяченко,
	Felipe Balbi, perfbook, Akira Yokosawa

From d48155e896265c1a26985fe26f9bf8c5fbcfd22e Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Mon, 4 Jan 2021 07:58:18 +0900
Subject: [PATCH v2 -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Combination of GhostScript 9.53.x and pstricks-base 3.01 requires
an additional option of "gs" to enable transparency.

Current version of a2ping can not cope with this change.

Instead, use the pair of commands "ps2pdf" and "pdfcrop" for .eps
files originated from .tex sources if a new version of gs is detected.

Note:
Due to the use of a deprecated command in pstricks.pro (boilerplate
prologue code), gs 9.53.x emits repetitive warnings of:

   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution

I'll silence them once I'm sure the stability of new commands in
Makefile.

Reported-by: Дмитрий Дьяченко <dimhen@gmail.com>
Reported-by: Felipe Balbi <balbi@kernel.org>
Tested-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Hi,

I thought I didn't redirect the warnings at all, but pdfcrop's stderr
was redirected in v1.
I removed the redirection in v2.

Changes v1 -> v2:
  o Add Felipe's Tested-by
  o Mention warnings from gs in commit log's note.
  o Remove ineffective redirection at the end of pipeline.

        Thanks, Akira
--
Makefile | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 56ce62bf..0c58f1a0 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,8 @@ EPSSOURCES_FROM_TEX := \
 	SMPdesign/DiningPhilosopher4part-b.eps \
 	SMPdesign/DiningPhilosopher5PEM.eps
 
+PDFTARGETS_OF_TEX := $(EPSSOURCES_FROM_TEX:%.eps=%.pdf)
+
 DOTSOURCES := $(wildcard */*.dot)
 
 EPSSOURCES_FROM_DOT := $(DOTSOURCES:%.dot=%.eps)
@@ -70,7 +72,7 @@ EPSORIGIN := $(filter-out $(EPSSOURCES_FROM_TEX) $(EPSSOURCES_FROM_DOT) $(EPSSOU
 
 PDFTARGETS_OF_EPSORIG := $(EPSORIGIN:%.eps=%.pdf)
 
-PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_EPS))
+PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG) $(PDFTARGETS_OF_TEX),$(PDFTARGETS_OF_EPS))
 
 BIBSOURCES := bib/*.bib alphapf.bst
 
@@ -124,19 +126,23 @@ ifdef A2PING
   GS_950_OR_LATER := $(shell gs --version | grep -c -E "9\.[5-9].?")
   A2PING_277P := $(shell a2ping --help 2>&1 | grep -c "2.77p,")
   A2PING_283P := $(shell a2ping --help 2>&1 | grep -c "2.83p,")
+  GS_953_OR_LATER := $(shell gs --version | grep -c -E "9\.5[3-9].?")
   ifeq ($(A2PING_277P),1)
-    A2PING_GSCNFL := 1
+    A2PING_GSCNFL = 1
   else
     ifeq ($(A2PING_283P),1)
       ifeq ($(GS_950_OR_LATER),1)
-        A2PING_GSCNFL := 1
+        A2PING_GSCNFL = 1
       else
-        A2PING_GSCNFL := 0
+        A2PING_GSCNFL = 0
       endif
     else
-      A2PING_GSCNFL := 0
+      A2PING_GSCNFL = 0
     endif
   endif
+  ifeq ($(GS_953_OR_LATER),1)
+    A2PING_GSCNFL = 2
+  endif
 endif
 
 LINELABEL_ENV_BEGIN := $(shell grep -l -F '\begin{linelabel}' $(LATEXSOURCES))
@@ -395,6 +401,20 @@ endif
 	@a2ping --below --hires --bboxfrom=compute-gs $<i $@ > /dev/null 2>&1
 	@rm -f $<i
 
+$(PDFTARGETS_OF_TEX): %.pdf: %.eps
+	@echo "$< --> $@"
+ifndef A2PING
+	$(error $< --> $@: a2ping not found. Please install it)
+endif
+ifeq ($(A2PING_GSCNFL),1)
+	$(error a2ping version conflict. See #7 in FAQ-BUILD.txt)
+endif
+ifeq ($(A2PING_GSCNFL),2)
+	@ps2pdf -dALLOWPSTRANSPARENCY -dNOSAFER $< - | pdfcrop -hires - $@
+else
+	@a2ping --below --hires --bboxfrom=compute-gs $< $@ > /dev/null 2>&1
+endif
+
 $(PDFTARGETS_OF_EPSOTHER): %.pdf: %.eps
 	@echo "$< --> $@"
 ifndef A2PING
-- 
2.17.1




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

* Re: [PATCH v2 -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
  2021-01-03 23:38 ` [PATCH v2 " Akira Yokosawa
@ 2021-01-04  0:44   ` Paul E. McKenney
  2021-01-04 13:22   ` Дмитрий Дьяченко
  1 sibling, 0 replies; 6+ messages in thread
From: Paul E. McKenney @ 2021-01-04  0:44 UTC (permalink / raw)
  To: Akira Yokosawa
  Cc: Дмитрий Дьяченко,
	Felipe Balbi, perfbook

On Mon, Jan 04, 2021 at 08:38:35AM +0900, Akira Yokosawa wrote:
> From d48155e896265c1a26985fe26f9bf8c5fbcfd22e Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Mon, 4 Jan 2021 07:58:18 +0900
> Subject: [PATCH v2 -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Combination of GhostScript 9.53.x and pstricks-base 3.01 requires
> an additional option of "gs" to enable transparency.
> 
> Current version of a2ping can not cope with this change.
> 
> Instead, use the pair of commands "ps2pdf" and "pdfcrop" for .eps
> files originated from .tex sources if a new version of gs is detected.
> 
> Note:
> Due to the use of a deprecated command in pstricks.pro (boilerplate
> prologue code), gs 9.53.x emits repetitive warnings of:
> 
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
> 
> I'll silence them once I'm sure the stability of new commands in
> Makefile.
> 
> Reported-by: Дмитрий Дьяченко <dimhen@gmail.com>
> Reported-by: Felipe Balbi <balbi@kernel.org>
> Tested-by: Felipe Balbi <balbi@kernel.org>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> Hi,
> 
> I thought I didn't redirect the warnings at all, but pdfcrop's stderr
> was redirected in v1.
> I removed the redirection in v2.
> 
> Changes v1 -> v2:
>   o Add Felipe's Tested-by
>   o Mention warnings from gs in commit log's note.
>   o Remove ineffective redirection at the end of pipeline.

Works for me!  Queued, and thank you all!

							Thanx, Paul

>         Thanks, Akira
> --
> Makefile | 30 +++++++++++++++++++++++++-----
>  1 file changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 56ce62bf..0c58f1a0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -38,6 +38,8 @@ EPSSOURCES_FROM_TEX := \
>  	SMPdesign/DiningPhilosopher4part-b.eps \
>  	SMPdesign/DiningPhilosopher5PEM.eps
>  
> +PDFTARGETS_OF_TEX := $(EPSSOURCES_FROM_TEX:%.eps=%.pdf)
> +
>  DOTSOURCES := $(wildcard */*.dot)
>  
>  EPSSOURCES_FROM_DOT := $(DOTSOURCES:%.dot=%.eps)
> @@ -70,7 +72,7 @@ EPSORIGIN := $(filter-out $(EPSSOURCES_FROM_TEX) $(EPSSOURCES_FROM_DOT) $(EPSSOU
>  
>  PDFTARGETS_OF_EPSORIG := $(EPSORIGIN:%.eps=%.pdf)
>  
> -PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_EPS))
> +PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG) $(PDFTARGETS_OF_TEX),$(PDFTARGETS_OF_EPS))
>  
>  BIBSOURCES := bib/*.bib alphapf.bst
>  
> @@ -124,19 +126,23 @@ ifdef A2PING
>    GS_950_OR_LATER := $(shell gs --version | grep -c -E "9\.[5-9].?")
>    A2PING_277P := $(shell a2ping --help 2>&1 | grep -c "2.77p,")
>    A2PING_283P := $(shell a2ping --help 2>&1 | grep -c "2.83p,")
> +  GS_953_OR_LATER := $(shell gs --version | grep -c -E "9\.5[3-9].?")
>    ifeq ($(A2PING_277P),1)
> -    A2PING_GSCNFL := 1
> +    A2PING_GSCNFL = 1
>    else
>      ifeq ($(A2PING_283P),1)
>        ifeq ($(GS_950_OR_LATER),1)
> -        A2PING_GSCNFL := 1
> +        A2PING_GSCNFL = 1
>        else
> -        A2PING_GSCNFL := 0
> +        A2PING_GSCNFL = 0
>        endif
>      else
> -      A2PING_GSCNFL := 0
> +      A2PING_GSCNFL = 0
>      endif
>    endif
> +  ifeq ($(GS_953_OR_LATER),1)
> +    A2PING_GSCNFL = 2
> +  endif
>  endif
>  
>  LINELABEL_ENV_BEGIN := $(shell grep -l -F '\begin{linelabel}' $(LATEXSOURCES))
> @@ -395,6 +401,20 @@ endif
>  	@a2ping --below --hires --bboxfrom=compute-gs $<i $@ > /dev/null 2>&1
>  	@rm -f $<i
>  
> +$(PDFTARGETS_OF_TEX): %.pdf: %.eps
> +	@echo "$< --> $@"
> +ifndef A2PING
> +	$(error $< --> $@: a2ping not found. Please install it)
> +endif
> +ifeq ($(A2PING_GSCNFL),1)
> +	$(error a2ping version conflict. See #7 in FAQ-BUILD.txt)
> +endif
> +ifeq ($(A2PING_GSCNFL),2)
> +	@ps2pdf -dALLOWPSTRANSPARENCY -dNOSAFER $< - | pdfcrop -hires - $@
> +else
> +	@a2ping --below --hires --bboxfrom=compute-gs $< $@ > /dev/null 2>&1
> +endif
> +
>  $(PDFTARGETS_OF_EPSOTHER): %.pdf: %.eps
>  	@echo "$< --> $@"
>  ifndef A2PING
> -- 
> 2.17.1
> 
> 
> 

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

* Re: [PATCH v2 -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
  2021-01-03 23:38 ` [PATCH v2 " Akira Yokosawa
  2021-01-04  0:44   ` Paul E. McKenney
@ 2021-01-04 13:22   ` Дмитрий Дьяченко
  1 sibling, 0 replies; 6+ messages in thread
From: Дмитрий Дьяченко @ 2021-01-04 13:22 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: Paul E. McKenney, Felipe Balbi, perfbook

Thank you, Akira!
5abdbfb64558c7036a58a8e624120088ce3d2b1f  PASS build.

Dmitry

пн, 4 янв. 2021 г. в 02:38, Akira Yokosawa <akiyks@gmail.com>:
>
> From d48155e896265c1a26985fe26f9bf8c5fbcfd22e Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Mon, 4 Jan 2021 07:58:18 +0900
> Subject: [PATCH v2 -perfbook] Makefile: Cope with GhostScript 9.53.0 or later
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Combination of GhostScript 9.53.x and pstricks-base 3.01 requires
> an additional option of "gs" to enable transparency.
>
> Current version of a2ping can not cope with this change.
>
> Instead, use the pair of commands "ps2pdf" and "pdfcrop" for .eps
> files originated from .tex sources if a new version of gs is detected.
>
> Note:
> Due to the use of a deprecated command in pstricks.pro (boilerplate
> prologue code), gs 9.53.x emits repetitive warnings of:
>
>    **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
>    **** See .setfillconstantalpha/.setalphaisshape for the improved solution
>
> I'll silence them once I'm sure the stability of new commands in
> Makefile.
>
> Reported-by: Дмитрий Дьяченко <dimhen@gmail.com>
> Reported-by: Felipe Balbi <balbi@kernel.org>
> Tested-by: Felipe Balbi <balbi@kernel.org>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> Hi,
>
> I thought I didn't redirect the warnings at all, but pdfcrop's stderr
> was redirected in v1.
> I removed the redirection in v2.
>
> Changes v1 -> v2:
>   o Add Felipe's Tested-by
>   o Mention warnings from gs in commit log's note.
>   o Remove ineffective redirection at the end of pipeline.
>
>         Thanks, Akira
> --
> Makefile | 30 +++++++++++++++++++++++++-----
>  1 file changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 56ce62bf..0c58f1a0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -38,6 +38,8 @@ EPSSOURCES_FROM_TEX := \
>         SMPdesign/DiningPhilosopher4part-b.eps \
>         SMPdesign/DiningPhilosopher5PEM.eps
>
> +PDFTARGETS_OF_TEX := $(EPSSOURCES_FROM_TEX:%.eps=%.pdf)
> +
>  DOTSOURCES := $(wildcard */*.dot)
>
>  EPSSOURCES_FROM_DOT := $(DOTSOURCES:%.dot=%.eps)
> @@ -70,7 +72,7 @@ EPSORIGIN := $(filter-out $(EPSSOURCES_FROM_TEX) $(EPSSOURCES_FROM_DOT) $(EPSSOU
>
>  PDFTARGETS_OF_EPSORIG := $(EPSORIGIN:%.eps=%.pdf)
>
> -PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG),$(PDFTARGETS_OF_EPS))
> +PDFTARGETS_OF_EPSOTHER := $(filter-out $(PDFTARGETS_OF_EPSORIG) $(PDFTARGETS_OF_TEX),$(PDFTARGETS_OF_EPS))
>
>  BIBSOURCES := bib/*.bib alphapf.bst
>
> @@ -124,19 +126,23 @@ ifdef A2PING
>    GS_950_OR_LATER := $(shell gs --version | grep -c -E "9\.[5-9].?")
>    A2PING_277P := $(shell a2ping --help 2>&1 | grep -c "2.77p,")
>    A2PING_283P := $(shell a2ping --help 2>&1 | grep -c "2.83p,")
> +  GS_953_OR_LATER := $(shell gs --version | grep -c -E "9\.5[3-9].?")
>    ifeq ($(A2PING_277P),1)
> -    A2PING_GSCNFL := 1
> +    A2PING_GSCNFL = 1
>    else
>      ifeq ($(A2PING_283P),1)
>        ifeq ($(GS_950_OR_LATER),1)
> -        A2PING_GSCNFL := 1
> +        A2PING_GSCNFL = 1
>        else
> -        A2PING_GSCNFL := 0
> +        A2PING_GSCNFL = 0
>        endif
>      else
> -      A2PING_GSCNFL := 0
> +      A2PING_GSCNFL = 0
>      endif
>    endif
> +  ifeq ($(GS_953_OR_LATER),1)
> +    A2PING_GSCNFL = 2
> +  endif
>  endif
>
>  LINELABEL_ENV_BEGIN := $(shell grep -l -F '\begin{linelabel}' $(LATEXSOURCES))
> @@ -395,6 +401,20 @@ endif
>         @a2ping --below --hires --bboxfrom=compute-gs $<i $@ > /dev/null 2>&1
>         @rm -f $<i
>
> +$(PDFTARGETS_OF_TEX): %.pdf: %.eps
> +       @echo "$< --> $@"
> +ifndef A2PING
> +       $(error $< --> $@: a2ping not found. Please install it)
> +endif
> +ifeq ($(A2PING_GSCNFL),1)
> +       $(error a2ping version conflict. See #7 in FAQ-BUILD.txt)
> +endif
> +ifeq ($(A2PING_GSCNFL),2)
> +       @ps2pdf -dALLOWPSTRANSPARENCY -dNOSAFER $< - | pdfcrop -hires - $@
> +else
> +       @a2ping --below --hires --bboxfrom=compute-gs $< $@ > /dev/null 2>&1
> +endif
> +
>  $(PDFTARGETS_OF_EPSOTHER): %.pdf: %.eps
>         @echo "$< --> $@"
>  ifndef A2PING
> --
> 2.17.1
>
>
>

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

end of thread, other threads:[~2021-01-04 13:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-03 11:23 [PATCH -perfbook] Makefile: Cope with GhostScript 9.53.0 or later Akira Yokosawa
2021-01-03 14:47 ` Felipe Balbi
2021-01-03 15:13   ` Akira Yokosawa
2021-01-03 23:38 ` [PATCH v2 " Akira Yokosawa
2021-01-04  0:44   ` Paul E. McKenney
2021-01-04 13:22   ` Дмитрий Дьяченко

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.