blob: 3dff16eec2263fd1f5c54e31fb96c4c78ad36585 [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001SUMMARY = "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
Patrick Williams73bd93f2024-02-20 08:07:48 -060013LICENSE = "AGPL-3.0-or-later"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060014LIC_FILES_CHKSUM = "file://LICENSE;md5=f98ffa763e50cded76f49bce73aade16"
15
16DEPENDS = "tiff jpeg fontconfig cups libpng freetype zlib"
17
18UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
19UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
20
21def gs_verdir(v):
22 return "".join(v.split("."))
23
24
25SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
26 file://ghostscript-9.16-Werror-return-type.patch \
27 file://avoid-host-contamination.patch \
28 file://configure.ac-add-option-to-explicitly-disable-neon.patch \
29 "
30
31SRC_URI[sha256sum] = "e429e4f5b01615a4f0f93a4128e8a1a4d932dff983b1774174c79c0630717ad9"
32
33PACKAGECONFIG ??= ""
34PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
35PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
36PACKAGECONFIG[libpaper] = "--with-libpaper,--without-libpaper,libpaper"
37PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
38 --without-x, virtual/libx11 libxext libxt"
39
40EXTRA_OECONF = "--with-jbig2dec \
41 --with-fontpath=${datadir}/fonts \
42 CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
43 PKGCONFIG=pkg-config \
44 "
45
46EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
47
48EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
49EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
50
51# Uses autoconf but not automake, can't do out-of-tree
52inherit autotools-brokensep pkgconfig
53
54# Prune the source tree of libraries that we're using our packaging of, so that
55# ghostscript can't link to them. Can't prune zlib as that's needed for the
56# native tools.
57prune_sources() {
58 rm -rf ${S}/jpeg/ ${S}/libpng/ ${S}/tiff/ ${S}/expat/ ${S}/freetype/ ${S}/cups/lib
59}
60do_unpack[postfuncs] += "prune_sources"
61
62do_install:append () {
63 oe_runmake DESTDIR=${D} install-so
64 oe_runmake DESTDIR=${D} install-data
65 cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
66 cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
67}
68
69# ghostscript does not supports "arc"
70COMPATIBLE_HOST = "^(?!arc).*"
71
72# some entries in NVD uses gpl_ghostscript
73CVE_PRODUCT = "ghostscript gpl_ghostscript"
74
75CVE_STATUS[CVE-2023-38560] = "not-applicable-config: PCL isn't part of the Ghostscript release"
Patrick Williams39653562024-03-01 08:54:02 -060076CVE_STATUS[CVE-2023-38559] = "cpe-incorrect: Issue only appears in versions before 10.02.0"