groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 03/06: [gropdf]: Clarify reduced support scenario.


From: G. Branden Robinson
Subject: [groff] 03/06: [gropdf]: Clarify reduced support scenario.
Date: Mon, 13 Feb 2023 22:04:37 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 3cd845525af95b905763422d7f9d68bc01e77004
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Feb 13 20:20:18 2023 -0600

    [gropdf]: Clarify reduced support scenario.
    
    * font/devpdf/tests/basic-fonts-present.sh: Revise test.  Improve
      explanation of why we're looking for the gs(1) command in a font
      availability test.  Prefix diagnostic output with name of test script.
      Perform a search for the 'ps' device font descriptions that will work
      in more build scenarios (i.e., don't assume an out-of-tree build
      taking place in an immediate subdirectory of the source).  Distinguish
      failure to find the font descriptions from a failure to locate the
      'gs' command, skipping the test in both scenarios.  Reduce noise in
      output.
    
    * m4/groff.m4 (GROFF_CHECK_GROPDF_PROGRAMS): Revise warning issued when
      awk and Ghostscript are unavailable; gropdf will not be completely
      inoperative.  Characterize its reduced function.
    
    Thanks to Deri James in <https://lists.gnu.org/archive/html/\
    groff-commit/2023-02/msg00089.html> for prompting me to take a another
    look at this.
---
 ChangeLog                                | 19 ++++++++++++++
 font/devpdf/tests/basic-fonts-present.sh | 43 ++++++++++++++++++++++++++------
 m4/groff.m4                              |  9 ++++---
 3 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96d1e6bec..c0651f010 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2023-02-13  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * font/devpdf/tests/basic-fonts-present.sh: Revise test.
+       Improve explanation of why we're looking for the gs(1) command
+       in a font availability test.  Prefix diagnostic output with name
+       of test script.  Perform a search for the 'ps' device font
+       descriptions that will work in more build scenarios (i.e., don't
+       assume an out-of-tree build taking place in an immediate
+       subdirectory of the source).  Distinguish failure to find the
+       font descriptions from a failure to locate the 'gs' command,
+       skipping the test in both scenarios.  Reduce noise in output.
+       * m4/groff.m4 (GROFF_CHECK_GROPDF_PROGRAMS): Revise warning
+       issued when awk and Ghostscript are unavailable; gropdf will not
+       be completely inoperative.  Characterize its reduced function.
+
+       Thanks to Deri James in <https://lists.gnu.org/archive/html/\
+       groff-commit/2023-02/msg00089.html> for prompting me to take a
+       another look at this.
+
 2023-02-13  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/tests/latin2_works.sh:
diff --git a/font/devpdf/tests/basic-fonts-present.sh 
b/font/devpdf/tests/basic-fonts-present.sh
index b373dfc0f..f54534697 100755
--- a/font/devpdf/tests/basic-fonts-present.sh
+++ b/font/devpdf/tests/basic-fonts-present.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2022 Free Software Foundation, Inc.
+# Copyright (C) 2022-2023 Free Software Foundation, Inc.
 #
 # This file is part of groff.
 #
@@ -23,15 +23,45 @@
 #
 # We need all of them except SS and ZDR.
 
-# Our configure script warns that gropdf will not be functional if gs
-# (Ghostscript) is not available.
+# Our configure script warns that gropdf will not be fully functional if
+# gs (Ghostscript) is not available.  Namely, we will have only
+# descriptions for the PostScript Level 1 base 14 fonts, not the Level 2
+# base 35 fonts.  We're using the presence of the command as a proxy for
+# the availabilty of the fonts because locating the latter is
+# unreliable (package names, directory locations, and file names all
+# vary), but if the command is present, the fonts usually are too.
 if ! command -v gs
 then
-    echo "gs command not available; skipping test" >&2
+    echo "$0: gs command not available; skipping test" >&2
+    exit 77 # skip
+fi
+
+# Locate directory containing the font descriptions for the PostScript
+# device.
+for srcroot in . .. ../..
+do
+    # Look for a source file characteristic of the groff source tree.
+    if ! [ -f "$srcroot"/ChangeLog.115 ]
+    then
+        continue
+    fi
+
+    d=$srcroot/font/devps
+    if [ -d "$d" ]
+    then
+        devps_fontsrcdir=$d
+        break
+    fi
+done
+
+# If we can't find it, we can't test.
+if [ -z "$devps_fontsrcdir" ]
+then
+    echo "$0: cannot locate font descriptions for 'ps' device;" \
+        "skipping test" >&2
     exit 77 # skip
 fi
 
-devps_fontsrcdir="${abs_top_srcdir:-..}"/font/devps
 devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf
 
 psfonts=$(cd "$devps_fontsrcdir" && ls [A-Z]* \
@@ -42,9 +72,8 @@ fail=
 for f in $psfonts
 do
     printf "checking for font description %s...\n" "$f" >&2
-    if ! test -f "$devpdf_fontbuilddir"/"$f"
+    if ! [ -f "$devpdf_fontbuilddir"/"$f" ]
     then
-        echo test -f "$devpdf_fontbuilddir"/"$f"
         echo FAILED >&2
         fail=yes
     fi
diff --git a/m4/groff.m4 b/m4/groff.m4
index 7bf76838c..fa1ec5a22 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -234,8 +234,8 @@ AC_DEFUN([GROFF_GROHTML_PROGRAM_NOTICE], [
   fi
 ])
 
-# gropdf needs awk and Ghostscript to have produced its font description
-# files.
+# gropdf needs awk and Ghostscript to have produced (a full set of) its
+# font description files.
 
 AC_DEFUN([GROFF_CHECK_GROPDF_PROGRAMS], [
   use_gropdf=no
@@ -263,8 +263,9 @@ AC_DEFUN([GROFF_CHECK_GROPDF_PROGRAMS], [
 \$PATH.
 
   Consequently, groff's PDF output driver, 'gropdf', will not work
-  properly.  It will not be possible to prepare or install
-  groff-generated documentation in PDF.
+  fully.  It will not be possible to prepare or install some
+  groff-generated documentation in PDF.  Support is restricted to the
+  base 14 fonts of the PDF specification.
 "
   fi
   AC_SUBST([use_gropdf])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]