aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2019-12-04 13:35:03 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2019-12-04 13:35:03 +0000
commit08efcf9c3ef1d44bc3fd48b6eaa9416c6e0f2b8b (patch)
treeb3dd9256aa3fad7f866dba106b45aed4b34606fc
parent891e91f0762011594d46034368c8e36a9cde39d8 (diff)
Checking for necessary X11 libraries before building Ghostscript
Until now, Ghostscript was using some host system's X11 libraries during its build (and later at run-time). We should ideally install all these necessary libraries within the template (Task #15481). But right now we are too busy. As a temporary work-around we try building a small dummy program that links with some of those libraries before attempting to built Ghostscript. If it fails, then a notice is printed with the cause and explaining a temporary solution is suggested: how to install those libraries on the system when you have root access.
-rw-r--r--reproduce/software/make/high-level.mk36
1 files changed, 35 insertions, 1 deletions
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index 6d4b503..56af4b9 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -878,8 +878,42 @@ $(ibidir)/gdb: | $(ibidir)/python \
$(call gbuild, gdb-$(gdb-version),,,V=1) \
&& echo "GNU Project Debugger (GDB) $(gdb-version)" > $@
-$(ibidir)/ghostscript: $(ibidir)/libtiff \
+$(ibidir)/ghostscript: $(ibidir)/libpng \
+ $(ibidir)/libtiff \
| $(tdir)/ghostscript-$(ghostscript-version).tar.gz
+ # First we need to make sure some necessary X11 libraries that we
+ # don't yet install in this template are present on the host
+ # system, see https://savannah.nongnu.org/task/?15481 .
+ echo;
+ echo "Template: testing necessary X11 libraries for ghostscript"
+ echo "---------------------------------------------------------"
+ oprog=$(ddir)/libXext-test-for-ghostscript
+ cprog=$(ddir)/libXext-test-for-ghostscript.c
+ echo "#include <stdio.h>" > $$cprog
+ echo "int main(void) {return 0;}" >> $$cprog
+ if $$CC $$cprog -o$$oprog -lXt -lSM -lICE -lXext; then
+ echo "Necessary X11 libraries are present. Proceeding to the build."
+ rm $$cprog $$oprog
+ else
+ rm $$cprog
+ echo ""
+ echo "Problem in building Ghostscript"
+ echo "-------------------------------"
+ echo "Some necessary X11 libraries (that we don't yet install"
+ echo "within the template) couldn't be found on your system, see"
+ echo "the 'ld' error message above. Please install them manually"
+ echo "so Ghostscript can be built."
+ echo
+ echo "For example if you use Debian-based OSs, run this command:"
+ echo " sudo apt install libxext-dev libxt-dev libsm-dev libice-dev ghostscript"
+ echo ""
+ echo "This notice will be removed once these packages are built"
+ echo "within the project (Task #15481)."
+ echo "-------------------------------"
+ exit 1
+ fi
+
+ # If they were present, go onto building Ghostscript.
$(call gbuild, ghostscript-$(ghostscript-version)) \
&& echo "GPL Ghostscript $(ghostscript-version)" > $@