blob: 349c0c2e8bea275693b72654bb0d1fe12733c488 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "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/gs927/${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 \
Brad Bishopa34c0302019-09-23 22:34:48 -040028 file://CVE-2019-14811-0001.patch \
29 file://CVE-2019-14817-0001.patch \
30 file://CVE-2019-14817-0002.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040031"
32
33SRC_URI = "${SRC_URI_BASE} \
34 file://ghostscript-9.21-prevent_recompiling.patch \
35 file://ghostscript-9.02-genarch.patch \
36 file://objarch.h \
37 file://cups-no-gcrypt.patch \
38 "
39
40SRC_URI_class-native = "${SRC_URI_BASE} \
41 file://ghostscript-9.21-native-fix-disable-system-libtiff.patch \
42 file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
43 "
44
45SRC_URI[md5sum] = "c3990a504a3a23b9babe9de00ed6597d"
46SRC_URI[sha256sum] = "9760e8bdd07a08dbd445188a6557cb70e60ccb6a5601f7dbfba0d225e28ce285"
47
48# Put something like
49#
50# PACKAGECONFIG_append_pn-ghostscript = " x11"
51#
52# in local.conf to enable building with X11. Be careful. The order
53# of the overrides matters!
54#
55#PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
56PACKAGECONFIG_class-native = ""
57
58PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
59 --without-x, virtual/libx11 libxext libxt gtk+3\
60 "
61
62EXTRA_OECONF = "--with-system-libtiff --without-jbig2dec \
63 --with-fontpath=${datadir}/fonts \
64 --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
65 --with-cups-datadir=${datadir}/cups \
66 CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
67 "
68
69EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0"
70
71# Explicity disable libtiff, fontconfig,
72# freetype, cups for ghostscript-native
73EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
74 --without-jbig2dec \
75 --with-fontpath=${datadir}/fonts \
76 --without-libidn --disable-fontconfig \
77 --disable-freetype --disable-cups"
78
79# This has been fixed upstream but for now we need to subvert the check for time.h
80# http://bugs.ghostscript.com/show_bug.cgi?id=692443
81# http://bugs.ghostscript.com/show_bug.cgi?id=692426
82CFLAGS += "-DHAVE_SYS_TIME_H=1"
83BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
84
85inherit autotools
86
87do_configure_prepend () {
88 mkdir -p obj
89 mkdir -p soobj
90 if [ -e ${WORKDIR}/objarch.h ]; then
91 cp ${WORKDIR}/objarch.h obj/arch.h
92 fi
93}
94
95do_configure_append () {
96 # copy tools from the native ghostscript build
97 if [ "${PN}" != "ghostscript-native" ]; then
98 mkdir -p obj/aux soobj
99 for i in genarch genconf mkromfs echogs gendev genht packps; do
100 cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
101 done
102 fi
103}
104
105do_install_append () {
106 mkdir -p ${D}${datadir}/ghostscript/${PV}/
107 cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
108 cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
109}
110
111do_compile_class-native () {
112 mkdir -p obj
113 for i in genarch genconf mkromfs echogs gendev genht packps; do
114 oe_runmake obj/aux/$i
115 done
116}
117
118do_install_class-native () {
119 install -d ${D}${bindir}/ghostscript-${PV}
120 for i in genarch genconf mkromfs echogs gendev genht packps; do
121 install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
122 done
123}
124
125BBCLASSEXTEND = "native"
126
127# ghostscript does not supports "arc"
128COMPATIBLE_HOST = "^(?!arc).*"
129
130# some entries in NVD uses gpl_ghostscript
131CVE_PRODUCT = "ghostscript gpl_ghostscript"