summaryrefslogtreecommitdiff
path: root/font
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-13 20:20:18 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-02-13 20:23:08 -0600
commit3cd845525af95b905763422d7f9d68bc01e77004 (patch)
treea500b8b463a5fcec364551d2a8cf6ebbd0ac1050 /font
parent4392979e9d616aebd376f5aac69a08277b7820dc (diff)
downloadgroff-git-3cd845525af95b905763422d7f9d68bc01e77004.tar.gz
[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.
Diffstat (limited to 'font')
-rwxr-xr-xfont/devpdf/tests/basic-fonts-present.sh43
1 files changed, 36 insertions, 7 deletions
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