Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [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 = "GPLv3" |
| 14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=70dc2bac4d0ce4448da873cd86b123fc" |
| 15 | |
| 16 | DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng" |
| 17 | DEPENDS_class-native = "libpng-native" |
| 18 | |
| 19 | UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases" |
| 20 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" |
| 21 | |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 22 | def gs_verdir(v): |
| 23 | return "".join(v.split(".")) |
| 24 | |
| 25 | |
| 26 | SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | file://ghostscript-9.15-parallel-make.patch \ |
| 28 | file://ghostscript-9.16-Werror-return-type.patch \ |
| 29 | file://do-not-check-local-libpng-source.patch \ |
| 30 | file://avoid-host-contamination.patch \ |
| 31 | file://mkdir-p.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | " |
| 33 | |
| 34 | SRC_URI = "${SRC_URI_BASE} \ |
| 35 | file://ghostscript-9.21-prevent_recompiling.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 36 | file://cups-no-gcrypt.patch \ |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 37 | file://CVE-2020-15900.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 38 | " |
| 39 | |
| 40 | SRC_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 | |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 45 | SRC_URI[md5sum] = "0f6964ab9b83a63b7e373f136243f901" |
| 46 | SRC_URI[sha256sum] = "c2501d8e8e0814c4a5aa7e443e230e73d7af7f70287546f7b697e5ef49e32176" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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)}" |
| 56 | PACKAGECONFIG_class-native = "" |
| 57 | |
| 58 | PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \ |
| 59 | --without-x, virtual/libx11 libxext libxt gtk+3\ |
| 60 | " |
| 61 | |
| 62 | EXTRA_OECONF = "--without-libpaper --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 | |
| 69 | EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0" |
| 70 | |
| 71 | # Explicity disable libtiff, fontconfig, |
| 72 | # freetype, cups for ghostscript-native |
| 73 | EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \ |
| 74 | --without-jbig2dec --without-libpaper \ |
| 75 | --with-fontpath=${datadir}/fonts \ |
| 76 | --without-libidn --disable-fontconfig \ |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 77 | --enable-freetype --disable-cups " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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 |
| 82 | CFLAGS += "-DHAVE_SYS_TIME_H=1" |
| 83 | BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1" |
| 84 | |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 85 | inherit autotools-brokensep |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 86 | |
| 87 | do_configure_append () { |
| 88 | # copy tools from the native ghostscript build |
| 89 | if [ "${PN}" != "ghostscript-native" ]; then |
| 90 | mkdir -p obj/aux soobj |
| 91 | for i in genarch genconf mkromfs echogs gendev genht packps; do |
| 92 | cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i |
| 93 | done |
| 94 | fi |
| 95 | } |
| 96 | |
| 97 | do_install_append () { |
| 98 | mkdir -p ${D}${datadir}/ghostscript/${PV}/ |
| 99 | cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/ |
| 100 | cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/ |
| 101 | } |
| 102 | |
| 103 | do_compile_class-native () { |
| 104 | mkdir -p obj |
| 105 | for i in genarch genconf mkromfs echogs gendev genht packps; do |
| 106 | oe_runmake obj/aux/$i |
| 107 | done |
| 108 | } |
| 109 | |
| 110 | do_install_class-native () { |
| 111 | install -d ${D}${bindir}/ghostscript-${PV} |
| 112 | for i in genarch genconf mkromfs echogs gendev genht packps; do |
| 113 | install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i |
| 114 | done |
| 115 | } |
| 116 | |
| 117 | BBCLASSEXTEND = "native" |
| 118 | |
| 119 | # ghostscript does not supports "arc" |
| 120 | COMPATIBLE_HOST = "^(?!arc).*" |
| 121 | |
| 122 | # some entries in NVD uses gpl_ghostscript |
| 123 | CVE_PRODUCT = "ghostscript gpl_ghostscript" |