ports/76731: [PATCH] make cups-pstoraster GHOSTSCRIPT_PORT aware

Jose M Rodriguez josemi at freebsd.jazztel.es
Wed Jan 26 22:20:17 UTC 2005


>Number:         76731
>Category:       ports
>Synopsis:       [PATCH] make cups-pstoraster GHOSTSCRIPT_PORT aware
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 26 22:20:16 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Jose M Rodriguez
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
Redes JM
>Environment:
System: FreeBSD orion.redesjm.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Wed Jan 26 05:23:23 CET 2005 root at antares.redesjm.local:/usr/obj/usr/src/sys/ORION i386


>Description:
	Make cups-pstoraster from cups sources
	Make cups-pstoraster GHOSTSCRIPT_PORT aware
	Merge patches from cups for lib/gs_init.ps
	Merge patches from cups for lib/gs_setpd.ps
	use ${WRKDIR}/ghostscript as ${WRKSRC} in gs ports

	Affected ports:
		print/cups-pstoraster
		print/ghostscript-gnu
		print/ghostscript-gpl
		print/ghostscript-afpl

>How-To-Repeat:
	Please, test with care before import
	Not sure of corner cases

>Fix:

	remove files:
		print/cups-pstoraster/distinfo
		print/cups-pstoraster/patch-*

--- patch-ghostscript-gnu begins here ---
diff -Nru /usr/HEAD/ports/print/ghostscript-gnu/Makefile print/ghostscript-gnu/Makefile
--- /usr/HEAD/ports/print/ghostscript-gnu/Makefile	Tue Jan 25 00:42:16 2005
+++ print/ghostscript-gnu/Makefile	Wed Jan 26 22:35:19 2005
@@ -114,6 +114,9 @@
 
 GS_SRCS=	${DISTNAME}${EXTRACT_SUFX}
 
+# normalize WRKSRC so things like cups-pstoraster may work
+WRKSRC=		${WRKDIR}/ghostscript
+
 # Additional Drivers:
 
 # HP8XX - additional driver for HP DeskJet 812C/815C/832C/880C/882C/895C
@@ -263,6 +266,8 @@
 
 post-extract:
 	${ECHO_MSG} ">>> in post-extract ..."
+# normazile WRKSRC so things like cups-pstoraster may work
+	${MV} ${WRKDIR}/${DISTNAME} ${WRKDIR}/ghostscript
 # ** 3rd party driver **
 # Note: don't forget to add those devices in scripts/configure,
 # which update unix-gcc.mak to build gs with these new devices!
diff -Nru /usr/HEAD/ports/print/ghostscript-gnu/Makefile.inc print/ghostscript-gnu/Makefile.inc
--- /usr/HEAD/ports/print/ghostscript-gnu/Makefile.inc	Tue Jan 25 00:42:16 2005
+++ print/ghostscript-gnu/Makefile.inc	Wed Jan 26 22:51:48 2005
@@ -1,5 +1,5 @@
 # $FreeBSD: ports/print/ghostscript-gnu/Makefile.inc,v 1.6 2005/01/24 20:21:14 pav Exp $
 
 GS_VERSION=	7.07
-GS_REVISION=	12
+GS_REVISION=	13
 GS_EPOCH=	0
--- patch-ghostscript-gnu ends here ---

--- patch-ghostscript-gpl begins here ---
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/Makefile print/ghostscript-gpl/Makefile
--- /usr/HEAD/ports/print/ghostscript-gpl/Makefile	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-gpl/Makefile	Wed Jan 26 22:42:06 2005
@@ -114,6 +114,9 @@
 GS_SRCS=	${DISTNAME}${EXTRACT_SUFX}
 CIDFONTDIR=	${PREFIX}/share/ghostscript/${GS_VERSION}/Resource
 
+# normalize WRKSRC so things like cups-pstoraster may work
+WRKSRC=		${WRKDIR}/ghostscript
+
 # Additional Drivers:
 
 # HP8XX - additional driver for HP DeskJet 812C/815C/832C/880C/882C/895C
@@ -223,6 +226,8 @@
 
 post-extract:
 	${ECHO_MSG} ">>> in post-extract ..."
+# normazile WRKSRC so things like cups-pstoraster may work
+	${MV} ${WRKDIR}/${DISTNAME} ${WRKDIR}/ghostscript
 # ** 3rd party driver **
 # Note: don't forget to add those devices in scripts/configure,
 # which update unix-gcc.mak to build gs with these new devices!
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/Makefile.inc print/ghostscript-gpl/Makefile.inc
--- /usr/HEAD/ports/print/ghostscript-gpl/Makefile.inc	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-gpl/Makefile.inc	Wed Jan 26 20:47:40 2005
@@ -1,5 +1,5 @@
 # $FreeBSD: ports/print/ghostscript-gpl/Makefile.inc,v 1.13 2004/10/16 07:28:33 krion Exp $
 
 GS_VERSION=	8.15
-GS_REVISION=	0
+GS_REVISION=	1
 GS_EPOCH=	0
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_init.ps print/ghostscript-gpl/files/patch-lib:gs_init.ps
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_init.ps	Wed Apr  3 04:59:13 2002
+++ print/ghostscript-gpl/files/patch-lib:gs_init.ps	Wed Jan 26 20:34:51 2005
@@ -1,6 +1,14 @@
---- lib/gs_init.ps.orig	Fri Feb  1 12:25:45 2002
-+++ lib/gs_init.ps	Sat Feb  9 01:42:10 2002
-@@ -1274,7 +1274,7 @@
+--- lib/gs_init.ps.orig	Wed Jan 26 20:32:16 2005
++++ lib/gs_init.ps	Wed Jan 26 20:31:34 2005
+@@ -140,6 +140,7 @@
+ currentdict /NOFONTPATH known   /NOFONTPATH exch def
+ currentdict /NOGC known   /NOGC exch def
+ currentdict /NOINTERPOLATE .knownget { /INTERPOLATE exch not def } if
++currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
+ currentdict /NOOUTERSAVE known   /NOOUTERSAVE exch def
+ currentdict /NOPAGEPROMPT known   /NOPAGEPROMPT exch def
+ currentdict /NOPAUSE known   /NOPAUSE exch def
+@@ -1420,7 +1421,7 @@
  % Set the default screen and BG/UCR.
  /.setdefaultbgucr {
    systemdict /setblackgeneration known {
@@ -9,11 +17,14 @@
    } if
  } bind def
  /.useloresscreen {	% - .useloresscreen <bool>
-@@ -1874,3 +1874,7 @@
- userdict /AGM_preserve_spots false put
+@@ -2018,6 +2019,10 @@
+ % Set up GridFitTT :
  
- % The interpreter will run the initial procedure (start).
+ /GridFitTT where {
 +
 +% unofficial patch:
 +% make it possible to print from within acroread pdf viewer
 +/Default currenthalftone /Halftone defineresource pop
+   mark /GridFitTT 2 index /GridFitTT get .dicttomark setuserparams
+   /GridFitTT undef
+ } if
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_setpd.ps print/ghostscript-gpl/files/patch-lib:gs_setpd.ps
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_setpd.ps	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-gpl/files/patch-lib:gs_setpd.ps	Wed Jan 26 20:35:50 2005
@@ -0,0 +1,98 @@
+--- lib/gs_setpd.ps.orig	Tue Sep 14 00:32:19 2004
++++ lib/gs_setpd.ps	Wed Jan 26 20:31:34 2005
+@@ -377,21 +377,42 @@
+   /MediaPosition { dup //null ne { pop //null } if } bind
+ .dicttomark readonly def
+ 
+-% Define the keys used in input attribute matching.
+-/.inputattrkeys [
+-  /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
+-	% The following are documented in Adobe's supplement for v2017.
+-  /LeadingEdge /MediaClass
+-] readonly def
+-% Define other keys used in media selection.
+-/.inputselectionkeys [
+-  /MediaPosition /Orientation
+-] readonly def
+-
+-% Define the keys used in output attribute matching.
+-/.outputattrkeys [
+-  /OutputType
+-] readonly def
++% M. Sweet, Easy Software Products:
++%
++% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
++% selection policies for setpagedevice.  This is used by CUPS to support
++% the standard Adobe media attributes.
++NOMEDIAATTRS {
++  % Define only PageSize for input attribute matching.
++  /.inputattrkeys [
++    /PageSize
++  ] readonly def
++  % Define no other keys used in media selection.
++  /.inputselectionkeys [
++    /noInputSelectionsKeys
++  ] readonly def
++
++  % Define no keys used in output attribute matching.
++  /.outputattrkeys [
++    /noOutputAttrKeys
++  ] readonly def
++} {
++  % Define the keys used in input attribute matching.
++  /.inputattrkeys [
++    /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
++	  % The following are documented in Adobe's supplement for v2017.
++    /LeadingEdge /MediaClass
++  ] readonly def
++  % Define other keys used in media selection.
++  /.inputselectionkeys [
++    /MediaPosition /Orientation
++  ] readonly def
++
++  % Define the keys used in output attribute matching.
++  /.outputattrkeys [
++    /OutputType
++  ] readonly def
++} ifelse
+ 
+ % Define all the parameters that should always be copied to the merged
+ % dictionary.
+@@ -420,7 +441,13 @@
+   /PageSize //false		% obsolete alias for .MediaSize
+   /InputAttributes //false
+   .inputattrkeys
+-    { dup /PageSize eq
++    % M. Sweet, Easy Software Products:
++    %
++    % Treat LeadingEdge like PageSize so that a common Ghostscript driver
++    % doesn't need the NOMEDIAATTRS definition.
++    %
++    % { dup /PageSize eq
++    { dup dup /PageSize eq exch /LeadingEdge eq or
+        { pop }
+        { { 2 index /InputAttributes .knownget { //null eq } { //true } ifelse } }
+       ifelse
+@@ -501,11 +528,22 @@
+ % They are expected to consume the top 2 operands.
+ % NOTE: we currently treat all values other than 0, 1, or 7 (for PageSize)
+ % the same as 0, i.e., we signal an error.
++%
++% M. Sweet, Easy Software Products:
++%
++% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
++% selection policies for setpagedevice.  This is used by CUPS to support
++% the standard Adobe media attributes.
+   0 {		% Set errorinfo and signal a configurationerror.
++      NOMEDIAATTRS {
++        % NOMEDIAATTRS means that the default policy is 7...
++        pop 2 index exch 7 put
++      } {
+ 	pop dup 4 index exch get 2 array astore
+ 	$error /errorinfo 3 -1 roll put
+ 	cleartomark
+ 	/setpagedevice load /configurationerror signalerror
++      } ifelse
+   } bind
+   1 {		% Roll back the failed request to its previous status.
+ SETPDDEBUG { (Rolling back.) = pstack flush } if
--- patch-ghostscript-gpl ends here ---

--- patch-ghostscript-afpl begins here ---
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/Makefile print/ghostscript-afpl/Makefile
--- /usr/HEAD/ports/print/ghostscript-gpl/Makefile	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-afpl/Makefile	Wed Jan 26 22:44:01 2005
@@ -2,7 +2,7 @@
 # Date created:		Tue Jun 10 21:58:54 CEST 1997
 # Whom:			Andreas Klemm <andreas at klemm.gtn.com>
 #
-# $FreeBSD: ports/print/ghostscript-gpl/Makefile,v 1.137 2004/10/16 07:28:33 krion Exp $
+# $FreeBSD: ports/print/ghostscript-afpl/Makefile,v 1.138 2004/12/31 13:32:24 krion Exp $
 #
 
 PORTNAME=	ghostscript
@@ -22,11 +22,11 @@
 		http://www.linuxprinting.org/download/printing/samsung-gdi/:gdi \
 		http://www.linuxprinting.org/download/printing/:lxm3200 \
 		http://homepage.powerup.com.au/~pbwest/lexmark/:lx5000 \
-		ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs${GS_VERSION:S/.//}/:gs_srcs
+		ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs${GS_VERSION:S/.//}/:gs_srcs
 MASTER_SITE_SUBDIR=	ghostscript/:gs_srcs,ports_jp_gs \
 			bjc250gs/:bjc250 \
 			./:ports_jp
-PKGNAMESUFFIX=	-gpl
+PKGNAMESUFFIX=	-afpl
 DISTFILES=	${GS_SRCS}:gs_srcs \
 		${HP8XX_SRCS}:hp8xx \
 		${DJ970_SRCS}:dj970 \
@@ -47,13 +47,15 @@
 EXTRACT_ONLY=	${GS_SRCS}
 
 MAINTAINER=	ports at FreeBSD.org
-COMMENT=	GPL Postscript interpreter
+COMMENT=	AFPL Postscript interpreter
 
 LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg \
 		png.5:${PORTSDIR}/graphics/png
 RUN_DEPENDS=	${LOCALBASE}/share/ghostscript/fonts/a010013l.pfb:${PORTSDIR}/print/gsfonts
 
-CONFLICTS=	ghostscript-afpl* ghostscript-gnu*
+NO_CDROM=	"Can only be distributed for free"
+
+CONFLICTS=	ghostscript-gnu* ghostscript-gpl*
 USE_BZIP2=	yes
 USE_REINPLACE=	yes
 USE_GMAKE=	yes
@@ -114,6 +116,9 @@
 GS_SRCS=	${DISTNAME}${EXTRACT_SUFX}
 CIDFONTDIR=	${PREFIX}/share/ghostscript/${GS_VERSION}/Resource
 
+# normalize WRKSRC so things like cups-pstoraster may work
+WRKSRC=		${WRKDIR}/ghostscript
+
 # Additional Drivers:
 
 # HP8XX - additional driver for HP DeskJet 812C/815C/832C/880C/882C/895C
@@ -167,6 +172,7 @@
 
 # EPAG - additional driver for Epson ESC/Page printers
 # http://www.humblesoft.com/gdevepag.html
+# XXX FIXME
 EPAG=		epag
 EPAG_VERS=	3.09
 EPAG_NAME=	${EPAG}-${EPAG_VERS}
@@ -191,6 +197,7 @@
 GDI_SRCS=	${GDI_NAME}.orig.tar.gz
 
 # LXM3200 - additional driver for Lexmark 3200/Z12/Z22/Z31/Z32
+# XXX FIXME
 LXM3200=	lxm3200
 LXM3200_VERS=	20030501
 LXM3200_NAME=	${LXM3200}-tweaked-${LXM3200_VERS}
@@ -223,6 +230,8 @@
 
 post-extract:
 	${ECHO_MSG} ">>> in post-extract ..."
+# normazile WRKSRC so things like cups-pstoraster may work
+	${MV} ${WRKDIR}/${DISTNAME} ${WRKDIR}/ghostscript
 # ** 3rd party driver **
 # Note: don't forget to add those devices in scripts/configure,
 # which update unix-gcc.mak to build gs with these new devices!
@@ -262,6 +271,7 @@
 # for EPAG driver
 	${ECHO_MSG} ">>>   extracting ${EPAG_SRCS} ..."
 	${TAR} -C ${WRKSRC} -xzf ${DISTDIR}/${DIST_SUBDIR}/${EPAG_SRCS}
+	${LN} -sf ${EPAG_NAME} ${WRKSRC}/${EPAG}
 # for EPLASER driver
 	${ECHO_MSG} ">>>   extracting ${EPLASER_SRCS} ..."
 	${TAR} -C ${WRKSRC} -xzf ${DISTDIR}/${DIST_SUBDIR}/${EPLASER_SRCS}
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/Makefile.inc print/ghostscript-afpl/Makefile.inc
--- /usr/HEAD/ports/print/ghostscript-gpl/Makefile.inc	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-afpl/Makefile.inc	Wed Jan 26 20:45:28 2005
@@ -1,5 +1,5 @@
-# $FreeBSD: ports/print/ghostscript-gpl/Makefile.inc,v 1.13 2004/10/16 07:28:33 krion Exp $
+# $FreeBSD: ports/print/ghostscript-afpl/Makefile.inc,v 1.15 2004/12/31 13:32:24 krion Exp $
 
-GS_VERSION=	8.15
-GS_REVISION=	0
-GS_EPOCH=	0
+GS_VERSION=	8.50
+GS_REVISION=	1
+GS_EPOCH=	1
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/distinfo print/ghostscript-afpl/distinfo
--- /usr/HEAD/ports/print/ghostscript-gpl/distinfo	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-afpl/distinfo	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
-MD5 (ghostscript/ghostscript-8.15.tar.bz2) = ab8502f30629b730e0c9ca56b88a6b9d
-SIZE (ghostscript/ghostscript-8.15.tar.bz2) = 6931694
+MD5 (ghostscript/ghostscript-8.50.tar.bz2) = bd49a30d7485ad382f69b49a06d045fd
+SIZE (ghostscript/ghostscript-8.50.tar.bz2) = 8837036
 MD5 (ghostscript/gdevcd8.tar.gz) = 5ce48bff6082a023199c8ede4aae63a0
 SIZE (ghostscript/gdevcd8.tar.gz) = 24803
 MD5 (ghostscript/gdevdj9.c.gz) = 3a9c20c34b79ffab434abfbcc31d1c27
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-alps:gdevalps.c print/ghostscript-afpl/files/patch-alps:gdevalps.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-alps:gdevalps.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-alps:gdevalps.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,22 @@
+--- alps/gdevalps.c.orig	Wed Nov 24 09:28:35 1999
++++ alps/gdevalps.c	Fri Dec 17 19:12:35 2004
+@@ -173,7 +173,7 @@
+ {
+   int lnum;
+   int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
+-  byte *data = (byte *)gs_malloc(8, line_size, "md50_print_page(data)" );
++  byte *data = (byte *)gs_malloc(pdev->memory, 8, line_size, "md50_print_page(data)" );
+   int skipping = 0;
+   int nbyte;
+   int nskip;
+@@ -232,8 +232,8 @@
+ {
+   int lnum;
+   int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
+-  byte *data = (byte *)gs_malloc(8, line_size, "md1xm_print_page(data)");
+-  byte *out_start = (byte *)gs_malloc(8, line_size, "md1xm_print_page(data)");
++  byte *data = (byte *)gs_malloc(pdev->memory, 8, line_size, "md1xm_print_page(data)");
++  byte *out_start = (byte *)gs_malloc(pdev->memory, 8, line_size, "md1xm_print_page(data)");
+   int skipping = 0;
+   int nbyte;
+ 
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-epag:gdevepag.c print/ghostscript-afpl/files/patch-epag:gdevepag.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-epag:gdevepag.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-epag:gdevepag.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,35 @@
+--- epag/gdevepag.c.orig	Sat Jul  8 13:33:09 2000
++++ epag/gdevepag.c	Fri Dec 31 19:59:24 2004
+@@ -417,15 +417,15 @@
+   cont->maxY = epag_cont.cRowBuf / cont->bh * cont->bh ;
+   if(cont->maxY < cont->bh) cont->maxY = cont->bh;
+   
+-  cont->bp  = gs_malloc(bpl , cont->maxY, "epag_skip_blank_init(bp)");
+-  cont->bp2 = gs_malloc(bpl*3/2+1 , cont->maxY, "epag_skip_blank_init(bp2)");
++  cont->bp  = gs_malloc(pdev->memory, bpl , cont->maxY, "epag_skip_blank_init(bp)");
++  cont->bp2 = gs_malloc(pdev->memory, bpl*3/2+1 , cont->maxY, "epag_skip_blank_init(bp2)");
+ 
+   cont->h = cont->r = 0;
+ 
+-  cont->bubbleTbl=gs_malloc(sizeof(EpagBubble *),cont->maxBx,"bubbleTbl");
++  cont->bubbleTbl=gs_malloc(pdev->memory, sizeof(EpagBubble *),cont->maxBx,"bubbleTbl");
+   for(i=0;i<cont->maxBx;i++)
+     cont->bubbleTbl[i] = NULL;
+-  cont->bubbleBuffer=gs_malloc(sizeof(EpagBubble),cont->maxBx,"bubbleBuffer");
++  cont->bubbleBuffer=gs_malloc(pdev->memory, sizeof(EpagBubble),cont->maxBx,"bubbleBuffer");
+   bbtbl = (EpagBubble *)cont->bubbleBuffer;
+   for(i=0;i<cont->maxBx-1;i++)
+     bbtbl[i].next = &bbtbl[i+1];
+@@ -436,9 +436,9 @@
+ private void
+ epag_page_close(EpagPageCont *cont)
+ {
+-  gs_free(cont->bp, bpl, cont->maxY, "epag_skip_blank_init(bp)");
+-  gs_free(cont->bp2, bpl*3/2+1, cont->maxY, "epag_skip_blank_init(bp2)");
+-  gs_free(cont->bubbleBuffer, sizeof(EpagBubble), cont->maxBx,"bubbleBuffer");
++  gs_free(pdev->memory, cont->bp, bpl, cont->maxY, "epag_skip_blank_init(bp)");
++  gs_free(pdev->memory, cont->bp2, bpl*3/2+1, cont->maxY, "epag_skip_blank_init(bp2)");
++  gs_free(pdev->memory, cont->bubbleBuffer, sizeof(EpagBubble), cont->maxBx,"bubbleBuffer");
+ }
+ 
+ private int
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-gdev10v:gdev10v.c print/ghostscript-afpl/files/patch-gdev10v:gdev10v.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-gdev10v:gdev10v.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-gdev10v:gdev10v.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,23 @@
+--- gdev10v/gdev10v.c.orig	Sat Dec 11 04:10:45 1993
++++ gdev10v/gdev10v.c	Fri Dec 17 19:15:49 2004
+@@ -152,8 +152,8 @@
+ 	int bytes_per_column = bits_per_column / 8;
+ 	int x_skip_unit = bytes_per_column * (xres / 180);
+ 	int y_skip_unit = (yres / 180);
+-	byte *in = (byte *)gs_malloc(8, line_size, "bj10v_print_page(in)");
+-	byte *out = (byte *)gs_malloc(bits_per_column, line_size, "bj10v_print_page(out)");
++	byte *in = (byte *)gs_malloc(pdev->memory, 8, line_size, "bj10v_print_page(in)");
++	byte *out = (byte *)gs_malloc(pdev->memory, bits_per_column, line_size, "bj10v_print_page(out)");
+ 	int lnum = 0;
+ 	int y_skip = 0;
+ 	int code = 0;
+@@ -275,7 +275,7 @@
+ 	/* Eject the page */
+ xit:	prn_putc(pdev, 014);	/* form feed */
+ 	prn_flush(pdev);
+-	gs_free((char *)out, bits_per_column, line_size, "bj10v_print_page(out)");
+-	gs_free((char *)in, 8, line_size, "bj10v_print_page(in)");
++	gs_free(pdev->memory, (char *)out, bits_per_column, line_size, "bj10v_print_page(out)");
++	gs_free(pdev->memory, (char *)in, 8, line_size, "bj10v_print_page(in)");
+ 	return code;
+ }
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lex7000:src:gdevlx7.c print/ghostscript-afpl/files/patch-lex7000:src:gdevlx7.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lex7000:src:gdevlx7.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-lex7000:src:gdevlx7.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,31 @@
+--- lex7000/src/gdevlx7.c.orig	Fri Dec 31 17:22:48 2004
++++ lex7000/src/gdevlx7.c	Fri Dec 31 17:24:39 2004
+@@ -615,14 +615,14 @@
+    dprintf2("Current resolution is %f width x %f height dpi\n",
+ 	 pdev->x_pixels_per_inch, pdev->y_pixels_per_inch );
+ #endif
+-   pbuf = (byte *)gs_malloc(rpbufsize, 1, "lxmgen_print_page(pbuf)");
++   pbuf = (byte *)gs_malloc(pdev->memory, rpbufsize, 1, "lxmgen_print_page(pbuf)");
+    if (pbuf == NULL)
+       return_error(gs_error_VMerror);
+ 
+-   outbuf = (byte *)gs_malloc(OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
++   outbuf = (byte *)gs_malloc(pdev->memory, OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
+    if (outbuf == NULL)
+    {
+-      gs_free((char*)pbuf,pbufsize, 1, "lxmgen_print_page(pbuf)");
++      gs_free(pdev->memory, (char*)pbuf,pbufsize, 1, "lxmgen_print_page(pbuf)");
+       return_error(gs_error_VMerror);
+    }
+    /* initialize begin of outbuf ... */
+@@ -799,8 +799,8 @@
+ 
+    /* eject page */
+    lex_eject(prn_stream);
+-   gs_free((char*)pbuf,rpbufsize, 1, "lxmgen_print_page(pbuf)");
+-   gs_free((char*)outbuf,OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
++   gs_free(pdev->memory, (char*)pbuf,rpbufsize, 1, "lxmgen_print_page(pbuf)");
++   gs_free(pdev->memory, (char*)outbuf,OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
+ 
+ #ifdef DEBUG
+    dprintf1("[%s] print_page() end\n",pdev->dname);
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_init.ps print/ghostscript-afpl/files/patch-lib:gs_init.ps
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_init.ps	Wed Apr  3 04:59:13 2002
+++ print/ghostscript-afpl/files/patch-lib:gs_init.ps	Wed Jan 26 20:44:48 2005
@@ -1,6 +1,14 @@
---- lib/gs_init.ps.orig	Fri Feb  1 12:25:45 2002
-+++ lib/gs_init.ps	Sat Feb  9 01:42:10 2002
-@@ -1274,7 +1274,7 @@
+--- lib/gs_init.ps.orig	Wed Jan 26 20:44:07 2005
++++ lib/gs_init.ps	Wed Jan 26 20:43:38 2005
+@@ -145,6 +145,7 @@
+ currentdict /NOFONTPATH known   /NOFONTPATH exch def
+ currentdict /NOGC known   /NOGC exch def
+ currentdict /NOINTERPOLATE .knownget { /INTERPOLATE exch not def } if
++currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
+ currentdict /NOOUTERSAVE known   /NOOUTERSAVE exch def
+ currentdict /NOPAGEPROMPT known   /NOPAGEPROMPT exch def
+ currentdict /NOPAUSE known   /NOPAUSE exch def
+@@ -1425,7 +1426,7 @@
  % Set the default screen and BG/UCR.
  /.setdefaultbgucr {
    systemdict /setblackgeneration known {
@@ -9,11 +17,14 @@
    } if
  } bind def
  /.useloresscreen {	% - .useloresscreen <bool>
-@@ -1874,3 +1874,7 @@
- userdict /AGM_preserve_spots false put
+@@ -2023,6 +2024,10 @@
+ % Set up GridFitTT :
  
- % The interpreter will run the initial procedure (start).
+ /GridFitTT where {
 +
 +% unofficial patch:
 +% make it possible to print from within acroread pdf viewer
 +/Default currenthalftone /Halftone defineresource pop
+   mark /GridFitTT 2 index /GridFitTT get .dicttomark setuserparams
+   /GridFitTT undef
+ } if
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_setpd.ps print/ghostscript-afpl/files/patch-lib:gs_setpd.ps
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:gs_setpd.ps	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-lib:gs_setpd.ps	Wed Jan 26 20:44:31 2005
@@ -0,0 +1,98 @@
+--- lib/gs_setpd.ps.orig	Tue Sep 14 00:33:15 2004
++++ lib/gs_setpd.ps	Wed Jan 26 20:43:38 2005
+@@ -377,21 +377,42 @@
+   /MediaPosition { dup //null ne { pop //null } if } bind
+ .dicttomark readonly def
+ 
+-% Define the keys used in input attribute matching.
+-/.inputattrkeys [
+-  /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
+-	% The following are documented in Adobe's supplement for v2017.
+-  /LeadingEdge /MediaClass
+-] readonly def
+-% Define other keys used in media selection.
+-/.inputselectionkeys [
+-  /MediaPosition /Orientation
+-] readonly def
+-
+-% Define the keys used in output attribute matching.
+-/.outputattrkeys [
+-  /OutputType
+-] readonly def
++% M. Sweet, Easy Software Products:
++%
++% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
++% selection policies for setpagedevice.  This is used by CUPS to support
++% the standard Adobe media attributes.
++NOMEDIAATTRS {
++  % Define only PageSize for input attribute matching.
++  /.inputattrkeys [
++    /PageSize
++  ] readonly def
++  % Define no other keys used in media selection.
++  /.inputselectionkeys [
++    /noInputSelectionsKeys
++  ] readonly def
++
++  % Define no keys used in output attribute matching.
++  /.outputattrkeys [
++    /noOutputAttrKeys
++  ] readonly def
++} {
++  % Define the keys used in input attribute matching.
++  /.inputattrkeys [
++    /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
++	  % The following are documented in Adobe's supplement for v2017.
++    /LeadingEdge /MediaClass
++  ] readonly def
++  % Define other keys used in media selection.
++  /.inputselectionkeys [
++    /MediaPosition /Orientation
++  ] readonly def
++
++  % Define the keys used in output attribute matching.
++  /.outputattrkeys [
++    /OutputType
++  ] readonly def
++} ifelse
+ 
+ % Define all the parameters that should always be copied to the merged
+ % dictionary.
+@@ -420,7 +441,13 @@
+   /PageSize //false		% obsolete alias for .MediaSize
+   /InputAttributes //false
+   .inputattrkeys
+-    { dup /PageSize eq
++    % M. Sweet, Easy Software Products:
++    %
++    % Treat LeadingEdge like PageSize so that a common Ghostscript driver
++    % doesn't need the NOMEDIAATTRS definition.
++    %
++    % { dup /PageSize eq
++    { dup dup /PageSize eq exch /LeadingEdge eq or
+        { pop }
+        { { 2 index /InputAttributes .knownget { //null eq } { //true } ifelse } }
+       ifelse
+@@ -501,11 +528,22 @@
+ % They are expected to consume the top 2 operands.
+ % NOTE: we currently treat all values other than 0, 1, or 7 (for PageSize)
+ % the same as 0, i.e., we signal an error.
++%
++% M. Sweet, Easy Software Products:
++%
++% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
++% selection policies for setpagedevice.  This is used by CUPS to support
++% the standard Adobe media attributes.
+   0 {		% Set errorinfo and signal a configurationerror.
++      NOMEDIAATTRS {
++        % NOMEDIAATTRS means that the default policy is 7...
++        pop 2 index exch 7 put
++      } {
+ 	pop dup 4 index exch get 2 array astore
+ 	$error /errorinfo 3 -1 roll put
+ 	cleartomark
+ 	/setpagedevice load /configurationerror signalerror
++      } ifelse
+   } bind
+   1 {		% Roll back the failed request to its previous status.
+ SETPDDEBUG { (Rolling back.) = pstack flush } if
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:pdf_font.ps print/ghostscript-afpl/files/patch-lib:pdf_font.ps
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lib:pdf_font.ps	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-afpl/files/patch-lib:pdf_font.ps	Thu Dec 30 10:16:11 2004
@@ -1,5 +1,5 @@
---- lib/pdf_font.ps.orig	Tue Aug 31 13:03:30 2004
-+++ lib/pdf_font.ps	Wed Sep 15 19:15:00 2004
+--- lib/pdf_font.ps.orig	Mon Aug 30 21:03:30 2004
++++ lib/pdf_font.ps	Wed Dec 29 17:17:19 2004
 @@ -1114,10 +1114,12 @@
  
  /buildCIDType0 {	% <CIDFontType0-font-resource> buildCIDType0 <font>
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevespg.c print/ghostscript-afpl/files/patch-lips:gdevespg.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevespg.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-lips:gdevespg.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,20 @@
+--- lips/gdevespg.c.orig	Thu Nov  2 12:09:18 2000
++++ lips/gdevespg.c	Fri Dec 17 19:39:57 2004
+@@ -142,7 +142,7 @@
+     if (pdev->PageCount == 0)
+ 	escpage_printer_initialize(pdev, fp, num_coipes);
+ 
+-    if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)")))
++    if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)")))
+ 	return_error(gs_error_VMerror);
+ 
+     if (lprn->NegativePrint) {
+@@ -154,7 +154,7 @@
+     if (code < 0)
+ 	return code;
+ 
+-    gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)");
++    gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)");
+ 
+     if (pdev->Duplex)
+ 	fprintf(fp, "%c0dpsE", GS);
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevl4r.c print/ghostscript-afpl/files/patch-lips:gdevl4r.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevl4r.c	Sun Feb 29 09:18:45 2004
+++ print/ghostscript-afpl/files/patch-lips:gdevl4r.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
 --- lips/gdevl4r.c.orig	Thu Nov  2 12:09:18 2000
-+++ lips/gdevl4r.c	Tue Jan 13 01:28:40 2004
++++ lips/gdevl4r.c	Fri Dec 17 19:19:02 2004
 @@ -53,8 +53,8 @@
  #define lips_device(dtype, procs, dname, xdpi, ydpi, lm, bm, rm, tm, color_bits,\
  		    print_page_copies, image_out, cassetFeed, username)\
@@ -36,6 +36,85 @@
  private int lips4type_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies, int ptype);
  
  private int
+@@ -597,7 +602,7 @@
+     /* Initialize printer. */
+     lips_job_start(pdev, ptype, prn_stream, num_copies);
+ 
+-    if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
++    if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
+ 	return_error(gs_error_VMerror);
+ 
+ 
+@@ -607,7 +612,7 @@
+     if (code < 0)
+ 	return code;
+ 
+-    gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
++    gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
+ 
+     /* eject page */
+     lips_job_end(pdev, prn_stream);
+@@ -641,9 +646,9 @@
+ 
+     if (pdev->color_info.depth == 1)
+       {
+-	if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
++	if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
+ 	  return_error(gs_error_VMerror);
+-	if (!(lprn->CompBuf2 = gs_malloc(bpl * 3 / 2 + 1, maxY, "(CompBuf2)")))
++	if (!(lprn->CompBuf2 = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "(CompBuf2)")))
+ 	  return_error(gs_error_VMerror);
+ 
+ 	if (lprn->NegativePrint) {
+@@ -663,8 +668,8 @@
+ 	if (code < 0)
+ 	  return code;
+ 	
+-	gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
+-	gs_free(lprn->CompBuf2, bpl * 3 / 2 + 1, maxY, "(CompBuf2)");
++	gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
++	gs_free(pdev->memory, lprn->CompBuf2, bpl * 3 / 2 + 1, maxY, "(CompBuf2)");
+       }
+     else
+       {
+@@ -903,15 +908,15 @@
+     int lnum = 0;
+ 
+     /* Memory Allocate */
+-    if (!(pBuff = (byte *) gs_malloc(nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)")))
++    if (!(pBuff = (byte *) gs_malloc(pdev->memory, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(prevBuff = (byte *) gs_malloc(nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)")))
++    if (!(prevBuff = (byte *) gs_malloc(pdev->memory, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(ComBuff = (byte *) gs_malloc(Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)")))
++    if (!(ComBuff = (byte *) gs_malloc(pdev->memory, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(TotalBuff = (byte *) gs_malloc((Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)")))
++    if (!(TotalBuff = (byte *) gs_malloc(pdev->memory, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(diffBuff = (byte *) gs_malloc(Xpixel * num_components * 2, sizeof(byte), "lips_print_page")))
++    if (!(diffBuff = (byte *) gs_malloc(pdev->memory, Xpixel * num_components * 2, sizeof(byte), "lips_print_page")))
+ 	return_error(gs_error_VMerror);
+ 
+     /* make output data */
+@@ -927,11 +932,11 @@
+ 			    pdev->height - (lnum - NUM_LINES_4C));
+     }
+     /* Free Memory */
+-    gs_free(pBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)");
+-    gs_free(prevBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)");
+-    gs_free(ComBuff, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)");
+-    gs_free(TotalBuff, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)");
+-    gs_free(diffBuff, Xpixel * num_components * 2, sizeof(byte), "lips_print_page");
++    gs_free(pdev->memory, pBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)");
++    gs_free(pdev->memory, prevBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)");
++    gs_free(pdev->memory, ComBuff, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)");
++    gs_free(pdev->memory, TotalBuff, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)");
++    gs_free(pdev->memory, diffBuff, Xpixel * num_components * 2, sizeof(byte), "lips_print_page");
+ 
+     return 0;
+ }
 @@ -1065,11 +1070,25 @@
  	if (paper_size == USER_SIZE) {
  	    fprintf(prn_stream, "%c2 I", LIPS_CSI);
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevlprn.c print/ghostscript-afpl/files/patch-lips:gdevlprn.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevlprn.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-lips:gdevlprn.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,35 @@
+--- lips/gdevlprn.c.orig	Thu Nov  2 12:09:18 2000
++++ lips/gdevlprn.c	Fri Dec 17 19:21:08 2004
+@@ -219,13 +219,13 @@
+     maxBy = (pdev->height + lprn->nBh - 1) / lprn->nBh;
+     maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
+ 
+-    if (!(lprn->ImageBuf = gs_malloc(bpl, maxY, "lprn_print_image(ImageBuf)")))
++    if (!(lprn->ImageBuf = gs_malloc(pdev->memory, bpl, maxY, "lprn_print_image(ImageBuf)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(lprn->TmpBuf = gs_malloc(bpl, maxY, "lprn_print_iamge(TmpBuf)")))
++    if (!(lprn->TmpBuf = gs_malloc(pdev->memory, bpl, maxY, "lprn_print_iamge(TmpBuf)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(lprn->bubbleTbl = gs_malloc(sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)")))
++    if (!(lprn->bubbleTbl = gs_malloc(pdev->memory, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)")))
+ 	return_error(gs_error_VMerror);
+-    if (!(bubbleBuffer = gs_malloc(sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)")))
++    if (!(bubbleBuffer = gs_malloc(pdev->memory, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)")))
+ 	return_error(gs_error_VMerror);
+ 
+     for (i = 0; i < maxBx; i++)
+@@ -261,10 +261,10 @@
+     }
+     lprn_bubble_flush_all(pdev, fp);	/* flush the rest of bubble */
+ 
+-    gs_free(lprn->ImageBuf, bpl, maxY, "lprn_print_image(ImageBuf)");
+-    gs_free(lprn->TmpBuf, bpl, maxY, "lprn_print_iamge(TmpBuf)");
+-    gs_free(lprn->bubbleTbl, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)");
+-    gs_free(bubbleBuffer, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)");
++    gs_free(pdev->memory, lprn->ImageBuf, bpl, maxY, "lprn_print_image(ImageBuf)");
++    gs_free(pdev->memory, lprn->TmpBuf, bpl, maxY, "lprn_print_iamge(TmpBuf)");
++    gs_free(pdev->memory, lprn->bubbleTbl, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)");
++    gs_free(pdev->memory, bubbleBuffer, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)");
+ 
+     return code;
+ }
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevnpdl.c print/ghostscript-afpl/files/patch-lips:gdevnpdl.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevnpdl.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-lips:gdevnpdl.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,20 @@
+--- lips/gdevnpdl.c.orig	Thu Nov  2 12:09:18 2000
++++ lips/gdevnpdl.c	Fri Dec 31 17:32:52 2004
+@@ -582,7 +582,7 @@
+     int code;
+     int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
+ 
+-    if (!(lprn->CompBuf = gs_malloc(line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)")))
++    if (!(lprn->CompBuf = gs_malloc(pdev->memory, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)")))
+ 	return_error(gs_error_VMerror);
+ 
+ 
+@@ -680,7 +680,7 @@
+     /* Form Feed */
+     fputs("\014", prn_stream);
+ 
+-    gs_free(lprn->CompBuf, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)");
++    gs_free(pdev->memory, lprn->CompBuf, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)");
+     return 0;
+ }
+ 
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevrpdl.c print/ghostscript-afpl/files/patch-lips:gdevrpdl.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lips:gdevrpdl.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-lips:gdevrpdl.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,20 @@
+--- lips/gdevrpdl.c.orig	Thu Nov  2 12:09:18 2000
++++ lips/gdevrpdl.c	Fri Dec 31 17:34:04 2004
+@@ -81,7 +81,7 @@
+     if (pdev->PageCount == 0)
+ 	rpdl_printer_initialize(pdev, prn_stream, num_coipes);
+ 
+-    if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)")))
++    if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)")))
+ 	return_error(gs_error_VMerror);
+ 
+     lprn->NegativePrint = false; /* Not Support */
+@@ -90,7 +90,7 @@
+     if (code < 0)
+ 	return code;
+ 
+-    gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)");
++    gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)");
+ 
+     fprintf(prn_stream, "\014");	/* Form  Feed */
+ 
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c print/ghostscript-afpl/files/patch-lxm3200:gdevlx32.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c	Sun Jun  8 04:38:06 2003
+++ print/ghostscript-afpl/files/patch-lxm3200:gdevlx32.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
 --- lxm3200/gdevlx32.c.orig	Wed Apr 23 01:06:20 2003
-+++ lxm3200/gdevlx32.c	Thu May 15 08:24:08 2003
++++ lxm3200/gdevlx32.c	Fri Dec 17 19:46:04 2004
 @@ -422,9 +422,11 @@
   * of the nearest color.
   */
@@ -22,4 +22,31 @@
 +			col = gdev_prn_map_rgb_color(dev, cv);
  			break;
  	}
+ 
+@@ -732,10 +734,10 @@
+ 	/* Allocate memory for the buffers and
+ 	 * verify that the allocation was done properly.
+ 	 */
+-	gendata.scanbuf = (byte *)gs_malloc(gendata.numbytes, gendata.numblines, 
++	gendata.scanbuf = (byte *)gs_malloc(pdev->memory, gendata.numbytes, gendata.numblines, 
+ 																			"lxm3200_print_page(scanbuf)");
+ 
+-	gendata.outdata = (byte *)gs_malloc(gendata.numbytes, 30, 
++	gendata.outdata = (byte *)gs_malloc(pdev->memory, gendata.numbytes, 30, 
+ 																			"lxm3200_print_page(outdata)");
+  
+ 	if(gendata.scanbuf == NULL || 
+@@ -944,11 +946,11 @@
+ freeresources(void)
+ {
+ 	if(gendata.scanbuf)
+-		gs_free((char *)gendata.scanbuf, gendata.numbytes, gendata.numblines,
++		gs_free(pdev->memory, (char *)gendata.scanbuf, gendata.numbytes, gendata.numblines,
+ 						"lxm3200:freeresources(scanbuf)");
+ 
+ 	if(gendata.outdata)
+-		gs_free((char *)gendata.outdata, gendata.numbytes, 30, 
++		gs_free(pdev->memory, (char *)gendata.outdata, gendata.numbytes, 30, 
+ 						"lxm3200:freeresources(outdata)");
+ }
  
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c print/ghostscript-afpl/files/patch-md2k:gdevmd2k.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c	Fri Jan  3 20:35:07 2003
+++ print/ghostscript-afpl/files/patch-md2k:gdevmd2k.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,23 @@
 --- md2k/gdevmd2k.c.orig	Sun May  2 14:07:57 1999
-+++ md2k/gdevmd2k.c	Fri Nov  8 07:29:13 2002
++++ md2k/gdevmd2k.c	Fri Dec 17 19:10:22 2004
+@@ -495,7 +495,7 @@
+     int i, j;
+ 
+     /* allocate memory */
+-    work = (byte *)gs_malloc(3+sizeof(int), line_size,
++    work = (byte *)gs_malloc(pdev->memory, 3+sizeof(int), line_size,
+ 			     "alps_print_page(work)");
+     if (work == 0)
+ 	return_error(gs_error_VMerror);
+@@ -597,7 +597,7 @@
+ 	   "\033\052\162\103"
+ 	   "\033\045\0\130", 1, 9, prn_stream);
+ 
+-    gs_free((char *)work, 3+sizeof(int), line_size, "alps_print_page(work)");
++    gs_free(pdev->memory, (char *)work, 3+sizeof(int), line_size, "alps_print_page(work)");
+     return 0;
+ }
+ 
 @@ -638,11 +638,13 @@
      (k) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
  
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-mjc:gdevmjc.c print/ghostscript-afpl/files/patch-mjc:gdevmjc.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-mjc:gdevmjc.c	Fri Jan  3 20:35:07 2003
+++ print/ghostscript-afpl/files/patch-mjc:gdevmjc.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
 --- mjc/gdevmjc.c.orig	Sat Nov  2 17:58:50 1996
-+++ mjc/gdevmjc.c	Sun Nov 10 21:37:22 2002
++++ mjc/gdevmjc.c	Fri Dec 31 16:24:50 2004
 @@ -43,7 +43,8 @@
  #include <limits.h>
  #include "gdevprn.h"
@@ -259,6 +259,30 @@
  
  
  private int
+@@ -988,7 +980,7 @@
+ 
+ /* NOZ */
+   xtalbuff_size = plane_size*8 + 64;
+-  xtalbuff = (short *) gs_malloc( xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
++  xtalbuff = (short *) gs_malloc(pdev->memory, xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
+   memset(xtalbuff, 0, xtalbuff_size*(16*4+2*4) * W);
+   {
+   	int i;
+@@ -1027,12 +1019,12 @@
+   	p += xtalbuff_size;
+   }
+ 
+-  storage = (word *) gs_malloc(storage_size_words, W, "mj_colour_print_page");
++  storage = (word *) gs_malloc(pdev->memory, storage_size_words, W, "mj_colour_print_page");
+ 
+ /* prepare a temporary buffer for mj_raster_cmd */
+ 
+   mj_tmp_buf_size = plane_size;
+-  mj_tmp_buf = (byte *) gs_malloc(mj_tmp_buf_size, W ,"mj_raster_buffer");
++  mj_tmp_buf = (byte *) gs_malloc(pdev->memory, mj_tmp_buf_size, W ,"mj_raster_buffer");
+ 
+ #if 0
+   fprintf(stderr, "storage_size_words :%d\n", storage_size_words);
 @@ -1163,7 +1155,8 @@
  
    /* Send each scan line in turn */
@@ -269,7 +293,19 @@
      int cErr, mErr, yErr, kErr;
      int this_pass, i;
      long int lnum;
-@@ -1412,10 +1405,10 @@
+@@ -1403,19 +1396,19 @@
+     fflush(prn_stream);
+   }
+   /* free temporary storage */
+-  gs_free((char *) storage, storage_size_words, W, "mj_colour_print_page");
+-  gs_free((char *) mj_tmp_buf, mj_tmp_buf_size, W, "mj_raster_buffer");
+-  gs_free((char *) xtalbuff , xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
++  gs_free(pdev->memory, (char *) storage, storage_size_words, W, "mj_colour_print_page");
++  gs_free(pdev->memory, (char *) mj_tmp_buf, mj_tmp_buf_size, W, "mj_raster_buffer");
++  gs_free(pdev->memory, (char *) xtalbuff , xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
+ 
+   return 0;
+ }
  
  void 
  mj_color_correct(gx_color_value *Rptr ,gx_color_value *Gptr , gx_color_value *Bptr )
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevcd8.c print/ghostscript-afpl/files/patch-src:gdevcd8.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevcd8.c	Thu Jan  8 17:11:13 2004
+++ print/ghostscript-afpl/files/patch-src:gdevcd8.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
 --- src/gdevcd8.c.orig	Mon Feb 28 16:01:59 2000
-+++ src/gdevcd8.c	Wed Dec 10 21:32:53 2003
++++ src/gdevcd8.c	Fri Dec 17 19:42:52 2004
 @@ -406,19 +406,19 @@
  };
  
@@ -236,6 +236,24 @@
  
  
  private void
+@@ -1175,7 +1175,7 @@
+        2bpp feature of the hp850 someday, it is sized like storage.
+        storagee contains the errors from b/w fs-ditherng */
+ 
+-    data_ptrs.storage = (ulong *) gs_malloc(misc_vars.storage_size_words, W,
++    data_ptrs.storage = (ulong *) gs_malloc(pdev->memory, misc_vars.storage_size_words, W,
+ 					    "cdj850_print_page");
+ 
+     /* if we can't allocate working area */
+@@ -1196,7 +1196,7 @@
+     (*cdj850->terminate_page) (pdev, prn_stream);
+ 
+     /* Free Memory */
+-    gs_free((char *)data_ptrs.storage, misc_vars.storage_size_words, W,
++    gs_free(pdev->memory, (char *)data_ptrs.storage, misc_vars.storage_size_words, W,
+ 	    "hp850_print_page");
+ 
+     return 0;
 @@ -2744,13 +2744,14 @@
      (y) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
  
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevdj9.c print/ghostscript-afpl/files/patch-src:gdevdj9.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevdj9.c	Fri Jan  3 20:35:07 2003
+++ print/ghostscript-afpl/files/patch-src:gdevdj9.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
---- src/gdevdj9.c.orig	Fri Nov  8 06:15:08 2002
-+++ src/gdevdj9.c	Sun Nov 10 22:00:45 2002
+--- src/gdevdj9.c.orig	Fri Dec 17 19:31:42 2004
++++ src/gdevdj9.c	Fri Dec 17 19:44:07 2004
 @@ -243,19 +243,19 @@
  };
  
@@ -205,6 +205,24 @@
  
  
  /* assign_dpi:  
+@@ -863,7 +863,7 @@
+ 		 2bpp feature of the hp970 someday, it is sized like storage.
+ 		 storagee contains the errors from b/w fs-ditherng */
+ 
+-	data_ptrs.storage = (ulong *) gs_malloc(misc_vars.storage_size_words, W,
++	data_ptrs.storage = (ulong *) gs_malloc(pdev->memory, misc_vars.storage_size_words, W,
+ 					    "cdj970_print_page");
+ 
+ 	/* if we can't allocate working area */
+@@ -884,7 +884,7 @@
+ 	(*cdj970->terminate_page) (pdev, prn_stream);
+ 
+ 	/* Free Memory */
+-	gs_free((char *)data_ptrs.storage, misc_vars.storage_size_words, W,
++	gs_free(pdev->memory, (char *)data_ptrs.storage, misc_vars.storage_size_words, W,
+ 	    "hp970_print_page");
+ 
+ 	PageCtr ++;
 @@ -2292,12 +2292,13 @@
  /* gdev_cmyk_map_cmyk_color: 
  ----------------------------------------------------------------------------------*/
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevgdi.c print/ghostscript-afpl/files/patch-src:gdevgdi.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevgdi.c	Mon Jul 21 15:54:04 2003
+++ print/ghostscript-afpl/files/patch-src:gdevgdi.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,5 @@
 --- src/gdevgdi.c.orig	Wed Jun 19 19:32:49 2002
-+++ src/gdevgdi.c	Mon Jul 21 13:44:41 2003
++++ src/gdevgdi.c	Fri Dec 31 17:41:18 2004
 @@ -60,8 +60,8 @@
  #define GDI_REPEAT_LENGTH 2
  #define GDI_BAND_HEIGHT   128
@@ -53,6 +53,19 @@
  private FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp);
  private FILE *WriteBandHeader(FILE *fp, unsigned int usBandNo, 
                       unsigned char ubCompMode, unsigned int usBandWidth, 
+@@ -193,9 +207,9 @@
+ 	}
+ 
+         ul_band_size = band_width_bytes * band_height;
+-        ibp = (byte *)gs_malloc(ul_band_size, 1, "gdi_print_page");
+-        obp = (byte *)gs_malloc(ul_band_size*13/10, 1, "gdi_print_page");
+-        tmp = (byte *)gs_malloc(raster, 1, "gdi_print_page");
++        ibp = (byte *)gs_malloc(pdev->memory, ul_band_size, 1, "gdi_print_page");
++        obp = (byte *)gs_malloc(pdev->memory, ul_band_size*13/10, 1, "gdi_print_page");
++        tmp = (byte *)gs_malloc(pdev->memory, raster, 1, "gdi_print_page");
+ 
+         if (!ibp) return_error(gs_error_VMerror);
+         if (!obp) return_error(gs_error_VMerror);
 @@ -220,7 +234,7 @@
              memset(obp, 0x00, ul_band_size*13/10);
              for (j=0; j<band_height; j++) {
@@ -102,7 +115,7 @@
 +		    int f, g, h;
 +		    if (!fudge) {
 +		      ASSERT(use_band == ibp);
-+		      use_band = (byte*)gs_malloc(ul_band_size, 1, "gdi_print_page/fudge");
++		      use_band = (byte*)gs_malloc(pdev->memory, ul_band_size, 1, "gdi_print_page/fudge");
 +		      fudge=1;
 +		    }
 +		    memcpy(use_band, ibp, ul_band_size);
@@ -130,7 +143,7 @@
 +	      oh_well:
 +		if (fudge > 1) {
 +		  ASSERT(use_band != ibp);
-+		  gs_free(use_band, ul_band_size, 1, "gdi_print_page/fudge");
++		  gs_free(pdev->memory, use_band, ul_band_size, 1, "gdi_print_page/fudge");
 +		  /*fprintf(stderr, "smartgdi: band %d fudge factor is %d\n", i, fudge);*/
 +		}
 +	      }
@@ -138,7 +151,7 @@
  		break;
  	    case GDI_COMP_SCANLINE:
                  ul_comp_size = bmp2run(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP);
-@@ -253,7 +323,7 @@
+@@ -253,15 +323,15 @@
  
              prn_stream = WriteBandHeader(prn_stream, i, compression_type, (band_width_bytes * 8),
                                           band_height, ul_comp_size); 
@@ -147,6 +160,17 @@
              fwrite(obp, ul_comp_size, 1, prn_stream);
          }
      
+         /* Trailer Output */
+         WriteTrailerData(prn_stream);
+-        gs_free(ibp, ul_band_size, 1, "gdi_line_buffer");
+-        gs_free(obp, ul_band_size*13/10, 1, "gdi_line_buffer");
+-        gs_free(tmp, raster, 1, "gdi_line_buffer");
++        gs_free(pdev->memory, ibp, ul_band_size, 1, "gdi_line_buffer");
++        gs_free(pdev->memory, obp, ul_band_size*13/10, 1, "gdi_line_buffer");
++        gs_free(pdev->memory, tmp, raster, 1, "gdi_line_buffer");
+         return code;
+ }
+ 
 @@ -271,50 +341,50 @@
    unsigned char buffer[300];
    int dots_per_inch = (int)pdev->y_pixels_per_inch;
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevlx50.c print/ghostscript-afpl/files/patch-src:gdevlx50.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevlx50.c	Sun Jun  8 04:38:06 2003
+++ print/ghostscript-afpl/files/patch-src:gdevlx50.c	Sun Jan  2 14:59:38 2005
@@ -1,5 +1,50 @@
---- src/gdevlx50.c.orig	Thu May 15 07:38:07 2003
-+++ src/gdevlx50.c	Thu May 15 08:02:58 2003
+--- src/gdevlx50.c.orig	Fri Dec 17 19:31:43 2004
++++ src/gdevlx50.c	Fri Dec 17 22:31:26 2004
+@@ -1120,18 +1120,18 @@
+ 
+ 				/* Allocate a buffer for a single scan line */
+ 	    lineBuffer	= (byte *)gs_alloc_byte_array
+-		( &gs_memory_default, lx5000dev->scanLineBytes, 1,
++		( lx5000dev->memory, lx5000dev->scanLineBytes, 1,
+ 		  "lx5000_print_page(lineBuffer)" );
+ 
+ 	    swipeBuf	= (byte *)gs_alloc_byte_array
+-		( &gs_memory_default, lx5000dev->swipeBufSize, 1,
++		( lx5000dev->memory, lx5000dev->swipeBufSize, 1,
+ 		  "lx5000_print_page(swipeBuf)" );
+ 
+ 	    for ( colour = 0 ; colour < numColours; colour++ )
+ 	    {
+ 		if ( ( colourBufs[colour] =
+ 		       (byte *)gs_alloc_byte_array
+-		       ( &gs_memory_default, lx5000dev->penBufSize, 1,
++		       ( lx5000dev->memory, lx5000dev->penBufSize, 1,
+ 			 "lx5000_print_page(colourBufs)"
+ 			 )
+ 		       ) == NULL )
+@@ -1172,19 +1172,19 @@
+ 	for ( colour = 0; colour < numColours; colour++ )
+ 	{
+ 	    if ( colourBufs[colour] != NULL )
+-		gs_free_object( &gs_memory_default,
++		gs_free_object( lx5000dev->memory,
+ 				(char *)colourBufs[colour],
+ 				"lx5000_print_page(colourBufs)" );
+ 	    colourBufs[ colour ]	= NULL;
+ 	    colourBufPtrs[ colour ]	= NULL;
+ 	}
+ 	if ( swipeBuf != NULL )
+-	    gs_free_object( &gs_memory_default,
++	    gs_free_object( lx5000dev->memory,
+ 			    (char *)swipeBuf, "lx5000_print_page(swipeBuf)" );
+ 	swipeBuf	= NULL;
+ 	*swipeBufPtr	= NULL;
+ 	if ( lineBuffer != NULL )
+-	    gs_free_object( &gs_memory_default,
++	    gs_free_object( lx5000dev->memory,
+ 		    (char *)lineBuffer, "lx5000_print_page(lineBuffer)" );
+ 	lineBuffer	= NULL;
+ 	*lineBufferPtr	= NULL;
 @@ -2603,9 +2603,12 @@
  
  /* Map CMYK to color. */
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevperm.c print/ghostscript-afpl/files/patch-src:gdevperm.c
--- /usr/HEAD/ports/print/ghostscript-gpl/files/patch-src:gdevperm.c	Thu Jan  1 01:00:00 1970
+++ print/ghostscript-afpl/files/patch-src:gdevperm.c	Fri Dec 31 14:32:25 2004
@@ -0,0 +1,11 @@
+--- src/gdevperm.c.orig	Fri Jun 18 16:00:47 2004
++++ src/gdevperm.c	Fri Dec 31 18:06:42 2004
+@@ -289,7 +289,7 @@
+ 	(strncmp((const char *)name, (const char *)str, name_size) == 0))
+ 
+ private int
+-perm_get_color_comp_index(const gx_device *pdev, const char *pname,
++perm_get_color_comp_index(gx_device *pdev, const char *pname,
+ 					int name_size, int component_type)
+ {
+     const gx_device_perm_t * const dev = (const gx_device_perm_t *)pdev;
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/pkg-descr print/ghostscript-afpl/pkg-descr
--- /usr/HEAD/ports/print/ghostscript-gpl/pkg-descr	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-afpl/pkg-descr	Sun Jan  2 14:59:38 2005
@@ -2,9 +2,9 @@
 all common and most esoteric platforms and supports many different printers
 and some displays.
 
-Versions entitled "GPL Ghostscript" are distributed with the GNU General
-Public License, which allows free use, and free copying and redistribution
-under certain conditions (including, in some cases, commercial distribution).
+Versions entitled "AFPL Ghostscript" are distributed with a licence different
+from the GPL. Read the file PUBLIC in the work/gsX.Y directory or in
+${PREFIX}/share/ghostscript/X.Y/doc/PUBLIC after installation for details !
 
 This port includes add-on packages (not part of the official gs release)
 	o HP2200 driver for HP DeskJet 8xx and Business Inkjet 2200
@@ -16,4 +16,5 @@
 	o Additional contributed uniprint driver profiles for
 	  - Epson Stylus Color 740 and Epson LQ-1170
 
-WWW: http://www.cs.wisc.edu/~ghost/doc/gnu/index.htm
+WWW: http://www.cs.wisc.edu/~ghost/doc/AFPL/index.htm
+     http://www.ghostscript.com/
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/pkg-plist print/ghostscript-afpl/pkg-plist
--- /usr/HEAD/ports/print/ghostscript-gpl/pkg-plist	Sat Oct 16 09:28:33 2004
+++ print/ghostscript-afpl/pkg-plist	Sun Jan  2 14:59:38 2005
@@ -1,4 +1,4 @@
- at comment $FreeBSD: ports/print/ghostscript-gpl/pkg-plist,v 1.37 2004/10/16 07:28:33 krion Exp $
+ at comment $FreeBSD: ports/print/ghostscript-afpl/pkg-plist,v 1.39 2004/12/31 13:32:24 krion Exp $
 bin/bdftops
 bin/dvipdf
 bin/eps2eps
@@ -76,14 +76,17 @@
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Add-RKSJ-V
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Add-V
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-CNS1-B5pc
+%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-CNS1-ETenms-B5
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-CNS1-H-CID
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-CNS1-H-Host
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-CNS1-H-Mac
+%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-CNS1-UCS2
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-GB1-GBK-EUC
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-GB1-GBpc-EUC
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-GB1-H-CID
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-GB1-H-Host
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-GB1-H-Mac
+%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-GB1-UCS2
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Japan1-0
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Japan1-1
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Japan1-2
@@ -97,6 +100,7 @@
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Japan1-UCS2
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Korea1-H-CID
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Korea1-H-Host
+%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Korea1-H-Mac
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Korea1-KSCms-UHC
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Korea1-KSCpc-EUC
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/Adobe-Korea1-UCS2
@@ -172,6 +176,7 @@
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-90ms-RKSJ
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-90pv-RKSJ
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-B5pc
+%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-ETen-B5
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-GBK-EUC
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-GBpc-EUC
 %%DATADIR%%/%%GS_VERSION%%/Resource/CMap/UCS2-KSCms-UHC
@@ -192,6 +197,7 @@
 %%DATADIR%%/%%GS_VERSION%%/Resource/ColorSpace/DefaultCMYK
 %%DATADIR%%/%%GS_VERSION%%/Resource/ColorSpace/DefaultGray
 %%DATADIR%%/%%GS_VERSION%%/Resource/ColorSpace/DefaultRGB
+%%DATADIR%%/%%GS_VERSION%%/Resource/ColorSpace/TrivialCMYK
 %%DATADIR%%/%%GS_VERSION%%/Resource/Decoding/Latin1
 %%DATADIR%%/%%GS_VERSION%%/Resource/Decoding/StandardEncoding
 %%DATADIR%%/%%GS_VERSION%%/Resource/Decoding/Unicode
@@ -201,6 +207,7 @@
 %%DATADIR%%/%%GS_VERSION%%/doc/C-style.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/Changes.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/Commprod.htm
+%%DATADIR%%/%%GS_VERSION%%/doc/Copying.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/DLL.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/Develop.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/Devices.htm
@@ -223,6 +230,7 @@
 %%DATADIR%%/%%GS_VERSION%%/doc/Make.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/New-user.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/News.htm
+%%DATADIR%%/%%GS_VERSION%%/doc/PUBLIC
 %%DATADIR%%/%%GS_VERSION%%/doc/Projects.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/Ps-style.htm
 %%DATADIR%%/%%GS_VERSION%%/doc/Ps2epsi.htm
diff -Nru /usr/HEAD/ports/print/ghostscript-gpl/scripts/configure print/ghostscript-afpl/scripts/configure
--- /usr/HEAD/ports/print/ghostscript-gpl/scripts/configure	Mon Nov 22 17:27:50 2004
+++ print/ghostscript-afpl/scripts/configure	Sun Jan  2 14:59:38 2005
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $FreeBSD: ports/print/ghostscript-gpl/scripts/configure,v 1.36 2004/11/22 16:27:50 krion Exp $
+# $FreeBSD: ports/print/ghostscript-afpl/scripts/configure,v 1.36 2004/12/31 13:32:25 krion Exp $
 
 # configure - gs driver preconfiguration, manual driver selection
 # by Andreas Klemm <andreas at FreeBSD.org>
@@ -32,7 +32,6 @@
 		lips2p lips3 lips4 bjc880j lips4v \
 		m8510 coslw2p coslwxl uniprint \
 		lj250 declj250 ap3250 epson eps9mid eps9high lp8000 \
-		epag \
 		escpage lp2000 \
 		alc8600 alc8500 alc2000 alc4000 alc1900 alc4100 \
 		lp9800c lp9000c lp9500c lp8800c lp8300c lp8500c lp3000c \
@@ -52,7 +51,7 @@
 		pj pjetxl pjxl paintjet \
 		pjxl300 pxlmono pxlcolor \
 		ijs ibmpro jetp3852 imagen fs600 lxm5700m \
-		lxm3200 lx5000 lex2050 lex3200 lex5700 lex7000 \
+		lx5000 lex2050 lex3200 lex5700 lex7000 \
 		cp50 necp6 \
 		npdl \
 		oce9050 oki182 okiibm atx23 atx24 atx38 r4081 \
@@ -66,7 +65,6 @@
 		xcf xcfcmyk \
 		faxg3 faxg32d faxg4 \
 		miff24 inferno jpeg jpeggray \
-		mgrmono mgrgray2 mgrgray4 mgrgray8 mgr4 mgr8 \
 		pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk pdfwrite \
 		psdrgb psdcmyk \
 		bit bitrgb bitcmyk plan9bm pam pbm pbmraw \
@@ -86,7 +84,7 @@
 done
 
 if [ -z "${BATCH}" ]; then
-	/usr/bin/dialog --title "GPL Ghostscript driver configuration" --clear \
+	/usr/bin/dialog --title "AFPL Ghostscript driver configuration" --clear \
 		--checklist "\n\
 This new ghostscript driver configuration dialog allows you to choose \n\
 only those gs drivers, you really need. Don't think too economical, since \n\
@@ -150,7 +148,6 @@
   "eps9mid"  "Epson-compatible 9-pin, interleaved lines, medium resol" "$status_eps9mid" \
   "eps9high" "Epson-compatible 9-pin, interleaved lines, triple resol" "$status_eps9high" \
   "lp8000"   "Epson LP-8000 line printer" "$status_lp8000" \
-  "epag"     "Epson ESC/Page laser printer (generic) [EPAG]" "$status_epag" \
   "escpage"  "Epson ESC/Page laser printer (generic) [LIPS]" "$status_escpage" \
   "lp2000"   "Epson LP-2000/3000/7000/7000G laser printer [LIPS]" "$status_lp2000" \
   "alc8600"  "Epson AL-C8600 color laser printer [EPLASER]" "$status_alc8600" \
@@ -248,7 +245,6 @@
   "imagen"   "Imagen ImPress printers" "$status_imagen" \
   "fs600"    "Kyocera FS-600 (600 dpi)" "$status_fs600" \
   "lxm5700m" "Lexmark 5700 monotone" "$status_lxm5700m" \
-  "lxm3200"  "Lexmark 3200/Z12/Z22/Z31/Z32 [LXM3200]" "$status_lxm3200" \
   "lx5000"   "Lexmark 5000/Z51/Z82 [LX5000]" "$status_lx5000" \
   "lex2050"  "Lexmark 2050 [LEX7000]" "$status_lex2050" \
   "lex3200"  "Lexmark 3200 [LEX7000]" "$status_lex3200" \
@@ -295,12 +291,6 @@
   "inferno"  "Inferno bitmaps" "$status_inferno" \
   "jpeg"     "JPEG format, RGB output" "$status_jpeg" \
   "jpeggray" "JPEG format, gray output" "$status_jpeggray" \
-  "mgrmono"  "MGR devices 1-bit monochrome" "$status_mgrmono" \
-  "mgrgray2" "MGR devices 2-bit gray scale" "$status_mgrgray2" \
-  "mgrgray4" "MGR devices 4-bit gray scale" "$status_mgrgray4" \
-  "mgrgray8" "MGR devices 8-bit gray scale" "$status_mgrgray8" \
-  "mgr4"     "MGR devices 4-bit (VGA) color" "$status_mgr4" \
-  "mgr8"     "MGR devices 8-bit color" "$status_mgr8" \
   "pcxmono"  "PCX file format, monochrome 1-bit b/w" "$status_pcxmono" \
   "pcxgray"  "PCX file format, 8-bit gray scale" "$status_pcxgray" \
   "pcx16"    "PCX file format, 4-bit planar EGA/VGA color" "$status_pcx16" \
--- patch-ghostscript-afpl ends here ---

--- patch-cups-pstoraster begins here ---
diff -Nru /usr/HEAD/ports/print/cups-pstoraster/Makefile print/cups-pstoraster/Makefile
--- /usr/HEAD/ports/print/cups-pstoraster/Makefile	Thu Dec 16 20:18:02 2004
+++ print/cups-pstoraster/Makefile	Wed Jan 26 22:39:25 2005
@@ -6,25 +6,24 @@
 #
 
 PORTNAME=	cups-pstoraster
-PORTVERSION=	7.07
-PORTREVISION=	3
+PORTVERSION=	${CUPS_PORTVER}
+PORTREVISION=	${CUPS_PORTREV}
+PORTEPOCH=	1
 CATEGORIES=	print
-MASTER_SITES=	${MASTER_SITE_SOURCEFORGE} \
-		ftp://ftp.easysw.com/pub/ghostscript/
-MASTER_SITE_SUBDIR=	ghostscript espgs
-DISTFILES=	ghostscript-${PORTVERSION}${EXTRACT_SUFX} \
-		espgs-${ESPGS_VER}-source${EXTRACT_SUFX}
-DIST_SUBDIR=	ghostscript
+MASTER_SITES=	${CUPS_MASTER_SITES}
+DISTFILES=	${DISTNAME}.tar.bz2
 
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	GNU Postscript interpreter for CUPS printing to non-PS printers
 
+PATCH_DEPENDS=	${NONEXISTENT}:${PORTSDIR}/${GHOSTSCRIPT_PORT}:patch
 LIB_DEPENDS=	cups.2:${PORTSDIR}/print/cups-base
-RUN_DEPENDS=	${LOCALBASE}/share/ghostscript/${PORTVERSION}/lib/gs_init.ps:${PORTSDIR}/print/ghostscript-gnu
+USE_GHOSTSCRIPT_RUN=	true
 
-ESPGS_VER=	7.07.1
-ESPGS_WRKSRC=	${WRKDIR}/espgs-${ESPGS_VER}/pstoraster
-WRKSRC=		${WRKDIR}/ghostscript-${PORTVERSION}
+ESPGS_WRKSRC=	${WRKDIR}/cups-${CUPS_VERSION}/pstoraster
+MD5_FILE=	${.CURDIR}/../../print/cups/distinfo
+EXTRACT_AFTER_ARGS=	| ${TAR} -xf - cups-${CUPS_VERSION}/pstoraster
+WRKSRC=		${WRKDIRPREFIX}${PORTSDIR}/${GHOSTSCRIPT_PORT}/work/ghostscript
 
 USE_BZIP2=	yes
 USE_REINPLACE=	yes
@@ -37,7 +36,6 @@
 		--with-gs=espgs
 MAKE_ARGS=	CFLAGS_STANDARD="${CFLAGS} -DUPD_SIGNAL=0" \
 		DEVICE_DEVS="\$$(DD)cups.dev \$$(DD)pxlcolor.dev \$$(DD)pxlmono.dev"
-
 PLIST_FILES=	bin/espgs etc/cups/pstoraster.convs \
 		libexec/cups/filter/pstopxl libexec/cups/filter/pstoraster \
 		share/cups/model/pxlcolor.ppd share/cups/model/pxlmono.ppd
@@ -71,5 +69,10 @@
 .endfor
 
 .include "${.CURDIR}/../../print/cups/Makefile.common"
+.if ${CUPS_REVISION} < 1
+DISTNAME=	cups-${CUPS_VERSION}-source
+.else
+DISTNAME=	cups-${CUPS_VERSION}-${CUPS_REVISION}-source
+.endif
 .include <bsd.port.pre.mk>
 .include <bsd.port.post.mk>
diff -Nru /usr/HEAD/ports/print/cups-pstoraster/files/patch-src:genarch.c print/cups-pstoraster/files/patch-src:genarch.c
--- /usr/HEAD/ports/print/cups-pstoraster/files/patch-src:genarch.c	Thu Jul 25 05:00:17 2002
+++ print/cups-pstoraster/files/patch-src:genarch.c	Tue Jan 25 21:13:39 2005
@@ -1,34 +0,0 @@
---- src/genarch.c.orig	Tue Jun  5 15:38:57 2001
-+++ src/genarch.c	Wed Jun 20 04:17:42 2001
-@@ -41,6 +41,7 @@
-     fprintf(f, "\n\t /* ---------------- %s ---------------- */\n\n", str);
- }
- 
-+#ifndef __FreeBSD__
- private clock_t
- time_clear(char *buf, int bsize, int nreps)
- {
-@@ -51,6 +52,7 @@
- 	memset(buf, 0, bsize);
-     return clock() - t;
- }
-+#endif /* __FreeBSD__ */
- 
- private void
- define(FILE *f, const char *str)
-@@ -181,6 +183,7 @@
-     fprintf(f, "((unsigned long)~0L + (unsigned long)0)\n");
- #undef PRINT_MAX
- 
-+#ifndef __FreeBSD__
-     section(f, "Cache sizes");
- 
-     /*
-@@ -241,6 +244,7 @@
- 	}
- 	define_int(f, "ARCH_CACHE2_SIZE", bsize >> 1);
-     }
-+#endif /* __FreeBSD__ */
- 
-     section(f, "Miscellaneous");
- 
diff -Nru /usr/HEAD/ports/print/cups-pstoraster/files/patch-src:gxobj.h print/cups-pstoraster/files/patch-src:gxobj.h
--- /usr/HEAD/ports/print/cups-pstoraster/files/patch-src:gxobj.h	Fri Nov 26 22:05:46 2004
+++ print/cups-pstoraster/files/patch-src:gxobj.h	Tue Jan 25 21:13:39 2005
@@ -1,17 +0,0 @@
---- src/gxobj.h.orig	Fri Feb 22 19:45:59 2002
-+++ src/gxobj.h	Thu Dec 19 00:16:57 2002
-@@ -99,10 +99,14 @@
-  * The final | is because back pointer values are divided by obj_back_scale,
-  * so objects must be aligned at least 0 mod obj_back_scale.
-  */
-+#if !defined(__ia64__) && !defined(__amd64__)
- #define obj_align_mod\
-   (((arch_align_long_mod - 1) | (arch_align_ptr_mod - 1) |\
-     (arch_align_double_mod - 1) | (align_bitmap_mod - 1) |\
-     (obj_back_scale - 1)) + 1)
-+#else
-+#define obj_align_mod	16
-+#endif
- /* The only possible values for obj_align_mod are 4, 8, or 16.... */
- #if obj_align_mod == 4
- #  define log2_obj_align_mod 2
--- patch-cups-pstoraster ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list