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