diff --git a/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch b/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch index e8cb16c36b..15c7eb5a77 100644 --- a/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch +++ b/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch @@ -5,8 +5,7 @@ Subject: [PATCH 04/10] avoid host contamination Remove hardcode path refer to host to avoid host contamination. -Upstream-Status: Inappropriate [embedded specific] - +Upstream-Status: Pending Signed-off-by: Kai Kang Rebase to 9.23 diff --git a/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch b/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch deleted file mode 100644 index 7d80066a80..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 9ca6f795409b988d38dd98bc2a6ecb68a9392312 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Thu, 29 Mar 2018 16:37:40 +0800 -Subject: [PATCH 10/10] base/genht.c: add a preprocessor define to allow fopen - calling - -The commit in upstream: -http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=773c69e46e70bdd5482676437dafd2ca83397643 - -Replace all fopen calls with gp_fopen and add a preprocessor define so -that any unintential calls directly to fopen will cause an error. - -Only exceptions are those in the platform specific code, and mkromfs.c. -This patch add a preprocessor define to allow fopen calling in -base/genht.c. - -Upstream-Status: Pending - -Rebase to 9.23 -Signed-off-by: Hongxu Jia ---- - base/genht.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/base/genht.c b/base/genht.c -index e597e72..e96bfb5 100644 ---- a/base/genht.c -+++ b/base/genht.c -@@ -16,6 +16,10 @@ - - /* Generate C code for compiling halftones into ROM. */ - #include "malloc_.h" -+ -+/* prevent gp.h from defining fopen */ -+#define fopen fopen -+ - #include "stdio_.h" - #include "string_.h" - #include "gscdefs.h" --- -1.8.3.1 - diff --git a/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch b/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch deleted file mode 100644 index 4c9bb22fa2..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9129eb7fa9dc160d64a7d9df9279a3b1dae4d793 Mon Sep 17 00:00:00 2001 -From: Jackie Huang -Date: Thu, 29 Mar 2018 16:16:18 +0800 -Subject: [PATCH 08/10] cups no gcrypt - -Don't build-depend on libgcrypt, as nothing is used from it - -Backported from -http://www.cups.org/strfiles.php/3308/cups-no-gcrypt.patch - -This addresses the cryto dependency seen during build. - -Upstream-Status: Backport - -Signed-off-by: Jackie Huang - -Rebase to 9.23 -Signed-off-by: Hongxu Jia ---- - cups/libs/cups/http-private.h | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/cups/libs/cups/http-private.h b/cups/libs/cups/http-private.h -index 99a85c3..a674852 100644 ---- a/cups/libs/cups/http-private.h -+++ b/cups/libs/cups/http-private.h -@@ -80,7 +80,6 @@ typedef int socklen_t; - # elif defined HAVE_GNUTLS - # include - # include --# include - # elif defined(HAVE_CDSASSL) - # include - # include --- -1.8.3.1 - diff --git a/meta/recipes-extended/ghostscript/ghostscript/do-not-check-local-libpng-source.patch b/meta/recipes-extended/ghostscript/ghostscript/do-not-check-local-libpng-source.patch deleted file mode 100644 index 13e71c824f..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/do-not-check-local-libpng-source.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 108a7d3f79af8c669af129bd87401402e76edfa9 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Mon, 18 Jan 2016 01:00:30 -0500 -Subject: [PATCH] configure.ac: do not check local png source - -In oe-core, it did not need to compile local libpng -source in ghostscript, so do not check local png -source, and directly check the existance of shared -libpng library. - -Upstream-Status: Inappropriate [OE-Core specific] - -Signed-off-by: Hongxu Jia - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index bb57825..389c473 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1441,7 +1441,7 @@ else - PNGDEVS='' - PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha png16malpha' - AC_MSG_CHECKING([for local png library source]) -- if test -f $srcdir/libpng/pngread.c; then -+ if false; then - AC_MSG_RESULT([yes]) - SHARE_LIBPNG=0 - LIBPNGDIR=$srcdir/libpng diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch deleted file mode 100644 index 5b57da2a97..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 04a86a613e0f9bfbbad99874f72217f75e8c53a3 Mon Sep 17 00:00:00 2001 -From: Robert Yang -Date: Thu, 29 Mar 2018 15:59:05 +0800 -Subject: [PATCH] contrib.mak: fix for parallel build - -Upstream-Status: Pending - -Signed-off-by: Robert Yang - -Rebase to 9.23 -Signed-off-by: Hongxu Jia - ---- - contrib/contrib.mak | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/contrib/contrib.mak b/contrib/contrib.mak -index 2edee7a..c9100e8 100644 ---- a/contrib/contrib.mak -+++ b/contrib/contrib.mak -@@ -1241,6 +1241,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH) \ - ### ----------------- Additional .upp files ---------------- ### - - extra-upp-install: install-libdata -+ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib - for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \ - $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \ - done diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch deleted file mode 100644 index a382c7f891..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0124b1c29b9cfe46d73ae82ce023dd7c5b055744 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Thu, 29 Mar 2018 16:36:12 +0800 -Subject: [PATCH 09/10] ghostscript-native:fix disable-system-libtiff - -Modify configure to add the check to make sure -ghostscrip could work while system-libtiff is -disabled. - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia - -Rebase to ghostscript 9.25. - -Signed-off-by: Hongxu Jia -Signed-off-by: Jagadeesh Krishnanjanappa ---- - configure.ac | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 80a60b1..f3e9efb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1319,6 +1319,7 @@ AC_TRY_COMPILE([], [return 0;], - CFLAGS=$CGLAGS_STORE - - if test x"$SHARE_LIBTIFF" = x"0" ; then -+ if test -e $LIBTIFFDIR/configure; then - echo "Running libtiff configure script..." - olddir=`pwd` - if ! test -d "$LIBTIFFCONFDIR" ; then -@@ -1337,6 +1338,10 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then - - echo - echo "Continuing with Ghostscript configuration..." -+ else -+ AC_MSG_NOTICE([Could not find local copy of libtiff. -+Disabling tiff output devices.]) -+ fi - fi - - AC_SUBST(SHARE_LIBTIFF) --- -1.8.3.1 - diff --git a/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch b/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch deleted file mode 100644 index 3e6d3e3c48..0000000000 --- a/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 2b23026f8e2a352417fb1c4da94bf69b19bef267 Mon Sep 17 00:00:00 2001 -From: Joe Slater -Date: Thu, 29 Mar 2018 16:04:32 +0800 -Subject: [PATCH 05/10] ghostscript: allow directories to be created more than - once - -When doing parallel builds, we might try to create directories -more than once. This should not cause an error. - -Upstream-Status: Pending - -Signed-off-by: Joe Slater - -Rebase to 9.23 -Signed-off-by: Hongxu Jia ---- - base/unix-end.mak | 17 ++++++++--------- - 1 file changed, 8 insertions(+), 9 deletions(-) - -diff --git a/base/unix-end.mak b/base/unix-end.mak -index 9ce599a..feff5a6 100644 ---- a/base/unix-end.mak -+++ b/base/unix-end.mak -@@ -17,15 +17,14 @@ - UNIX_END_MAK=$(GLSRC)unix-end.mak $(TOP_MAKEFILES) - # Define the rule for building standard configurations. - directories: $(UNIX_END_MAK) -- @if test "$(BINDIR)" != "" -a ! -d $(BINDIR); then mkdir $(BINDIR); fi -- @if test "$(GLGENDIR)" != "" -a ! -d $(GLGENDIR); then mkdir $(GLGENDIR); fi -- @if test "$(GLOBJDIR)" != "" -a ! -d $(GLOBJDIR); then mkdir $(GLOBJDIR); fi -- @if test "$(DEVGENDIR)" != "" -a ! -d $(DEVGENDIR); then mkdir $(DEVGENDIR); fi -- @if test "$(DEVOBJDIR)" != "" -a ! -d $(DEVOBJDIR); then mkdir $(DEVOBJDIR); fi -- @if test "$(AUXDIR)" != "" -a ! -d $(AUXDIR); then mkdir $(AUXDIR); fi -- @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR); then mkdir $(PSGENDIR); fi -- @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR)/cups; then mkdir $(PSGENDIR)/cups; fi -- @if test "$(PSOBJDIR)" != "" -a ! -d $(PSOBJDIR); then mkdir $(PSOBJDIR); fi -+ @if test "$(BINDIR)" != "" -a ! -d $(BINDIR); then mkdir -p $(BINDIR); fi -+ @if test "$(GLGENDIR)" != "" -a ! -d $(GLGENDIR); then mkdir -p $(GLGENDIR); fi -+ @if test "$(GLOBJDIR)" != "" -a ! -d $(GLOBJDIR); then mkdir -p $(GLOBJDIR); fi -+ @if test "$(DEVGENDIR)" != "" -a ! -d $(DEVGENDIR); then mkdir -p $(DEVGENDIR); fi -+ @if test "$(DEVOBJDIR)" != "" -a ! -d $(DEVOBJDIR); then mkdir -p $(DEVOBJDIR); fi -+ @if test "$(AUXDIR)" != "" -a ! -d $(AUXDIR); then mkdir -p $(AUXDIR); fi -+ @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR)/cups; then mkdir -p $(PSGENDIR)/cups; fi -+ @if test "$(PSOBJDIR)" != "" -a ! -d $(PSOBJDIR); then mkdir -p $(PSOBJDIR); fi - - - gs: .gssubtarget $(UNIX_END_MAK) --- -1.8.3.1 - diff --git a/meta/recipes-extended/ghostscript/ghostscript_10.01.1.bb b/meta/recipes-extended/ghostscript/ghostscript_10.01.1.bb index 5d4b8cdc91..f03ebf4478 100644 --- a/meta/recipes-extended/ghostscript/ghostscript_10.01.1.bb +++ b/meta/recipes-extended/ghostscript/ghostscript_10.01.1.bb @@ -13,91 +13,50 @@ SECTION = "console/utils" LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=f98ffa763e50cded76f49bce73aade16" -DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng" -DEPENDS:class-native = "libpng-native" +DEPENDS = "tiff jpeg fontconfig cups libpng freetype zlib" UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases" UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)\.tar" -# As of ghostscript 9.54.0 the jpeg issue in the CVE is present in the gs jpeg sources -# however we use an external jpeg which doesn't have the issue. +# We use a system libjpeg-turbo which has this fix CVE_CHECK_IGNORE += "CVE-2013-6629" def gs_verdir(v): return "".join(v.split(".")) -SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \ - file://ghostscript-9.15-parallel-make.patch \ - file://ghostscript-9.16-Werror-return-type.patch \ - file://do-not-check-local-libpng-source.patch \ - file://avoid-host-contamination.patch \ - file://mkdir-p.patch \ +SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \ + file://ghostscript-9.16-Werror-return-type.patch \ + file://avoid-host-contamination.patch \ " -SRC_URI = "${SRC_URI_BASE} \ - file://cups-no-gcrypt.patch \ - " - -SRC_URI:class-native = "${SRC_URI_BASE} \ - file://ghostscript-9.21-native-fix-disable-system-libtiff.patch \ - file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \ - " - SRC_URI[sha256sum] = "4df18a808cd4369f25e02dbcec2f133cb6d674627b2c6b1502020e58d43e32ce" -# Put something like -# -# PACKAGECONFIG:append:pn-ghostscript = " x11" -# -# in local.conf to enable building with X11. Be careful. The order -# of the overrides matters! -# -#PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" -PACKAGECONFIG:class-native = "" - +PACKAGECONFIG ??= "" +PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3" +PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn" +PACKAGECONFIG[libpaper] = "--with-libpaper,--without-libpaper,libpaper" PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \ - --without-x, virtual/libx11 libxext libxt gtk+3\ - " + --without-x, virtual/libx11 libxext libxt" -EXTRA_OECONF = "--without-libpaper --with-system-libtiff --with-jbig2dec \ +EXTRA_OECONF = "--with-jbig2dec \ --with-fontpath=${datadir}/fonts \ - --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \ - --with-cups-datadir=${datadir}/cups \ CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \ + PKGCONFIG=pkg-config \ " EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0" -# Explicity disable libtiff, fontconfig, -# freetype, cups for ghostscript-native -EXTRA_OECONF:class-native = "--without-x --with-system-libtiff=no \ - --without-libpaper \ - --with-fontpath=${datadir}/fonts \ - --without-libidn --disable-fontconfig \ - --enable-freetype --disable-cups " +# Uses autoconf but not automake, can't do out-of-tree +inherit autotools-brokensep pkgconfig -# This has been fixed upstream but for now we need to subvert the check for time.h -# http://bugs.ghostscript.com/show_bug.cgi?id=692443 -# http://bugs.ghostscript.com/show_bug.cgi?id=692426 -CFLAGS += "-DHAVE_SYS_TIME_H=1" -BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1" - -inherit autotools-brokensep - -do_configure:prepend:class-target () { - rm -rf ${S}/jpeg/ -} - -do_configure:append () { - # copy tools from the native ghostscript build - if [ "${PN}" != "ghostscript-native" ]; then - mkdir -p obj/aux soobj - for i in genarch genconf mkromfs echogs gendev genht packps; do - cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i - done - fi +# Prune the source tree of libraries that we're using our packaging of, so that +# ghostscript can't link to them. Can't prune zlib as that's needed for the +# native tools. +prune_sources() { + rm -rf ${S}/jpeg/ ${S}/libpng/ ${S}/tiff/ ${S}/expat/ ${S}/freetype/ ${S}/cups/lib } +do_unpack[postfuncs] += "prune_sources" do_install:append () { mkdir -p ${D}${datadir}/ghostscript/${PV}/ @@ -105,22 +64,6 @@ do_install:append () { cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/ } -do_compile:class-native () { - mkdir -p obj - for i in genarch genconf mkromfs echogs gendev genht packps; do - oe_runmake obj/aux/$i - done -} - -do_install:class-native () { - install -d ${D}${bindir}/ghostscript-${PV} - for i in genarch genconf mkromfs echogs gendev genht packps; do - install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i - done -} - -BBCLASSEXTEND = "native" - # ghostscript does not supports "arc" COMPATIBLE_HOST = "^(?!arc).*"