blob: fdca8a2ac9398821fcbaa00a59f293f65296e146 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
2DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \
3a back-end to a program such as ghostview, it can display PostScript and PDF \
4documents in an X11 environment. \
5\
6Furthermore, it can render PostScript and PDF files as graphics to be printed \
7on non-PostScript printers. Supported printers include common \
8dot-matrix, inkjet and laser models. \
9"
10HOMEPAGE = "http://www.ghostscript.com"
11SECTION = "console/utils"
12
13LICENSE = "GPLv3"
14LIC_FILES_CHKSUM = "file://LICENSE;md5=70dc2bac4d0ce4448da873cd86b123fc"
15
16DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
17DEPENDS_class-native = "libpng-native"
18
19UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
20UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
21
22SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs925/${BPN}-${PV}.tar.gz \
23 file://ghostscript-9.15-parallel-make.patch \
24 file://ghostscript-9.16-Werror-return-type.patch \
25 file://do-not-check-local-libpng-source.patch \
26 file://avoid-host-contamination.patch \
27 file://mkdir-p.patch \
28 file://0001-Bug-699795-add-operand-checking-to-.setnativefontmap.patch \
29 file://0002-Bug-699816-Improve-hiding-of-security-critical-custo.patch \
30 file://0003-Bug-699832-add-control-over-hiding-error-handlers.patch \
31 file://0004-For-hidden-operators-pass-a-name-object-to-error-han.patch \
32 file://0005-Bug-699938-.loadfontloop-must-be-an-operator.patch \
33 file://0006-Undefine-some-additional-internal-operators.patch \
34 file://0007-Bug-699927-don-t-include-operator-arrays-in-execstac.patch \
35 file://0008-Make-.forceput-unavailable-from-.policyprocs-helper-.patch \
36"
37
38SRC_URI = "${SRC_URI_BASE} \
39 file://ghostscript-9.21-prevent_recompiling.patch \
40 file://ghostscript-9.02-genarch.patch \
41 file://objarch.h \
42 file://cups-no-gcrypt.patch \
43 "
44
45SRC_URI_class-native = "${SRC_URI_BASE} \
46 file://ghostscript-9.21-native-fix-disable-system-libtiff.patch \
47 file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
48 "
49
50SRC_URI[md5sum] = "eebd0fadbfa8e800094422ce65e94d5d"
51SRC_URI[sha256sum] = "baafa64740b090bff50b220a6df3be95c46069b7e30f4b4effed28316e5b2389"
52
53# Put something like
54#
55# PACKAGECONFIG_append_pn-ghostscript = " x11"
56#
57# in local.conf to enable building with X11. Be careful. The order
58# of the overrides matters!
59#
60#PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
61PACKAGECONFIG_class-native = ""
62
63PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
64 --without-x, virtual/libx11 libxext libxt gtk+3\
65 "
66
67EXTRA_OECONF = "--with-system-libtiff --without-jbig2dec \
68 --with-fontpath=${datadir}/fonts \
69 --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
70 --with-cups-datadir=${datadir}/cups \
71 CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
72 "
73
74EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0"
75
76# Explicity disable libtiff, fontconfig,
77# freetype, cups for ghostscript-native
78EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
79 --without-jbig2dec \
80 --with-fontpath=${datadir}/fonts \
81 --without-libidn --disable-fontconfig \
82 --disable-freetype --disable-cups"
83
84# This has been fixed upstream but for now we need to subvert the check for time.h
85# http://bugs.ghostscript.com/show_bug.cgi?id=692443
86# http://bugs.ghostscript.com/show_bug.cgi?id=692426
87CFLAGS += "-DHAVE_SYS_TIME_H=1"
88BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
89
90inherit autotools
91
92do_configure_prepend () {
93 mkdir -p obj
94 mkdir -p soobj
95 if [ -e ${WORKDIR}/objarch.h ]; then
96 cp ${WORKDIR}/objarch.h obj/arch.h
97 fi
98}
99
100do_configure_append () {
101 # copy tools from the native ghostscript build
102 if [ "${PN}" != "ghostscript-native" ]; then
103 mkdir -p obj/aux soobj
104 for i in genarch genconf mkromfs echogs gendev genht packps; do
105 cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
106 done
107 fi
108}
109
110do_install_append () {
111 mkdir -p ${D}${datadir}/ghostscript/${PV}/
112 cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
113 cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
114}
115
116do_compile_class-native () {
117 mkdir -p obj
118 for i in genarch genconf mkromfs echogs gendev genht packps; do
119 oe_runmake obj/aux/$i
120 done
121}
122
123do_install_class-native () {
124 install -d ${D}${bindir}/ghostscript-${PV}
125 for i in genarch genconf mkromfs echogs gendev genht packps; do
126 install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
127 done
128}
129
130BBCLASSEXTEND = "native"
131
132# ghostscript does not supports "arc"
133COMPATIBLE_HOST = "^(?!arc).*"