blob: 434170e34d19a0c1080d1fca85cc44b34078175a [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -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
13LICENSE = "GPL-3.0-only"
14LIC_FILES_CHKSUM = "file://LICENSE;md5=f98ffa763e50cded76f49bce73aade16"
15
Patrick Williams520786c2023-06-25 16:20:36 -050016DEPENDS = "tiff jpeg fontconfig cups libpng freetype zlib"
Andrew Geissler517393d2023-01-13 08:55:19 -060017
18UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
19UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
20
Andrew Geissler517393d2023-01-13 08:55:19 -060021def gs_verdir(v):
22 return "".join(v.split("."))
23
24
Patrick Williams520786c2023-06-25 16:20:36 -050025SRC_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 \
Patrick Williams2a254922023-08-11 09:48:11 -050028 file://0001-Bug-706897-Copy-pcx-buffer-overrun-fix-from-devices-.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040029 file://configure.ac-add-option-to-explicitly-disable-neon.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060030"
31
Andrew Geissler8f840682023-07-21 09:09:43 -050032SRC_URI[sha256sum] = "a4cd61a07fec161bee35da0211a5e5cde8ff8a0aaf942fc0176715e499d21661"
Andrew Geissler517393d2023-01-13 08:55:19 -060033
Patrick Williams520786c2023-06-25 16:20:36 -050034PACKAGECONFIG ??= ""
35PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
36PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
37PACKAGECONFIG[libpaper] = "--with-libpaper,--without-libpaper,libpaper"
Andrew Geissler517393d2023-01-13 08:55:19 -060038PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
Patrick Williams520786c2023-06-25 16:20:36 -050039 --without-x, virtual/libx11 libxext libxt"
Andrew Geissler517393d2023-01-13 08:55:19 -060040
Patrick Williams520786c2023-06-25 16:20:36 -050041EXTRA_OECONF = "--with-jbig2dec \
Andrew Geissler517393d2023-01-13 08:55:19 -060042 --with-fontpath=${datadir}/fonts \
Andrew Geissler517393d2023-01-13 08:55:19 -060043 CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
Patrick Williams520786c2023-06-25 16:20:36 -050044 PKGCONFIG=pkg-config \
Andrew Geissler517393d2023-01-13 08:55:19 -060045 "
46
47EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
48
Andrew Geissler5082cc72023-09-11 08:41:39 -040049EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
50EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
51
Patrick Williams520786c2023-06-25 16:20:36 -050052# Uses autoconf but not automake, can't do out-of-tree
53inherit autotools-brokensep pkgconfig
Andrew Geissler517393d2023-01-13 08:55:19 -060054
Patrick Williams520786c2023-06-25 16:20:36 -050055# Prune the source tree of libraries that we're using our packaging of, so that
56# ghostscript can't link to them. Can't prune zlib as that's needed for the
57# native tools.
58prune_sources() {
59 rm -rf ${S}/jpeg/ ${S}/libpng/ ${S}/tiff/ ${S}/expat/ ${S}/freetype/ ${S}/cups/lib
Andrew Geissler517393d2023-01-13 08:55:19 -060060}
Patrick Williams520786c2023-06-25 16:20:36 -050061do_unpack[postfuncs] += "prune_sources"
Andrew Geissler517393d2023-01-13 08:55:19 -060062
63do_install:append () {
64 mkdir -p ${D}${datadir}/ghostscript/${PV}/
65 cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
66 cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
67}
68
Andrew Geissler517393d2023-01-13 08:55:19 -060069# ghostscript does not supports "arc"
70COMPATIBLE_HOST = "^(?!arc).*"
71
72# some entries in NVD uses gpl_ghostscript
73CVE_PRODUCT = "ghostscript gpl_ghostscript"
Patrick Williams2a254922023-08-11 09:48:11 -050074
75CVE_STATUS[CVE-2023-38560] = "not-applicable-config: PCL isn't part of the Ghostscript release"