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