git: ef459e364a89 - main - print/ghostscript9-agpl-{base,x11}: update to 9.55.0

From: Hiroki Sato <hrs_at_FreeBSD.org>
Date: Fri, 04 Mar 2022 12:43:20 UTC
The branch main has been updated by hrs:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ef459e364a895b94045b1c261fe3fd9df06b7043

commit ef459e364a895b94045b1c261fe3fd9df06b7043
Author:     Hiroki Sato <hrs@FreeBSD.org>
AuthorDate: 2022-03-04 12:42:49 +0000
Commit:     Hiroki Sato <hrs@FreeBSD.org>
CommitDate: 2022-03-04 12:42:49 +0000

    print/ghostscript9-agpl-{base,x11}: update to 9.55.0
    
    - pdfocr{8,24,32} for Tesseract OCR engine have been added.
    
    Security:       CVE-2021-3781
---
 print/ghostscript9-agpl-base/Makefile              | 26 +++++------
 print/ghostscript9-agpl-base/distinfo              |  6 +--
 print/ghostscript9-agpl-base/files/patch-configure | 19 ++------
 .../ghostscript9-agpl-base/files/patch-git_41ef9a0 | 51 ----------------------
 print/ghostscript9-agpl-base/files/patch-lcms2mt   | 22 ----------
 .../files/patch-psi-zstring.c                      | 27 ------------
 print/ghostscript9-agpl-base/pkg-plist             |  7 ++-
 print/ghostscript9-agpl-x11/Makefile               |  9 ++--
 8 files changed, 27 insertions(+), 140 deletions(-)

diff --git a/print/ghostscript9-agpl-base/Makefile b/print/ghostscript9-agpl-base/Makefile
index 3417eb48b3a8..ca1165a7847c 100644
--- a/print/ghostscript9-agpl-base/Makefile
+++ b/print/ghostscript9-agpl-base/Makefile
@@ -1,11 +1,10 @@
 PORTNAME=	ghostscript
-PORTVERSION=	9.52
-PORTREVISION=	20
+PORTVERSION=	9.55.0
 CATEGORIES=	print
 MASTER_SITES=	https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${PORTVERSION:S/.//}/
 PKGNAMESUFFIX=	9-agpl-base
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	hrs@FreeBSD.org
 COMMENT=	PostScript and PDF interpreter
 
 LICENSE=	AGPLv3
@@ -16,13 +15,13 @@ LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
 		libfreetype.so:print/freetype2 \
 		libidn.so:dns/libidn \
 		libjbig2dec.so:graphics/jbig2dec \
+		libopenjp2.so:graphics/openjpeg \
 		libpaper.so:print/libpaper \
 		libpng.so:graphics/png \
 		libtiff.so:graphics/tiff
 RUN_DEPENDS=	poppler-data>=0.4.9:graphics/poppler-data
 
 USES=		cpe gmake iconv jpeg localbase pkgconfig tar:xz
-USE_CSTD=	gnu99
 USE_LDCONFIG=	yes
 
 CONFLICTS_INSTALL= \
@@ -50,6 +49,7 @@ CONFIGURE_ARGS=	--disable-compile-inits \
 		--enable-dynamic \
 		--enable-fontconfig \
 		--enable-freetype \
+		--enable-openjpeg \
 		--with-drivers=ALL \
 		--with-fontpath=${LOCALBASE}/share/fonts \
 		--with-jbig2dec \
@@ -60,10 +60,11 @@ CONFIGURE_ARGS=	--disable-compile-inits \
 		--without-x
 ALL_TARGET=	so
 INSTALL_TARGET=	soinstall
-PLIST_SUB=	GS_VERSION="${PORTVERSION}"
+PLIST_SUB=	GS_VERSION="${PORTVERSION:S/.0$//}" \
+		PORTVERSION="${PORTVERSION}"
 
-OPTIONS_DEFINE=	DOCS CUPS IJS JPEG2000
-OPTIONS_DEFAULT=CUPS
+OPTIONS_DEFINE=	DOCS CUPS IJS
+OPTIONS_DEFAULT=DOCS CUPS
 OPTIONS_SUB=	yes
 
 CUPS_CONFIGURE_ENABLE=	cups
@@ -73,9 +74,6 @@ IJS_CONFIGURE_WITH=	ijs
 IJS_DESC=		Support libijs based Ghostscript devices
 IJS_LIB_DEPENDS=	libijs.so:print/libijs
 
-JPEG2000_CONFIGURE_ENABLE=	openjpeg
-JPEG2000_LIB_DEPENDS=	libopenjp2.so:graphics/openjpeg
-
 post-install:
 	${MV} ${STAGEDIR}${PREFIX}/bin/gsc ${STAGEDIR}${PREFIX}/bin/gs
 	${RM} ${STAGEDIR}${PREFIX}/bin/gsx
@@ -83,15 +81,15 @@ post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgs.so
 	${MKDIR} ${STAGEDIR}${PREFIX}/share/color/icc
 	${MV} ${STAGEDIR}${DATADIR}/iccprofiles \
-		${STAGEDIR}${PREFIX}/share/color/icc/ghostscript
+	    ${STAGEDIR}${PREFIX}/share/color/icc/ghostscript
 	${RLN} ${STAGEDIR}${PREFIX}/share/color/icc/ghostscript \
-		${STAGEDIR}${DATADIR}/iccprofiles
+	    ${STAGEDIR}${DATADIR}/iccprofiles
 	${RLN} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${DATADIR}/doc
 	${MKDIR} ${STAGEDIR}${PREFIX}/share/cmap
 	${MV} ${STAGEDIR}${DATADIR}/Resource/CMap/Identity* \
-		${STAGEDIR}${PREFIX}/share/cmap
+	    ${STAGEDIR}${PREFIX}/share/cmap
 	${RM} -r ${STAGEDIR}${DATADIR}/Resource/CMap
 	${RLN} ${STAGEDIR}${PREFIX}/share/cmap \
-		${STAGEDIR}${DATADIR}/Resource/CMap
+	    ${STAGEDIR}${DATADIR}/Resource/CMap
 
 .include <bsd.port.mk>
diff --git a/print/ghostscript9-agpl-base/distinfo b/print/ghostscript9-agpl-base/distinfo
index 233be54b4acb..7ecba27459e1 100644
--- a/print/ghostscript9-agpl-base/distinfo
+++ b/print/ghostscript9-agpl-base/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1584690816
-SHA256 (ghostscript-9.52.tar.xz) = 57442acf8b46453a9b5fc6fec738fbbb7e13a3d3e00f1aaaa0975529bc203c7c
-SIZE (ghostscript-9.52.tar.xz) = 39711040
+TIMESTAMP = 1634973195
+SHA256 (ghostscript-9.55.0.tar.xz) = 6ee3057773646d6a2c6d117eb53a17d6752feadc513828e4322f68b7b7789ff6
+SIZE (ghostscript-9.55.0.tar.xz) = 67417724
diff --git a/print/ghostscript9-agpl-base/files/patch-configure b/print/ghostscript9-agpl-base/files/patch-configure
index ac61ae458e08..73d694ba2be5 100644
--- a/print/ghostscript9-agpl-base/files/patch-configure
+++ b/print/ghostscript9-agpl-base/files/patch-configure
@@ -1,17 +1,6 @@
---- configure.orig	2020-03-19 08:22:25 UTC
+--- configure.orig	2021-09-27 07:44:02 UTC
 +++ configure
-@@ -4522,8 +4522,8 @@ case $host in
-         ;;
-         *bsd*)
-         if test $ac_cv_c_compiler_gnu = yes; then
--            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
--            CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
-+            CC_OPT_FLAGS_TO_TRY=""
-+            CC_DBG_FLAGS_TO_TRY=""
-         fi
-         ;;
-         *-darwin*)
-@@ -5357,7 +5357,7 @@ if test "${enable_threadsafe+set}" = set; then :
+@@ -5539,7 +5539,7 @@ if test "${enable_threadsafe+set}" = set; then :
  fi
  
  if test x$enable_threadsafe = xyes ; then
@@ -20,7 +9,7 @@
  fi
  
  
-@@ -10683,42 +10683,42 @@ if test x$enable_threadsafe = xyes; then
+@@ -11352,42 +11352,42 @@ if test x$enable_threadsafe = xyes; then
  
    for ntsdev in $NTS_DEVS ; do
      NTS_EXCLUDES="$(echo \"$P_DEVS0{@:0}\" | grep -o $ntsdev) $NTS_EXCLUDES"
@@ -71,7 +60,7 @@
    done
  
    NTS_EXCLUDES=`echo "$NTS_EXCLUDES" | tr " " "\n" | sort | uniq | tr "\n" " "`
-@@ -10970,7 +10970,12 @@ if test "${enable_dynamic+set}" = set; then :
+@@ -11686,7 +11686,12 @@ if test "${enable_dynamic+set}" = set; then :
          DBG_CFLAGS="$DYNAMIC_CFLAGS $DBG_CFLAGS"
        ;;
        *bsd*)
diff --git a/print/ghostscript9-agpl-base/files/patch-git_41ef9a0 b/print/ghostscript9-agpl-base/files/patch-git_41ef9a0
deleted file mode 100644
index 9c26e436ca82..000000000000
--- a/print/ghostscript9-agpl-base/files/patch-git_41ef9a0
+++ /dev/null
@@ -1,51 +0,0 @@
-From 41ef9a0bc36b9db7115fbe9623f989bfb47bbade Mon Sep 17 00:00:00 2001
-From: Chris Liddell <chris.liddell@artifex.com>
-Date: Tue, 20 Oct 2020 09:49:45 +0100
-Subject: [PATCH] Bug 702985: drop use of FT_CALLBACK_DEF() def
-
-From 2.10.3, Freetype disappeared the FT_CALLBACK_DEF() macro, which is what
-we used when defining our callbacks from Freetype.
-
-No guidance forthcoming from the Freetype developer who made those changes,
-so change to explicitly declaring the callbacks file static.
-
-Should fix the reported build failures.
----
- base/fapi_ft.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/base/fapi_ft.c b/base/fapi_ft.c
-index 65fa6dcf4..21aef2f06 100644
---- base/fapi_ft.c
-+++ base/fapi_ft.c
-@@ -125,7 +125,7 @@ static void
- delete_inc_int_info(gs_fapi_server * a_server,
-                     FT_IncrementalRec * a_inc_int_info);
- 
--FT_CALLBACK_DEF(void *)
-+static void *
- FF_alloc(FT_Memory memory, long size)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
-     return (gs_malloc(mem, size, 1, "FF_alloc"));
- }
- 
--FT_CALLBACK_DEF(void *)
-+static void *
-     FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
-     return (tmp);
- }
- 
--FT_CALLBACK_DEF(void)
-+static void
-     FF_free(FT_Memory memory, void *block)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
--- 
-2.17.1
-
-
diff --git a/print/ghostscript9-agpl-base/files/patch-lcms2mt b/print/ghostscript9-agpl-base/files/patch-lcms2mt
deleted file mode 100644
index fc0b9a697231..000000000000
--- a/print/ghostscript9-agpl-base/files/patch-lcms2mt
+++ /dev/null
@@ -1,22 +0,0 @@
---- Makefile.in.orig	2020-03-19 08:21:42 UTC
-+++ Makefile.in
-@@ -462,6 +462,8 @@ DBUS_LIBS=@DBUS_LIBS@
- # defines from autoconf; note that we don't use all of these at present.
- ACDEFS=@DEFS@
- 
-+CFLAGS_VISIBILITY="-fvisibility=hidden"
-+
- CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(AC_CFLAGS) $(XCFLAGS) @CLUSTER_CFLAGS@
- CFLAGSAUX=$(CFLAGSAUX_STANDARD) $(GCFLAGSAUX) $(XCFLAGSAUX)
- 
---- base/lcms2mt.mak.orig	2020-03-19 08:21:42 UTC
-+++ base/lcms2mt.mak
-@@ -80,7 +80,7 @@ lcms2.config-clean :
- 
- # NB: we can't use the normal $(CC_) here because msvccmd.mak
- # adds /Za which conflicts with the lcms source.
--LCMS2_CC=$(CC) $(D_)SHARE_LCMS=$(SHARE_LCMS)$(_D) $(GENOPT) $(CAPOPT) $(CFLAGS) $(LCMS2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(LCMS2CF_)
-+LCMS2_CC=$(CC) $(CFLAGS_VISIBILITY) $(D_)SHARE_LCMS=$(SHARE_LCMS)$(_D) $(GENOPT) $(CAPOPT) $(CFLAGS) $(LCMS2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(LCMS2CF_)
- LCMS2O_=$(O_)$(LCMS2OBJ)
- 
- # switch in the version of lcms2mt.dev we're actually using
diff --git a/print/ghostscript9-agpl-base/files/patch-psi-zstring.c b/print/ghostscript9-agpl-base/files/patch-psi-zstring.c
deleted file mode 100644
index 77b1b8fc2178..000000000000
--- a/print/ghostscript9-agpl-base/files/patch-psi-zstring.c
+++ /dev/null
@@ -1,27 +0,0 @@
---- psi/zstring.c.orig	2020-03-19 08:21:42 UTC
-+++ psi/zstring.c
-@@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward)
-     return 0;
- found:
-     op->tas.type_attrs = op1->tas.type_attrs;
--    op->value.bytes = ptr;
--    r_set_size(op, size);
-+    op->value.bytes = ptr;                             /* match */
-+    op->tas.rsize = size;                              /* match */
-     push(2);
--    op[-1] = *op1;
--    r_set_size(op - 1, ptr - op[-1].value.bytes);
--    op1->value.bytes = ptr + size;
--    r_set_size(op1, count + (!forward ? (size - 1) : 0));
-+    op[-1] = *op1;                                     /* pre */
-+    op[-3].value.bytes = ptr + size;                   /* post */
-+    if (forward) {
-+        op[-1].tas.rsize = ptr - op[-1].value.bytes;   /* pre */
-+        op[-3].tas.rsize = count;                      /* post */
-+    } else {
-+        op[-1].tas.rsize = count;                      /* pre */
-+        op[-3].tas.rsize -= count + size;              /* post */
-+    }
-     make_true(op);
-     return 0;
- }
diff --git a/print/ghostscript9-agpl-base/pkg-plist b/print/ghostscript9-agpl-base/pkg-plist
index eba6d4f8b18c..41a9c125e09d 100644
--- a/print/ghostscript9-agpl-base/pkg-plist
+++ b/print/ghostscript9-agpl-base/pkg-plist
@@ -181,6 +181,7 @@ share/color/icc/ghostscript/srgb.icc
 %%DATADIR%%/Resource/Font/URWGothic-DemiOblique
 %%DATADIR%%/Resource/Font/Z003-MediumItalic
 %%DATADIR%%/Resource/IdiomSet/Pscript5Idiom
+%%DATADIR%%/Resource/IdiomSet/PPI_CUtils
 %%DATADIR%%/Resource/Init/FAPIcidfmap
 %%DATADIR%%/Resource/Init/FAPIconfig
 %%DATADIR%%/Resource/Init/FAPIfontmap
@@ -300,15 +301,13 @@ share/color/icc/ghostscript/srgb.icc
 %%DATADIR%%/lib/cdj690.upp
 %%DATADIR%%/lib/cdj690ec.upp
 %%DATADIR%%/lib/cid2code.ps
-%%DATADIR%%/lib/dmp_init.ps
-%%DATADIR%%/lib/dmp_site.ps
 %%DATADIR%%/lib/dnj750c.upp
 %%DATADIR%%/lib/dnj750m.upp
 %%DATADIR%%/lib/docie.ps
-%%DATADIR%%/lib/escp_24.src
 %%DATADIR%%/lib/font2pcl.ps
 %%DATADIR%%/lib/ghostpdf.ppd
 %%DATADIR%%/lib/gs_ce_e.ps
+%%DATADIR%%/lib/gs_css_e.ps
 %%DATADIR%%/lib/gs_il2_e.ps
 %%DATADIR%%/lib/gs_kanji.ps
 %%DATADIR%%/lib/gs_ksb_e.ps
@@ -404,4 +403,4 @@ share/color/icc/ghostscript/srgb.icc
 %%DATADIR%%/lib/viewps2a.ps
 %%DATADIR%%/lib/winmaps.ps
 %%DATADIR%%/lib/zeroline.ps
-@dir lib/ghostscript/%%GS_VERSION%%
+@dir lib/ghostscript/%%PORTVERSION%%
diff --git a/print/ghostscript9-agpl-x11/Makefile b/print/ghostscript9-agpl-x11/Makefile
index f54407baac66..0110561a409b 100644
--- a/print/ghostscript9-agpl-x11/Makefile
+++ b/print/ghostscript9-agpl-x11/Makefile
@@ -1,10 +1,10 @@
 PORTNAME=	ghostscript
-PORTVERSION=	9.52
+PORTVERSION=	9.55.0
 CATEGORIES=	print
 MASTER_SITES=	https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${PORTVERSION:S/.//}/
 PKGNAMESUFFIX=	9-agpl-x11
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	hrs@FreeBSD.org
 COMMENT=	PostScript and PDF interpreter, X11 support
 
 LICENSE=	AGPLv3
@@ -15,13 +15,13 @@ LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
 		libfreetype.so:print/freetype2 \
 		libidn.so:dns/libidn \
 		libjbig2dec.so:graphics/jbig2dec \
+		libopenjp2.so:graphics/openjpeg \
 		libpaper.so:print/libpaper \
 		libpng.so:graphics/png \
 		libtiff.so:graphics/tiff
 RUN_DEPENDS=	ghostscript9-agpl-base>=${PORTVERSION}:print/ghostscript9-agpl-base
 
 USES=		cpe gmake iconv localbase pkgconfig tar:xz xorg
-USE_CSTD=	gnu99
 USE_LDCONFIG=	yes
 USE_XORG=	ice sm x11 xext xt
 
@@ -51,6 +51,7 @@ CONFIGURE_ARGS=	--disable-compile-inits \
 		--enable-dynamic \
 		--enable-fontconfig \
 		--enable-freetype \
+		--enable-openjpeg \
 		--with-drivers=ALL \
 		--with-fontpath=${LOCALBASE}/share/fonts \
 		--with-jbig2dec \
@@ -63,7 +64,7 @@ CONFIGURE_ARGS=	--disable-compile-inits \
 ALL_TARGET=	./obj/X11.so
 INSTALL_TARGET=	install-shared
 PLIST_FILES=	lib/${PORTNAME}/${PORTVERSION}/X11.so
-	
+
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${PORTVERSION}/X11.so