Index: head/print/ghostscript9-agpl-base/Makefile =================================================================== --- head/print/ghostscript9-agpl-base/Makefile (revision 479242) +++ head/print/ghostscript9-agpl-base/Makefile (revision 479243) @@ -1,92 +1,92 @@ # $FreeBSD$ PORTNAME= ghostscript PORTVERSION= 9.24 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= print MASTER_SITES= https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${PORTVERSION:S/.//}/ PKGNAMESUFFIX= 9-agpl-base MAINTAINER= doceng@FreeBSD.org COMMENT= PostScript and PDF interpreter LICENSE= AGPLv3 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 CONFLICTS_INSTALL= \ ghostscript[789]-[0-9]* \ ghostscript[789]-nox11-[0-9]* \ ghostscript9-agpl-[0-9]* \ ghostscript9-agpl-nox11-[0-9]* USES= cpe gmake iconv jpeg localbase pkgconfig tar:xz USE_CSTD= gnu99 USE_LDCONFIG= yes CPE_VENDOR= artifex DATADIR= ${PREFIX}/share/${PORTNAME}/${PORTVERSION} DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}/${PORTVERSION} GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-compile-inits \ --disable-dbus \ --disable-gtk \ --enable-contrib \ --enable-dynamic \ --enable-fontconfig \ --enable-freetype \ --enable-openjpeg \ --with-drivers=ALL \ --with-fontpath=${LOCALBASE}/share/fonts \ --with-jbig2dec \ --with-libiconv=maybe \ --with-libidn \ --with-libpaper \ --with-system-libtiff \ --without-x ALL_TARGET= so INSTALL_TARGET= soinstall PLIST_SUB= GS_VERSION="${PORTVERSION}" OPTIONS_DEFINE= DOCS CUPS IJS OPTIONS_DEFAULT=CUPS IJS OPTIONS_SUB= yes CUPS_CONFIGURE_ENABLE= cups CUPS_LIB_DEPENDS= libcupsimage.so:print/cups IJS_CONFIGURE_WITH= ijs IJS_DESC= Support libijs based Ghostscript devices IJS_LIB_DEPENDS= libijs.so:print/libijs post-patch: @${RM} -r ${WRKSRC}/freetype ${WRKSRC}/ijs ${WRKSRC}/jbig2dec \ ${WRKSRC}/jpeg ${WRKSRC}/libpng ${WRKSRC}/openjpeg \ ${WRKSRC}/zlib post-install: ${MV} ${STAGEDIR}${PREFIX}/bin/gsc ${STAGEDIR}${PREFIX}/bin/gs ${RM} ${STAGEDIR}${PREFIX}/bin/gsx ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/gs ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgs.so ${MKDIR} ${STAGEDIR}${PREFIX}/share/color/icc ${MV} ${STAGEDIR}${DATADIR}/iccprofiles \ ${STAGEDIR}${PREFIX}/share/color/icc/ghostscript ${RLN} ${STAGEDIR}${PREFIX}/share/color/icc/ghostscript \ ${STAGEDIR}${DATADIR}/iccprofiles ${RLN} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${DATADIR}/doc ${MKDIR} ${STAGEDIR}${PREFIX}/share/cmap ${MV} ${STAGEDIR}${DATADIR}/Resource/CMap/Identity* \ ${STAGEDIR}${PREFIX}/share/cmap ${RM} -r ${STAGEDIR}${DATADIR}/Resource/CMap ${RLN} ${STAGEDIR}${PREFIX}/share/cmap \ ${STAGEDIR}${DATADIR}/Resource/CMap .include Index: head/print/ghostscript9-agpl-base/files/patch-Resource_Init_gs_init.ps =================================================================== --- head/print/ghostscript9-agpl-base/files/patch-Resource_Init_gs_init.ps (revision 479242) +++ head/print/ghostscript9-agpl-base/files/patch-Resource_Init_gs_init.ps (nonexistent) @@ -1,10 +0,0 @@ ---- Resource/Init/gs_init.ps.orig 2018-09-03 08:50:27 UTC -+++ Resource/Init/gs_init.ps -@@ -2041,6 +2041,7 @@ readonly def - % Default resources (OpenVMS, see comment above.) : - [ currentsystemparams /GenericResourceDir get] (*) .file_name_separator (*) - concatstrings concatstrings .generate_dir_list_templates -+ currentuserparams /ICCProfilesDir get copystring dup dup length 1 sub (*) putinterval - } if - ] - /PermitFileWriting [ Property changes on: head/print/ghostscript9-agpl-base/files/patch-Resource_Init_gs_init.ps ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/print/ghostscript9-agpl-base/files/patch-010-bc3df07 =================================================================== --- head/print/ghostscript9-agpl-base/files/patch-010-bc3df07 (nonexistent) +++ head/print/ghostscript9-agpl-base/files/patch-010-bc3df07 (revision 479243) @@ -0,0 +1,75 @@ +From: Chris Liddell +Date: Tue, 4 Sep 2018 16:01:08 +0000 (+0100) +Subject: For ICC profile validation, have cups id iteself as DeviceN +X-Git-Url: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff_plain;h=bc3df0773fccf4b4906a3e59652ad646ea0fee91 + +For ICC profile validation, have cups id iteself as DeviceN + +Give the range of color spaces and models that cups supports, we can't +reasonably provide (or expect others to provide) output ICC profiles for all +cases. + +For the purpose of profile validation, have it claim to be DeviceN and benefit +from the extra tolerance in profiles allowed for that class of device. +--- + +diff --git a/cups/gdevcups.c b/cups/gdevcups.c +index c1574f8..decd8eb 100644 +--- cups/gdevcups.c ++++ cups/gdevcups.c +@@ -70,6 +70,7 @@ + #include "std.h" /* to stop stdlib.h redefining types */ + #include "gdevprn.h" + #include "gsparam.h" ++#include "gxdevsop.h" + #include "arch.h" + #include "gsicc_manage.h" + +@@ -252,6 +253,7 @@ private int cups_put_params(gx_device *, gs_param_list *); + private int cups_set_color_info(gx_device *); + private dev_proc_sync_output(cups_sync_output); + private prn_dev_proc_get_space_params(cups_get_space_params); ++private int cups_spec_op(gx_device *dev_, int op, void *data, int datasize); + + #ifdef dev_t_proc_encode_color + private cm_map_proc_gray(cups_map_gray); +@@ -392,7 +394,7 @@ private gx_device_procs cups_procs = + NULL, /* push_transparency_state */ + NULL, /* pop_transparency_state */ + NULL, /* put_image */ +- ++ cups_spec_op + }; + + #define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\ +@@ -5927,6 +5929,17 @@ cups_print_planar(gx_device_printer *pdev, + return (0); + } + ++private int ++cups_spec_op(gx_device *dev_, int op, void *data, int datasize) ++{ ++ /* Although not strictly DeviceN, the range of color models ++ this device supports presets similar issues. ++ */ ++ if (op == gxdso_supports_devn) { ++ return true; ++ } ++ return gx_default_dev_spec_op(dev_, op, data, datasize); ++} + + /* + */ +diff --git a/devices/devs.mak b/devices/devs.mak +index c85604c..e8654e5 100644 +--- devices/devs.mak ++++ devices/devs.mak +@@ -1860,7 +1860,7 @@ $(DD)pwgraster.dev : $(lcups_dev) $(lcupsi_dev) $(cups_) $(GDEV) \ + $(ADDMOD) $(DD)pwgraster -include $(lcups_dev) + $(ADDMOD) $(DD)pwgraster -include $(lcupsi_dev) + +-$(DEVOBJ)gdevcups.$(OBJ) : $(LCUPSSRCDIR)$(D)gdevcups.c $(std_h) $(DEVS_MAK) $(MAKEDIRS) ++$(DEVOBJ)gdevcups.$(OBJ) : $(LCUPSSRCDIR)$(D)gdevcups.c $(std_h) $(gxdevsop_h) $(DEVS_MAK) $(MAKEDIRS) + $(CUPS_CC) $(DEVO_)gdevcups.$(OBJ) $(C_) $(CFLAGS) $(CUPSCFLAGS) \ + $(I_)$(GLSRC) \ + $(I_)$(DEVSRC) \ Property changes on: head/print/ghostscript9-agpl-base/files/patch-010-bc3df07 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/print/ghostscript9-agpl-base/files/patch-020-c8c01f8 =================================================================== --- head/print/ghostscript9-agpl-base/files/patch-020-c8c01f8 (nonexistent) +++ head/print/ghostscript9-agpl-base/files/patch-020-c8c01f8 (revision 479243) @@ -0,0 +1,42 @@ +From c8c01f8c4164bc10281d9e8f87cf96314d93104b Mon Sep 17 00:00:00 2001 +From: Chris Liddell +Date: Thu, 6 Sep 2018 14:08:41 +0100 +Subject: [PATCH] Bug 699722: Add the ICCProfilesDir to the PermitReading list + +There was also an issue that the string being returned from the graphics +library was null terminated, and Postscript strings are not (and Ghostscript +strings are not necessarily). We leave the null termination in place, but +reduce the length returned by 1. +--- + Resource/Init/gs_init.ps | 1 + + base/gsicc_manage.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps +index bc8b795..83918a9 100644 +--- Resource/Init/gs_init.ps ++++ Resource/Init/gs_init.ps +@@ -2049,6 +2049,7 @@ readonly def + [ currentsystemparams /GenericResourceDir get] (*) .file_name_separator (*) + concatstrings concatstrings .generate_dir_list_templates + } if ++ currentuserparams /ICCProfilesDir known {currentuserparams /ICCProfilesDir get} if + ] + /PermitFileWriting [ + currentuserparams /PermitFileWriting get aload pop +diff --git a/base/gsicc_manage.c b/base/gsicc_manage.c +index 69f05c4..ff685e7 100644 +--- base/gsicc_manage.c ++++ base/gsicc_manage.c +@@ -2972,7 +2972,7 @@ gs_currenticcdirectory(const gs_gstate * pgs, gs_param_string * pval) + pval->persistent = true; + } else { + pval->data = (const byte *)(lib_ctx->profiledir); +- pval->size = lib_ctx->profiledir_len; ++ pval->size = lib_ctx->profiledir_len - 1; + pval->persistent = false; + } + } +-- +2.9.1 + Property changes on: head/print/ghostscript9-agpl-base/files/patch-020-c8c01f8 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/print/ghostscript9-agpl-base/files/patch-030-1341854 =================================================================== --- head/print/ghostscript9-agpl-base/files/patch-030-1341854 (nonexistent) +++ head/print/ghostscript9-agpl-base/files/patch-030-1341854 (revision 479243) @@ -0,0 +1,54 @@ +From 13418541a5ae19b15f51cbb87faf344902f5af98 Mon Sep 17 00:00:00 2001 +From: Chris Liddell +Date: Thu, 6 Sep 2018 18:40:05 +0100 +Subject: [PATCH] Bug 699722 (2): add wildcards to the permissions paths. + +The temp and ICC profile paths need to finish with wildcards to work correctly. +--- + Resource/Init/gs_init.ps | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps +index 83918a9..5ff9f63 100644 +--- Resource/Init/gs_init.ps ++++ Resource/Init/gs_init.ps +@@ -2034,7 +2034,7 @@ readonly def + << + /PermitFileReading [ + currentuserparams /PermitFileReading get aload pop +- //tempfilepaths aload pop ++ [//tempfilepaths aload pop] (*) .generate_dir_list_templates + /FONTPATH .systemvar (*) .generate_dir_list_templates + % Library files : + /LIBPATH .systemvar (*) .generate_dir_list_templates +@@ -2049,15 +2049,15 @@ readonly def + [ currentsystemparams /GenericResourceDir get] (*) .file_name_separator (*) + concatstrings concatstrings .generate_dir_list_templates + } if +- currentuserparams /ICCProfilesDir known {currentuserparams /ICCProfilesDir get} if ++ currentuserparams /ICCProfilesDir known {[currentuserparams /ICCProfilesDir get] (*) .generate_dir_list_templates} if + ] + /PermitFileWriting [ + currentuserparams /PermitFileWriting get aload pop +- //tempfilepaths aload pop ++ [//tempfilepaths aload pop] (*) .generate_dir_list_templates + ] + /PermitFileControl [ + currentuserparams /PermitFileControl get aload pop +- //tempfilepaths aload pop ++ [//tempfilepaths aload pop] (*) .generate_dir_list_templates + ] + /LockFilePermissions //true + >> setuserparams +@@ -2140,7 +2140,7 @@ SAFER { .setsafeglobal } if + /.setshapealpha % transparency-example.ps + /.endtransparencygroup % transparency-example.ps + /.setdotlength % Bug687720.ps +- /.sort /.setdebug /.mementolistnewblocks /getenv ++ /.sort /.mementolistnewblocks /getenv + + /.makeoperator /.setCPSImode % gs_cet.ps, this won't work on cluster with -dSAFER + +-- +2.9.1 + Property changes on: head/print/ghostscript9-agpl-base/files/patch-030-1341854 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/print/ghostscript9-agpl-base/files/patch-040-9528102 =================================================================== --- head/print/ghostscript9-agpl-base/files/patch-040-9528102 (nonexistent) +++ head/print/ghostscript9-agpl-base/files/patch-040-9528102 (revision 479243) @@ -0,0 +1,103 @@ +From 95281026d983bff8f72e431c7f620a0e8d07c2af Mon Sep 17 00:00:00 2001 +From: Ken Sharp +Date: Sat, 8 Sep 2018 09:47:19 +0100 +Subject: [PATCH] Bug 699744 "ps2epsi fails with Error: /undefined in + --setpagedevice--" + +Recent changes required to harden SAFER mode mean that it is no longer +possible to run this script in SAFER mode, because it relies upon +unsafe Ghostscript non-standard extension operators. + +Removing SAFER and DELAYSAFER, and the code to reset SAFER, allow the +program to run as well as it ever did (ie badly). This program should +now be considered unsafe, you should not use it on untrusted PostScript +programs. + +I think its likely we will deprecate and remove this program in future. +--- + lib/ps2epsi | 4 ++-- + lib/ps2epsi.bat | 6 +++--- + lib/ps2epsi.cmd | 4 ++-- + lib/ps2epsi.ps | 1 - + 4 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/lib/ps2epsi b/lib/ps2epsi +index 5e1c173..d992180 100755 +--- lib/ps2epsi ++++ lib/ps2epsi +@@ -49,7 +49,7 @@ else + outfile=$2 + fi + +-"$GS_EXECUTABLE" -q -dBATCH -dNOPAUSE -P- -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=/dev/null "${infile}" 2>${outfile} ++"$GS_EXECUTABLE" -q -dBATCH -dNOPAUSE -P- -sDEVICE=bbox -sOutputFile=/dev/null "${infile}" 2>${outfile} + + ls -l "${infile}" | + awk 'F==1 { +@@ -91,7 +91,7 @@ awk 'F==1 { + } + ' F=1 - F=2 "${outfile}" >>"$tmpfile" + +-"$GS_EXECUTABLE" -q -dNOPAUSE -P- -dSAFER -dDELAYSAFER -r72 -sDEVICE=bit -sOutputFile=/dev/null "$tmpfile" ps2epsi.ps "$tmpfile" <"${infile}" 1>&2 ++"$GS_EXECUTABLE" -q -dNOPAUSE -P- -r72 -sDEVICE=bit -sOutputFile=/dev/null "$tmpfile" ps2epsi.ps "$tmpfile" <"${infile}" 1>&2 + rm -f "$tmpfile" + rm -rf "$tmpdir" + +diff --git a/lib/ps2epsi.bat b/lib/ps2epsi.bat +index 3c40aef..f5e7b3e 100755 +--- lib/ps2epsi.bat ++++ lib/ps2epsi.bat +@@ -9,10 +9,10 @@ set outfile=%~2 + + rem First we need to determine the bounding box. ps2epsi.ps below will pick + rem the result up from %outfile% +-%GSC% -q -dNOPAUSE -dBATCH -P- -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=NUL %1 2> %2 ++%GSC% -q -dNOPAUSE -dBATCH -P- -sDEVICE=bbox -sOutputFile=NUL %1 2> %2 + + rem Ghostscript uses %outfile% to define the output file +-%GSC% -q -dNOPAUSE -P- -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %1 ++%GSC% -q -dNOPAUSE -P- -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %1 + + rem We bracket the actual file with a few commands to help encapsulation + echo %%%%Page: 1 1 >> %2 +@@ -22,7 +22,7 @@ echo userdict /setpagedevice /pop load put >> %2 + + rem Append the original onto the preview header + rem cat.ps uses the %infile% and %outfile% environment variables for the filenames +-%GSC% -q -dNOPAUSE -dBATCH -P- -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL cat.ps ++%GSC% -q -dNOPAUSE -dBATCH -P- -sDEVICE=bit -sOutputFile=NUL cat.ps + + + echo %%%%EndDocument >> %2 +diff --git a/lib/ps2epsi.cmd b/lib/ps2epsi.cmd +index abbe8a8..9eafdbd 100755 +--- lib/ps2epsi.cmd ++++ lib/ps2epsi.cmd +@@ -12,10 +12,10 @@ set outfile=%2 + + rem First we need to determine the bounding box. ps2epsi.ps below will pick + rem the result up from %outfile% +-gsos2 -q -dNOPAUSE -dBATCH -P- -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=NUL %infile% 2> %outfile% ++gsos2 -q -dNOPAUSE -dBATCH -P- -sDEVICE=bbox -sOutputFile=NUL %infile% 2> %outfile% + + rem Ghostscript uses %outfile% to define the output file +-gsos2 -q -dNOPAUSE -P- -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile% ++gsos2 -q -dNOPAUSE -P- -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile% + + rem We bracket the actual file with a few commands to help encapsulation + echo %%%%Page: 1 1 >> %outfile% +diff --git a/lib/ps2epsi.ps b/lib/ps2epsi.ps +index 3cd970a..4bc5217 100644 +--- lib/ps2epsi.ps ++++ lib/ps2epsi.ps +@@ -84,7 +84,6 @@ ps2edict begin + userdict /showpage { ps2edict begin epsipage end } bind put + userdict /setfont { ps2edict begin epsisetfont end } bind put + userdict /setpagedevice /pop load put +- //systemdict /.setsafe known { .setsafe } if + } bind def + + /epsifontdict 100 dict def +-- +2.9.1 + Property changes on: head/print/ghostscript9-agpl-base/files/patch-040-9528102 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property