Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter" |
| 2 | DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \ |
| 3 | a back-end to a program such as ghostview, it can display PostScript and PDF \ |
| 4 | documents in an X11 environment. \ |
| 5 | \ |
| 6 | Furthermore, it can render PostScript and PDF files as graphics to be printed \ |
| 7 | on non-PostScript printers. Supported printers include common \ |
| 8 | dot-matrix, inkjet and laser models. \ |
| 9 | " |
| 10 | HOMEPAGE = "http://www.ghostscript.com" |
| 11 | SECTION = "console/utils" |
| 12 | |
| 13 | LICENSE = "GPL-3.0-only" |
| 14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=f98ffa763e50cded76f49bce73aade16" |
| 15 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 16 | DEPENDS = "tiff jpeg fontconfig cups libpng freetype zlib" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 17 | |
| 18 | UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases" |
| 19 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" |
| 20 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 21 | # We use a system libjpeg-turbo which has this fix |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 22 | CVE_CHECK_IGNORE += "CVE-2013-6629" |
| 23 | |
| 24 | def gs_verdir(v): |
| 25 | return "".join(v.split(".")) |
| 26 | |
| 27 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 28 | SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \ |
| 29 | file://ghostscript-9.16-Werror-return-type.patch \ |
| 30 | file://avoid-host-contamination.patch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 31 | " |
| 32 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 33 | SRC_URI[sha256sum] = "4df18a808cd4369f25e02dbcec2f133cb6d674627b2c6b1502020e58d43e32ce" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 34 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 35 | PACKAGECONFIG ??= "" |
| 36 | PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3" |
| 37 | PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn" |
| 38 | PACKAGECONFIG[libpaper] = "--with-libpaper,--without-libpaper,libpaper" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 39 | PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \ |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 40 | --without-x, virtual/libx11 libxext libxt" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 41 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 42 | EXTRA_OECONF = "--with-jbig2dec \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 43 | --with-fontpath=${datadir}/fonts \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 44 | CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \ |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 45 | PKGCONFIG=pkg-config \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 46 | " |
| 47 | |
| 48 | EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0" |
| 49 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 50 | # Uses autoconf but not automake, can't do out-of-tree |
| 51 | inherit autotools-brokensep pkgconfig |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 52 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 53 | # Prune the source tree of libraries that we're using our packaging of, so that |
| 54 | # ghostscript can't link to them. Can't prune zlib as that's needed for the |
| 55 | # native tools. |
| 56 | prune_sources() { |
| 57 | rm -rf ${S}/jpeg/ ${S}/libpng/ ${S}/tiff/ ${S}/expat/ ${S}/freetype/ ${S}/cups/lib |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 58 | } |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 59 | do_unpack[postfuncs] += "prune_sources" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 60 | |
| 61 | do_install:append () { |
| 62 | mkdir -p ${D}${datadir}/ghostscript/${PV}/ |
| 63 | cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/ |
| 64 | cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/ |
| 65 | } |
| 66 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 67 | # ghostscript does not supports "arc" |
| 68 | COMPATIBLE_HOST = "^(?!arc).*" |
| 69 | |
| 70 | # some entries in NVD uses gpl_ghostscript |
| 71 | CVE_PRODUCT = "ghostscript gpl_ghostscript" |