aboutsummaryrefslogtreecommitdiffstats
path: root/print/ghostscript-gpl
diff options
context:
space:
mode:
authorbarner <barner@FreeBSD.org>2005-06-11 01:10:07 +0800
committerbarner <barner@FreeBSD.org>2005-06-11 01:10:07 +0800
commit06232bb20be97667a6c0f557ce2a46cca35eb53a (patch)
tree77767eefa4c383ee9edf938bbc27a72db666e653 /print/ghostscript-gpl
parent1087956c6ddf8d41b030669f36fca18960a635f4 (diff)
downloadfreebsd-ports-gnome-06232bb20be97667a6c0f557ce2a46cca35eb53a.tar.gz
freebsd-ports-gnome-06232bb20be97667a6c0f557ce2a46cca35eb53a.tar.zst
freebsd-ports-gnome-06232bb20be97667a6c0f557ce2a46cca35eb53a.zip
- Fix build on 4-stable when PCL3 driver is enabled [1]
- Update MASTER_SITES for MD2K driver - Add DMPRT driver - Add patches necessary for building cups-pstoraster - Add KRGB support patch for IJS driver Submitted by: KATO Tsuguru <tkato432@yahoo.com> Tested by: Jose M Rodriguez <josemi@freebsd.jazztel.es> Pointy hat to: barner [1] Reported by: kris via pointyhat [1]
Diffstat (limited to 'print/ghostscript-gpl')
-rw-r--r--print/ghostscript-gpl/Makefile77
-rw-r--r--print/ghostscript-gpl/Makefile.inc2
-rw-r--r--print/ghostscript-gpl/distinfo2
-rw-r--r--print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c63
-rw-r--r--print/ghostscript-gpl/files/patch-lib-gs_setpd.ps98
-rw-r--r--print/ghostscript-gpl/files/patch-lib:gs_init.ps18
-rw-r--r--print/ghostscript-gpl/files/patch-pcl3_eprn_eprnrend.c80
-rw-r--r--print/ghostscript-gpl/files/patch-src-dmp_site.ps10
-rw-r--r--print/ghostscript-gpl/files/patch-src-dviprlib.c135
-rw-r--r--print/ghostscript-gpl/files/patch-src-dviprlib.h38
-rw-r--r--print/ghostscript-gpl/files/patch-src-gdevdmpr.c64
-rw-r--r--print/ghostscript-gpl/files/patch-src-gdevdmpr.mak21
-rw-r--r--print/ghostscript-gpl/files/patch-src-gdevijs.c659
-rw-r--r--print/ghostscript-gpl/pkg-descr11
-rw-r--r--print/ghostscript-gpl/pkg-plist53
-rw-r--r--print/ghostscript-gpl/scripts/configure7
16 files changed, 1247 insertions, 91 deletions
diff --git a/print/ghostscript-gpl/Makefile b/print/ghostscript-gpl/Makefile
index 72758b9fed31..8d45ac32f76a 100644
--- a/print/ghostscript-gpl/Makefile
+++ b/print/ghostscript-gpl/Makefile
@@ -12,9 +12,9 @@ PORTEPOCH= ${GS_EPOCH}
CATEGORIES= print
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S/$/:gs_srcs,bjc250/} \
http://www.gelhaus.net/hp880c/1.4beta/:hp8xx \
- http://home.vrweb.de/~martin.lottermoser/pcl3dist/:pcl3 \
+ http://home.vrweb.de/martin.lottermoser/pcl3dist/:pcl3 \
http://www.harsch.net/Download/:dj970 \
- http://plaza26.mbn.or.jp/~higamasa/gdevmd2k/:md2k \
+ http://www33.ocn.ne.jp/~higamasa/gdevmd2k/:md2k \
${MASTER_SITE_PORTS_JP:S/$/:ports_jp,ports_jp_gs/} \
ftp://download.canon-sales.co.jp/pub/driver/lasershot/linux/:cpca \
http://www.ucatv.ne.jp/~taeko/software/gs/:lips \
@@ -38,6 +38,7 @@ DISTFILES= ${GS_SRCS}:gs_srcs \
${BJC250_SRCS}:bjc250 \
${CPCA_SRCS}:cpca \
${LIPS_SRCS}:lips \
+ ${DMPRT_SRCS}:ports_jp_gs \
${EPAG_SRCS}:epag \
${EPLASER_SRCS}:eplaser \
${MJC_SRCS}:ports_jp \
@@ -55,15 +56,15 @@ LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \
png.5:${PORTSDIR}/graphics/png
RUN_DEPENDS= ${LOCALBASE}/share/ghostscript/fonts/a010013l.pfb:${PORTSDIR}/print/gsfonts
+# normazile WRKSRC so things like cups-pstoraster may work
+WRKSRC= ${WRKDIR}/${PORTNAME}
+
CONFLICTS= ghostscript-afpl* ghostscript-gnu*
USE_BZIP2= yes
USE_REINPLACE= yes
USE_GMAKE= yes
MAKE_ENV= CC="${CC}" CXX="${CXX}" CFLAGS_STANDARD="${CFLAGS}" \
XCFLAGS="${XCFLAGS}"
-ALL_TARGET= all
-INSTALL_TARGET= install
-
PLIST_SUB= GS_VERSION="${GS_VERSION}" \
CIDFONTDIR=${CIDFONTDIR}
@@ -107,12 +108,13 @@ MAKE_ENV+= FT_BRIDGE=1 FT_ROOT="${WRKSRC}/freetype" FT_LIB_EXT=".a"
.undef WITHOUT_X11
USE_GNOME= gtk12
MAKE_ENV+= GS_SHLIB_VER="${SHLIB_VER}"
-ALL_TARGET= so
+ALL_TARGET= so pcl3opts
INSTALL_TARGET= soinstall
INSTALLS_SHLIB= yes
SHLIB_VER= 1
PLIST_SUB+= SHLIB="" SHLIB_VER="${SHLIB_VER}"
.else
+ALL_TARGET= all pcl3opts
PLIST_SUB+= SHLIB="@comment "
.endif
@@ -126,11 +128,8 @@ CIDFONTDIR= ${PREFIX}/share/ghostscript/${GS_VERSION}/Resource
HP8XX= cdj880
HP8XX_SRCS= gdevcd8.tar.gz
-# PCL3 (hpdj successor now in RELEASE quality)
-# additional driver for HP PCL3 printers, by Martin Lottermoser
+# PCL3 - additional driver for HP PCL3 printers, by Martin Lottermoser
# http://home.vrweb.de/martin.lottermoser/pcl3.html
-ALL_TARGET+= pcl3opts
-INSTALL_TARGET+= pcl3-install
PCL3= pcl3
PCL3_VERS= 3.3
PCL3_NAME= ${PCL3}-${PCL3_VERS}
@@ -138,14 +137,13 @@ PCL3_SRCS= ${PCL3_NAME}.tar.gz
PCL3_MAN1= gs-pcl3.1 pcl3opts.1
MAN1+= ${PCL3_MAN1}
-#
# DJ970 - additional driver for HP DeskJet 970, supports duplex printing
# http://www.harsch.net/Ghostscript/ghostscript.html
DJ970= gdevdj9
DJ970_SRCS= ${DJ970}.c.gz
# MD2K - additional driver for Alps MD-2000/2010/4000/1300/1500/5000
-# http://plaza26.mbn.or.jp/~higamasa/gdevmd2k/
+# http://www33.ocn.ne.jp/~higamasa/gdevmd2k/
MD2K= md2k
MD2K_VERS= 0.2a
MD2K_NAME= gdevmd2k-${MD2K_VERS}
@@ -183,6 +181,12 @@ LIPS_VERS= 2.4.0
LIPS_NAME= gdevlips-${LIPS_VERS}
LIPS_SRCS= ${LIPS_NAME}.tar.gz
+# DMPRT - additional driver for generic dot matrix printers
+DMPRT= dmprt
+DMPRT_VERS= 2.01
+DMPRT_NAME= ${DMPRT}-${DMPRT_VERS}
+DMPRT_SRCS= ${DMPRT_NAME}.tar.gz
+
# EPAG - additional driver for Epson ESC/Page printers
# http://www.humblesoft.com/gdevepag.html
EPAG= epag
@@ -190,8 +194,8 @@ EPAG_VERS= 3.09
EPAG_NAME= ${EPAG}-${EPAG_VERS}
EPAG_SRCS= ${EPAG_NAME}.tar.gz
-# EPLASER - additional driver for ESC/Page printers (Epson Kowa developed)
-# http://www.epkowa.co.jp/english/linux_e/index.html
+# EPLASER - additional driver for ESC/Page printers, by EPSON AVASYS Corp.
+# http://www.avasys.jp/english/linux_e/index.html
EPLASER= eplaser
EPLASER_VERS= 3.1.4
EPLASER_NAME= ${EPLASER}-${EPLASER_VERS}
@@ -241,6 +245,8 @@ pre-everything::
post-extract:
${ECHO_MSG} ">>> in post-extract ..."
+# normazile WRKSRC so things like cups-pstoraster may work
+ ${LN} -sf ${WRKDIR}/${DISTNAME} ${WRKDIR}/${PORTNAME}
# ** 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!
@@ -283,6 +289,9 @@ post-extract:
${ECHO_MSG} ">>> extracting ${LIPS_SRCS} ..."
${TAR} -C ${WRKSRC} -xzf ${DISTDIR}/${DIST_SUBDIR}/${LIPS_SRCS}
${LN} -sf ${LIPS_NAME} ${WRKSRC}/${LIPS}
+# for DMPRT driver
+ ${ECHO_MSG} ">>> extracting ${DMPRT_SRCS} ..."
+ ${TAR} -C ${WRKSRC}/src -xzf ${DISTDIR}/${DIST_SUBDIR}/${DMPRT_SRCS}
# for EPAG driver
${ECHO_MSG} ">>> extracting ${EPAG_SRCS} ..."
${TAR} -C ${WRKSRC} -xzf ${DISTDIR}/${DIST_SUBDIR}/${EPAG_SRCS}
@@ -316,6 +325,10 @@ post-patch:
${WRKSRC}/src/unix-gcc.mak
${REINPLACE_CMD} -e 's|\. de|\.|g' \
${WRKSRC}/src/unixinst.mak
+# for DMPRT driver
+ ${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g ; \
+ s|%%GS_VERSION%%|${GS_VERSION}|g' \
+ ${WRKSRC}/src/dmp_site.ps
# here we apply the modifications necessary to build the 3rd party drivers
# advantage: you see unmodified makefiles after a pure make extract
@@ -325,14 +338,14 @@ pre-configure:
${ECHO_MSG} ">>> adding ${HP8XX} driver to contrib.mak ..."
${CAT} ${FILESDIR}/cdj850.contrib.mak \
>> ${WRKSRC}/src/contrib.mak
-# for PCL3 driver
- ${ECHO_MSG} ">>> adding ${PCL3} driver to contrib.mak ..."
- ${CAT} ${WRKSRC}/${PCL3_NAME}/src/contrib.mak-7.00.add \
- >> ${WRKSRC}/src/contrib.mak
# for DJ970 driver
${ECHO_MSG} ">>> adding ${DJ970} driver to contrib.mak ..."
${CAT} ${FILESDIR}/dj970.contrib.mak \
>> ${WRKSRC}/src/contrib.mak
+# for PCL3 driver
+ ${ECHO_MSG} ">>> adding ${PCL3} driver to contrib.mak ..."
+ ${CAT} ${WRKSRC}/${PCL3_NAME}/src/contrib.mak-7.00.add \
+ >> ${WRKSRC}/src/contrib.mak
# for MD2K driver
${ECHO_MSG} ">>> adding ${MD2K} driver to contrib.mak ..."
${CAT} ${WRKSRC}/${MD2K_NAME}/gdevmd2k.mak-5.50 \
@@ -357,6 +370,10 @@ pre-configure:
${ECHO_MSG} ">>> adding ${LIPS} driver to contrib.mak ..."
${CAT} ${WRKSRC}/${LIPS_NAME}/gdevlips.mak \
>> ${WRKSRC}/src/contrib.mak
+# for DMPRT driver
+ ${ECHO_MSG} ">>> adding ${DMPRT} driver to contrib.mak ..."
+ ${CAT} ${WRKSRC}/src/gdevdmpr.mak \
+ >> ${WRKSRC}/src/contrib.mak
# for EPAG driver
${ECHO_MSG} ">>> adding ${EPAG} driver to contrib.mak ..."
${CAT} ${FILESDIR}/epag.contrib.mak \
@@ -475,7 +492,14 @@ post-install:
.else
${STRIP_CMD} ${PREFIX}/bin/gs
.endif
-# for PCL3 driver, stuff which might be interesting for runtime
+# for PCL3 driver
+ ${ECHO_MSG} ">>> installing ${PCL3} utility in bindir ..."
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/pcl3opts ${PREFIX}/bin
+ ${ECHO_MSG} ">>> installing ${PCL3} manpages ..."
+.for i in ${PCL3_MAN1}
+ ${INSTALL_MAN} ${WRKSRC}/${PCL3_NAME}/doc/${i} ${MANPREFIX}/man/man1
+.endfor
+# other pcl3 stuff, which might be interesting for runtime
${ECHO_MSG} ">>> creating ${PCL3} destdir ..."
${MKDIR} ${DATADIR}/${GS_VERSION}/${PCL3}
${ECHO_MSG} ">>> installing files in ${PCL3} destdir ..."
@@ -487,6 +511,12 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/${PCL3_NAME}/${i} \
${DATADIR}/${GS_VERSION}/${PCL3}
.endfor
+# for DMPRT driver
+ ${ECHO_MSG} ">>> installing ${DMPRT} resources ..."
+.for i in dmp_init.ps dmp_site.ps escp_24.src
+ ${INSTALL_DATA} ${WRKSRC}/src/${i} \
+ ${DATADIR}/${GS_VERSION}/lib
+.endfor
# for EPAG driver
${ECHO_MSG} ">>> installing ${EPAG} utility in bindir ..."
${INSTALL_PROGRAM} ${WRKSRC}/${EPAG_NAME}/ert ${PREFIX}/bin
@@ -505,7 +535,7 @@ post-install:
# for PCL3 driver
${ECHO_MSG} ">>> installing ${PCL3} docs ..."
${MKDIR} ${DOCSDIR}/${GS_VERSION}/${PCL3}
-.for i in NEWS doc/how-to-report.txt
+.for i in NEWS doc/gs-pcl3.html doc/how-to-report.txt doc/pcl3opts.html
${INSTALL_DATA} ${WRKSRC}/${PCL3_NAME}/${i} \
${DOCSDIR}/${GS_VERSION}/${PCL3}
.endfor
@@ -537,6 +567,13 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/${LIPS_NAME}/${i} \
${DOCSDIR}/${GS_VERSION}/${LIPS}
.endfor
+# for DMPRT driver
+ ${ECHO_MSG} ">>> installing ${DMPRT} docs ..."
+ ${MKDIR} ${DOCSDIR}/${GS_VERSION}/${DMPRT}
+.for i in gdevdmpr.sj
+ ${INSTALL_DATA} ${WRKSRC}/src/${i} \
+ ${DOCSDIR}/${GS_VERSION}/${DMPRT}
+.endfor
# for EPAG driver
${ECHO_MSG} ">>> installing ${EPAG} docs ..."
${MKDIR} ${DOCSDIR}/${GS_VERSION}/${EPAG}
diff --git a/print/ghostscript-gpl/Makefile.inc b/print/ghostscript-gpl/Makefile.inc
index 1740763c829b..1a5f16437f99 100644
--- a/print/ghostscript-gpl/Makefile.inc
+++ b/print/ghostscript-gpl/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
GS_VERSION= 8.15
-GS_REVISION= 0
+GS_REVISION= 1
GS_EPOCH= 0
diff --git a/print/ghostscript-gpl/distinfo b/print/ghostscript-gpl/distinfo
index 9538f043db69..0ef9d79ce600 100644
--- a/print/ghostscript-gpl/distinfo
+++ b/print/ghostscript-gpl/distinfo
@@ -18,6 +18,8 @@ MD5 (ghostscript/canon-lips4-1.0.0-651.tgz) = 3105272a9351ea632416b53367e2f38a
SIZE (ghostscript/canon-lips4-1.0.0-651.tgz) = 38835
MD5 (ghostscript/gdevlips-2.4.0.tar.gz) = 89327cac37665f3fdbae0da5f2c8a89f
SIZE (ghostscript/gdevlips-2.4.0.tar.gz) = 67683
+MD5 (ghostscript/dmprt-2.01.tar.gz) = c7a9fb127fde5d888a798bf5e1822b88
+SIZE (ghostscript/dmprt-2.01.tar.gz) = 44232
MD5 (ghostscript/epag-3.09.tar.gz) = 63304a6afe44842124d2d880bf24dbe3
SIZE (ghostscript/epag-3.09.tar.gz) = 12858
MD5 (ghostscript/eplaser-3.1.4-705.tgz) = 94246b034af171b4336d90198e9f4bd8
diff --git a/print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c b/print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c
new file mode 100644
index 000000000000..4afb11ef9e51
--- /dev/null
+++ b/print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c
@@ -0,0 +1,63 @@
+--- src/gdevdmpr.c.orig Tue May 13 20:43:37 1997
++++ src/gdevdmpr.c Tue May 24 21:41:23 2005
+@@ -41,7 +41,7 @@
+ /* include library header. */
+ #include "dviprlib.h"
+
+-extern FILE *lib_fopen(P1(const char *));
++extern FILE *lib_fopen(const char *);
+
+ #define LOCAL_DEBUG 0
+
+@@ -87,12 +87,12 @@
+ private dev_proc_close_device(gdev_dmprt_close);
+
+ /* declarations of sub functions to get printer properties. */
+-private void gdev_dmprt_init_printer_props(P1(gx_device_dmprt *));
+-private int gdev_dmprt_get_printer_props(P2(gx_device_dmprt *,char *));
+-private int gdev_dmprt_check_code_props(P2(byte * ,int ));
+-private FILE *gdev_dmprt_dviprt_lib_fopen(P2(const char *,char *));
++private void gdev_dmprt_init_printer_props(gx_device_dmprt *);
++private int gdev_dmprt_get_printer_props(gx_device_dmprt *,char *);
++private int gdev_dmprt_check_code_props(byte * ,int );
++private FILE *gdev_dmprt_dviprt_lib_fopen(const char *,char *);
+
+-private int gdev_dmprt_error_no_dviprt_to_gs(P1(int ));
++private int gdev_dmprt_error_no_dviprt_to_gs(int );
+
+ /* The device descriptor */
+ gx_device_procs prn_dmprt_procs = {
+@@ -833,6 +833,7 @@
+ return code;
+ }
+
++private const char * gp_file_name_concat_string(const char *, unsigned);
+ private FILE *
+ gdev_dmprt_dviprt_lib_fopen(const char *fnamebase,char *fname)
+ {
+@@ -845,8 +846,7 @@
+ env = getenv("TEXCFG");
+ if (env) {
+ strcpy(fname,env);
+- strcat(fname,
+- gp_file_name_concat_string(env,strlen(env),fname,strlen(fnamebase)));
++ strcat(fname, gp_file_name_concat_string(env,strlen(env)));
+ strcat(fname,fnamebase);
+ fp = fopen(fname,gp_fmode_rb);
+ }
+@@ -867,4 +867,15 @@
+ default:
+ return -1;
+ }
++}
++
++/* Answer the string to be used for combining a directory/device prefix */
++/* with a base file name. The prefix directory/device is examined to */
++/* determine if a separator is needed and may return an empty string */
++private const char *
++gp_file_name_concat_string(const char *prefix, unsigned plen)
++{
++ if (plen > 0 && prefix[plen - 1] == '/')
++ return "";
++ return "/";
+ }
diff --git a/print/ghostscript-gpl/files/patch-lib-gs_setpd.ps b/print/ghostscript-gpl/files/patch-lib-gs_setpd.ps
new file mode 100644
index 000000000000..2bd645bb99fe
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lib-gs_setpd.ps
@@ -0,0 +1,98 @@
+--- lib/gs_setpd.ps.orig Tue Sep 14 07:32:19 2004
++++ lib/gs_setpd.ps Tue May 24 22:20:49 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 --git a/print/ghostscript-gpl/files/patch-lib:gs_init.ps b/print/ghostscript-gpl/files/patch-lib:gs_init.ps
index 70de88245ddc..22d48fd79896 100644
--- a/print/ghostscript-gpl/files/patch-lib:gs_init.ps
+++ b/print/ghostscript-gpl/files/patch-lib:gs_init.ps
@@ -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 Tue Sep 7 00:40:52 2004
++++ lib/gs_init.ps Tue May 24 22:19:25 2005
+@@ -122,6 +122,7 @@
+ currentdict /DELAYBIND known /DELAYBIND exch def
+ currentdict /DISKFONTS known /DISKFONTS exch def
+ currentdict /DOINTERPOLATE .knownget { /INTERPOLATE exch def } if
++currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
+ currentdict /ESTACKPRINT known /ESTACKPRINT exch def
+ currentdict /FAKEFONTS known /FAKEFONTS exch def
+ currentdict /FIXEDMEDIA known /FIXEDMEDIA exch def
+@@ -1420,7 +1421,7 @@
% Set the default screen and BG/UCR.
/.setdefaultbgucr {
systemdict /setblackgeneration known {
@@ -9,8 +17,8 @@
} if
} bind def
/.useloresscreen { % - .useloresscreen <bool>
-@@ -1874,3 +1874,7 @@
- userdict /AGM_preserve_spots false put
+@@ -2199,3 +2200,7 @@
+ ifelse
% The interpreter will run the initial procedure (start).
+
diff --git a/print/ghostscript-gpl/files/patch-pcl3_eprn_eprnrend.c b/print/ghostscript-gpl/files/patch-pcl3_eprn_eprnrend.c
index d9adf9bbafa2..69dd96167b0c 100644
--- a/print/ghostscript-gpl/files/patch-pcl3_eprn_eprnrend.c
+++ b/print/ghostscript-gpl/files/patch-pcl3_eprn_eprnrend.c
@@ -1,60 +1,64 @@
--- pcl3/eprn/eprnrend.c.orig 2005-01-19 00:24:24.924311968 +0100
-+++ pcl3/eprn/eprnrend.c 2005-01-19 01:24:06.024901928 +0100
-@@ -161,8 +161,10 @@
+--- pcl3/eprn/eprnrend.c.orig Wed Aug 1 14:12:56 2001
++++ pcl3/eprn/eprnrend.c Tue May 24 20:19:18 2005
+@@ -161,8 +161,11 @@
******************************************************************************/
gx_color_index eprn_map_rgb_color_for_RGB(gx_device *device,
- gx_color_value red, gx_color_value green, gx_color_value blue)
+ const gx_color_value cv[])
{
-+ gx_color_value red, green, blue;
-+ red = cv[0]; green = cv[1]; blue = cv[2];
++ gx_color_value red = cv[0];
++ gx_color_value green = cv[1];
++ gx_color_value blue = cv[2];
static const gx_color_value half = gx_max_color_value/2;
gx_color_index value = 0;
const eprn_Device *dev = (eprn_Device *)device;
-@@ -197,8 +199,10 @@
+@@ -197,8 +200,11 @@
******************************************************************************/
gx_color_index eprn_map_rgb_color_for_CMY_or_K(gx_device *device,
- gx_color_value red, gx_color_value green, gx_color_value blue)
+ const gx_color_value cv[])
{
-+ gx_color_value red, green, blue;
-+ red = cv[0]; green = cv[1]; blue = cv[2];
++ gx_color_value red = cv[0];
++ gx_color_value green = cv[1];
++ gx_color_value blue = cv[2];
static const gx_color_value half = gx_max_color_value/2;
gx_color_index value = (CYAN_BIT | MAGENTA_BIT | YELLOW_BIT);
const eprn_Device *dev = (eprn_Device *)device;
-@@ -240,8 +244,10 @@
+@@ -240,8 +246,11 @@
******************************************************************************/
gx_color_index eprn_map_rgb_color_for_RGB_flex(gx_device *device,
- gx_color_value red, gx_color_value green, gx_color_value blue)
+ const gx_color_value cv[])
{
-+ gx_color_value red, green, blue;
-+ red = cv[0]; green = cv[1]; blue = cv[2];
++ gx_color_value red = cv[0];
++ gx_color_value green = cv[1];
++ gx_color_value blue = cv[2];
gx_color_index value = 0;
gx_color_value step;
unsigned int level;
-@@ -284,8 +290,10 @@
+@@ -284,8 +293,12 @@
******************************************************************************/
gx_color_index eprn_map_rgb_color_for_CMY_or_K_flex(gx_device *device,
- gx_color_value red, gx_color_value green, gx_color_value blue)
+ const gx_color_value cv[])
{
-+ gx_color_value red, green, blue;
-+ red = cv[0]; green = cv[1]; blue = cv[2];
++ gx_color_value red = cv[0];
++ gx_color_value green = cv[1];
++ gx_color_value blue = cv[2];
++ gx_color_value tmpcv[4];
const eprn_Device *dev = (eprn_Device *)device;
#ifdef EPRN_TRACE
-@@ -298,11 +306,18 @@
+@@ -298,11 +311,17 @@
/* Treat pure grey levels differently if we have black. This implies that for
CMY+K only "true" grey shades will be printed with black ink, all others
will be mixed from CMY. */
- if (dev->eprn.colour_model != eprn_DeviceCMY && red == green && green == blue)
- return eprn_map_cmyk_color_flex(device, 0, 0, 0, gx_max_color_value - red);
-+ gx_color_value tmpcv[4];
+ if (dev->eprn.colour_model != eprn_DeviceCMY && red == green && green == blue) {
+ tmpcv[0] = 0; tmpcv[1] = 0; tmpcv[2] = 0;
+ tmpcv[3] = gx_max_color_value - red;
@@ -71,38 +75,40 @@
}
/******************************************************************************
-@@ -315,8 +330,10 @@
+@@ -315,8 +334,11 @@
******************************************************************************/
gx_color_index eprn_map_rgb_color_for_RGB_max(gx_device *device,
- gx_color_value red, gx_color_value green, gx_color_value blue)
+ const gx_color_value cv[])
{
-+ gx_color_value red, green, blue;
-+ red = cv[0]; green = cv[1]; blue = cv[2];
++ gx_color_value red = cv[0];
++ gx_color_value green = cv[1];
++ gx_color_value blue = cv[2];
gx_color_index value;
#ifdef EPRN_TRACE
-@@ -345,8 +362,10 @@
+@@ -345,8 +367,12 @@
******************************************************************************/
gx_color_index eprn_map_rgb_color_for_CMY_or_K_max(gx_device *device,
- gx_color_value red, gx_color_value green, gx_color_value blue)
+ const gx_color_value cv[])
{
-+ gx_color_value red, green, blue;
-+ red = cv[0]; green = cv[1]; blue = cv[2];
++ gx_color_value red = cv[0];
++ gx_color_value green = cv[1];
++ gx_color_value blue = cv[2];
++ gx_color_value tmpcv[4];
const eprn_Device *dev = (eprn_Device *)device;
#ifdef EPRN_TRACE
-@@ -356,13 +375,19 @@
+@@ -356,13 +382,18 @@
red, green, blue);
#endif
- if (dev->eprn.colour_model == eprn_DeviceGray)
- return eprn_map_cmyk_color_max(device, 0, 0, 0, gx_max_color_value - red);
-
-+ gx_color_value tmpcv[4];
+ if (dev->eprn.colour_model == eprn_DeviceGray) {
+ tmpcv[0] = 0; tmpcv[1] = 0; tmpcv[2] = 0;
+ tmpcv[3] = gx_max_color_value - red;
@@ -120,7 +126,7 @@
}
/******************************************************************************
-@@ -389,7 +414,7 @@
+@@ -389,7 +420,7 @@
******************************************************************************/
int eprn_map_color_rgb(gx_device *device, gx_color_index color,
@@ -129,7 +135,7 @@
{
#ifdef EPRN_TRACE
if_debug1(EPRN_TRACE_CHAR,
-@@ -415,9 +440,10 @@
+@@ -415,9 +446,12 @@
******************************************************************************/
gx_color_index eprn_map_cmyk_color(gx_device *device,
@@ -137,12 +143,14 @@
- gx_color_value black)
+ const gx_color_value cv[])
{
-+ gx_color_value cyan, magenta, yellow, black;
-+ cyan = cv[0]; magenta = cv[1]; yellow = cv[2]; black = cv[3];
++ gx_color_value cyan = cv[0];
++ gx_color_value magenta = cv[1];
++ gx_color_value yellow = cv[2];
++ gx_color_value black = cv[3];
gx_color_index value = 0;
static const gx_color_value threshold = gx_max_color_value/2;
-@@ -449,9 +475,10 @@
+@@ -449,9 +483,12 @@
******************************************************************************/
gx_color_index eprn_map_cmyk_color_flex(gx_device *device,
@@ -150,12 +158,14 @@
- gx_color_value black)
+ const gx_color_value cv[])
{
-+ gx_color_value cyan, magenta, yellow, black;
-+ cyan = cv[0]; magenta = cv[1]; yellow = cv[2]; black = cv[3];
++ gx_color_value cyan = cv[0];
++ gx_color_value magenta = cv[1];
++ gx_color_value yellow = cv[2];
++ gx_color_value black = cv[3];
gx_color_index value = 0;
gx_color_value step;
unsigned int level;
-@@ -530,9 +557,10 @@
+@@ -530,9 +567,12 @@
******************************************************************************/
gx_color_index eprn_map_cmyk_color_max(gx_device *device,
@@ -163,8 +173,10 @@
- gx_color_value black)
+ const gx_color_value cv[])
{
-+ gx_color_value cyan, magenta, yellow, black;
-+ cyan = cv[0]; magenta = cv[1]; yellow = cv[2]; black = cv[3];
++ gx_color_value cyan = cv[0];
++ gx_color_value magenta = cv[1];
++ gx_color_value yellow = cv[2];
++ gx_color_value black = cv[3];
gx_color_index value;
#ifdef EPRN_TRACE
diff --git a/print/ghostscript-gpl/files/patch-src-dmp_site.ps b/print/ghostscript-gpl/files/patch-src-dmp_site.ps
new file mode 100644
index 000000000000..ee1a5717d641
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src-dmp_site.ps
@@ -0,0 +1,10 @@
+--- src/dmp_site.ps.orig Tue May 27 09:57:00 1997
++++ src/dmp_site.ps Tue Apr 2 23:05:45 2002
+@@ -1,6 +1,6 @@
+ BeginConfig
+ %%%%%%%%%%%%%%%%%%%%%% Standard user cusomizations %%%%%%%%%%%%%%%%%%%%%
+-/printer (epsimage.src)
++/printer (%%DATADIR%%/%%GS_VERSION%%/lib/escp_24.src)
+ % horizontal / vertical
+ % /resolution [ 160.0 180.0 ]
+ % horizontal / vertical
diff --git a/print/ghostscript-gpl/files/patch-src-dviprlib.c b/print/ghostscript-gpl/files/patch-src-dviprlib.c
new file mode 100644
index 000000000000..5bee5e72645d
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src-dviprlib.c
@@ -0,0 +1,135 @@
+--- src/dviprlib.c.orig Tue May 13 16:14:09 1997
++++ src/dviprlib.c Tue May 24 21:41:09 2005
+@@ -39,8 +39,8 @@
+
+
+ /*--- forward declarations ---*/
+-private int dviprt_read_S_cfg(P2(dviprt_cfg_t *,dviprt_cfg_i *));
+-private int dviprt_read_QR_cfg(P2(dviprt_cfg_t *,dviprt_cfg_i *));
++private int dviprt_read_S_cfg(dviprt_cfg_t *,dviprt_cfg_i *);
++private int dviprt_read_QR_cfg(dviprt_cfg_t *,dviprt_cfg_i *);
+
+ /*--- library functions ---*/
+ int
+@@ -429,21 +429,21 @@
+
+ /*--- forward declarations ---*/
+ private int dviprt_set_select
+- (P4(dviprt_cfg_item_t *,uchar **,dviprt_cfg_t *,dviprt_cfg_i *));
++ (dviprt_cfg_item_t *,uchar **,dviprt_cfg_t *,dviprt_cfg_i *);
+ private int dviprt_set_integer
+- (P4(dviprt_cfg_item_t *, uchar *, dviprt_cfg_t *,dviprt_cfg_i *));
++ (dviprt_cfg_item_t *, uchar *, dviprt_cfg_t *,dviprt_cfg_i *);
+ private int dviprt_set_strings
+- (P4(dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *));
++ (dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *);
+ private int dviprt_set_rpexpr
+- (P6(dviprt_cfg_item_t *,uchar *,int , dviprt_cfg_t *,dviprt_cfg_i *,int));
++ (dviprt_cfg_item_t *,uchar *,int , dviprt_cfg_t *,dviprt_cfg_i *,int);
+ private int dviprt_set_code
+- (P4(dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *));
++ (dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *);
+
+-private long dviprt_oct2long(P3(uchar *,uchar *,uchar **));
+-private long dviprt_dec2long(P3(uchar *,uchar *,uchar **));
+-private long dviprt_hex2long(P3(uchar *,uchar *,uchar **));
++private long dviprt_oct2long(uchar *,uchar *,uchar **);
++private long dviprt_dec2long(uchar *,uchar *,uchar **);
++private long dviprt_hex2long(uchar *,uchar *,uchar **);
+
+-private int dviprt_printtokenerror(P4(dviprt_cfg_i *,char *,int ,int));
++private int dviprt_printtokenerror(dviprt_cfg_i *,char *,int ,int);
+
+ /*--- macros ---*/
+ #define strlcmp(tmplt,str,len) \
+@@ -1433,7 +1433,11 @@
+ char *dviprt_prtcodename[] = { CFG_PRTCODE_NAME, NULL };
+ char *dviprt_encodename[] = { CFG_ENCODE_NAME, NULL };
+
++#if 0
+ private FILE *dviprt_messagestream = stderr;
++#else /* patch for glibc 2.1.x by Shin Fukui <shita@april.co.jp> */
++private FILE *dviprt_messagestream;
++#endif
+
+ /*--- library functions ---*/
+ int
+@@ -1568,16 +1572,16 @@
+
+
+ /*--- forward declarations ---*/
+-private int dviprt_getmaximalwidth(P1(dviprt_print *));
+-private int dviprt_flush_buffer(P2(dviprt_print *,uchar far *));
+-private int dviprt_output_transpose(P3(dviprt_print *,uchar far *,uint ));
+-private int dviprt_output_nontranspose(P3(dviprt_print *,uchar far *,uint ));
+-private int dviprt_output_nontranspose_reverse(P3(dviprt_print *,uchar far *,uint ));
+-private int dviprt_reverse_bits(P2(uchar far *,uint));
+-private int dviprt_transpose8x8(P4(uchar far *,uint, uchar far *,uint));
+-private int dviprt_output_expr(P4(dviprt_print *,int,uint,uint));
+-private int dviprt_default_outputproc(P3(uchar far *,long ,void *));
+-private long dviprt_getbuffersize(P1(dviprt_print *));
++private int dviprt_getmaximalwidth(dviprt_print *);
++private int dviprt_flush_buffer(dviprt_print *,uchar far *);
++private int dviprt_output_transpose(dviprt_print *,uchar far *,uint);
++private int dviprt_output_nontranspose(dviprt_print *,uchar far *,uint);
++private int dviprt_output_nontranspose_reverse(dviprt_print *,uchar far *,uint);
++private int dviprt_reverse_bits(uchar far *,uint);
++private int dviprt_transpose8x8(uchar far *,uint, uchar far *,uint);
++private int dviprt_output_expr(dviprt_print *,int,uint,uint);
++private int dviprt_default_outputproc(uchar far *,long ,void *);
++private long dviprt_getbuffersize(dviprt_print *);
+
+ /*--- library functions ---*/
+ long
+@@ -1618,7 +1622,7 @@
+ int
+ dviprt_setstream
+ #ifdef __PROTOTYPES__
+- (dviprt_print *pprint,int (*func)(P3(uchar far *,long ,void*)),void *pstream)
++ (dviprt_print *pprint,int (*func)(uchar far *,long ,void*),void *pstream)
+ #else
+ (pprint,func,pstream)
+ dviprt_print *pprint;
+@@ -2264,19 +2268,19 @@
+ #define DVIPRT_SUPPORT_PCL 1
+
+ /*--- forward declarations ---*/
+-private long dviprt_null_getworksize(P2(dviprt_print *,long ));
+-private long dviprt_null_encode(P3(dviprt_print *,long ,int ));
+-private long dviprt_hex_getworksize(P2(dviprt_print *,long ));
+-private long dviprt_hex_encode(P3(dviprt_print *,long ,int ));
++private long dviprt_null_getworksize(dviprt_print *,long );
++private long dviprt_null_encode(dviprt_print *,long ,int );
++private long dviprt_hex_getworksize(dviprt_print *,long );
++private long dviprt_hex_encode(dviprt_print *,long ,int );
+ #if DVIPRT_SUPPORT_FAX
+-private long dviprt_fax_getworksize(P2(dviprt_print *,long ));
+-private long dviprt_fax_encode(P3(dviprt_print *,long ,int ));
++private long dviprt_fax_getworksize(dviprt_print *,long );
++private long dviprt_fax_encode(dviprt_print *,long ,int );
+ #endif
+ #if DVIPRT_SUPPORT_PCL
+-private long dviprt_pcl1_getworksize(P2(dviprt_print *,long ));
+-private long dviprt_pcl1_encode(P3(dviprt_print *,long ,int ));
+-private long dviprt_pcl2_getworksize(P2(dviprt_print *,long ));
+-private long dviprt_pcl2_encode(P3(dviprt_print *,long ,int ));
++private long dviprt_pcl1_getworksize(dviprt_print *,long );
++private long dviprt_pcl1_encode(dviprt_print *,long ,int );
++private long dviprt_pcl2_getworksize(dviprt_print *,long );
++private long dviprt_pcl2_encode(dviprt_print *,long ,int );
+ #endif
+
+ private dviprt_encoder dviprt_encoder_list[] = {
+@@ -2468,9 +2472,9 @@
+ int o_count;
+ int o_bufcount;
+ } FaxEncodeInfo;
+-private int dviprt_fax_set_white(P2(int,FaxEncodeInfo *));
+-private int dviprt_fax_set_black(P2(int,FaxEncodeInfo *));
+-private int dviprt_fax_set_bitcount(P2(FaxEncode_t *,FaxEncodeInfo *));
++private int dviprt_fax_set_white(int,FaxEncodeInfo *);
++private int dviprt_fax_set_black(int,FaxEncodeInfo *);
++private int dviprt_fax_set_bitcount(FaxEncode_t *,FaxEncodeInfo *);
+
+ private long
+ dviprt_fax_encode(dviprt_print *pprint,long s,int f)
diff --git a/print/ghostscript-gpl/files/patch-src-dviprlib.h b/print/ghostscript-gpl/files/patch-src-dviprlib.h
new file mode 100644
index 000000000000..d7fce3138d0a
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src-dviprlib.h
@@ -0,0 +1,38 @@
+--- src/dviprlib.h.orig Tue May 13 16:10:34 1997
++++ src/dviprlib.h Tue May 24 21:41:14 2005
+@@ -337,23 +337,23 @@
+ #ifdef dviprlib_implementation
+ typedef struct {
+ int no;
+- long (*getworksize)(P2(dviprt_print *,long ));
+- long (*encode)(P3(dviprt_print *,long,int));
++ long (*getworksize)(dviprt_print *,long);
++ long (*encode)(dviprt_print *,long,int);
+ } dviprt_encoder;
+
+ #define liblocal private
+
+-liblocal dviprt_encoder *dviprt_getencoder_(P1(int ));
+-liblocal int dviprt_setcfgbuffer_(P3(dviprt_cfg_i *,int ,int ));
+-liblocal int dviprt_resetcfgbuffer_(P1(dviprt_cfg_i *));
+-liblocal int dviprt_initcfg_(P2(dviprt_cfg_t *,dviprt_cfg_i *));
+-liblocal int dviprt_printmessage(P2(char *,int ));
+-liblocal int dviprt_printerror(P2(char *,int ));
+-liblocal int dviprt_printwarning(P2(char *,int ));
+-liblocal int dviprt_printcfgerror(P3(dviprt_cfg_i *,char *,int ));
+-liblocal int dviprt_printcfgwarning(P3(dviprt_cfg_i *,char *,int ));
++liblocal dviprt_encoder *dviprt_getencoder_(int);
++liblocal int dviprt_setcfgbuffer_(dviprt_cfg_i *,int ,int);
++liblocal int dviprt_resetcfgbuffer_(dviprt_cfg_i *);
++liblocal int dviprt_initcfg_(dviprt_cfg_t *,dviprt_cfg_i *);
++liblocal int dviprt_printmessage(char *,int);
++liblocal int dviprt_printerror(char *,int);
++liblocal int dviprt_printwarning(char *,int);
++liblocal int dviprt_printcfgerror(dviprt_cfg_i *,char *,int);
++liblocal int dviprt_printcfgwarning(dviprt_cfg_i *,char *,int);
+
+-extern int dviprt_print_headercomment_(P4(char *,char *,char *,FILE *));
++extern int dviprt_print_headercomment_(char *,char *,char *,FILE *);
+ extern char dviprt_message_buffer[];
+ #endif dviprlib_implementation
+
diff --git a/print/ghostscript-gpl/files/patch-src-gdevdmpr.c b/print/ghostscript-gpl/files/patch-src-gdevdmpr.c
new file mode 100644
index 000000000000..2da080e7d34e
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src-gdevdmpr.c
@@ -0,0 +1,64 @@
+--- src/gdevdmpr.c.orig Tue May 13 20:43:37 1997
++++ src/gdevdmpr.c Thu Jun 9 02:52:25 2005
+@@ -41,7 +41,7 @@
+ /* include library header. */
+ #include "dviprlib.h"
+
+-extern FILE *lib_fopen(P1(const char *));
++extern FILE *lib_fopen(const char *);
+
+ #define LOCAL_DEBUG 0
+
+@@ -87,12 +87,12 @@
+ private dev_proc_close_device(gdev_dmprt_close);
+
+ /* declarations of sub functions to get printer properties. */
+-private void gdev_dmprt_init_printer_props(P1(gx_device_dmprt *));
+-private int gdev_dmprt_get_printer_props(P2(gx_device_dmprt *,char *));
+-private int gdev_dmprt_check_code_props(P2(byte * ,int ));
+-private FILE *gdev_dmprt_dviprt_lib_fopen(P2(const char *,char *));
++private void gdev_dmprt_init_printer_props(gx_device_dmprt *);
++private int gdev_dmprt_get_printer_props(gx_device_dmprt *,char *);
++private int gdev_dmprt_check_code_props(byte * ,int );
++private FILE *gdev_dmprt_dviprt_lib_fopen(const char *,char *);
+
+-private int gdev_dmprt_error_no_dviprt_to_gs(P1(int ));
++private int gdev_dmprt_error_no_dviprt_to_gs(int );
+
+ /* The device descriptor */
+ gx_device_procs prn_dmprt_procs = {
+@@ -833,6 +833,7 @@
+ return code;
+ }
+
++private const char * gp_file_name_concat_string(const char *, unsigned);
+ private FILE *
+ gdev_dmprt_dviprt_lib_fopen(const char *fnamebase,char *fname)
+ {
+@@ -845,9 +846,7 @@
+ env = getenv("TEXCFG");
+ if (env) {
+ strcpy(fname,env);
+- strcat(fname,
+- gp_file_name_concat_string(env,strlen(env),fname,strlen(fnamebase)));
+- strcat(fname,fnamebase);
++ strcat(fname, gp_file_name_concat_string(env,strlen(env)));
+ fp = fopen(fname,gp_fmode_rb);
+ }
+ }
+@@ -867,4 +866,15 @@
+ default:
+ return -1;
+ }
++}
++
++/* Answer the string to be used for combining a directory/device prefix */
++/* with a base file name. The prefix directory/device is examined to */
++/* determine if a separator is needed and may return an empty string */
++private const char *
++gp_file_name_concat_string(const char *prefix, unsigned plen)
++{
++ if (plen > 0 && prefix[plen - 1] == '/')
++ return "";
++ return "/";
+ }
diff --git a/print/ghostscript-gpl/files/patch-src-gdevdmpr.mak b/print/ghostscript-gpl/files/patch-src-gdevdmpr.mak
new file mode 100644
index 000000000000..9136172873fa
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src-gdevdmpr.mak
@@ -0,0 +1,21 @@
+--- src/gdevdmpr.mak.orig Mon May 1 20:24:43 2000
++++ src/gdevdmpr.mak Mon May 1 20:26:23 2000
+@@ -1,8 +1,12 @@
+ ### ---------------- Dot matrix printer device ---------------- ###
+-dmprt_=gdevdmpr.$(OBJ) dviprlib.$(OBJ) gdevprn.$(OBJ)
++dmprt_=$(GLOBJ)gdevdmpr.$(OBJ) $(GLOBJ)dviprlib.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+-dmprt.dev: $(dmprt_)
+- $(SETDEV) dmprt $(dmprt_)
+- $(ADDMOD) dmprt -ps dmp_init
+-gdevdmpr.$(OBJ): gdevdmpr.c dviprlib.h $(PDEVH)
+-dviprlib.$(OBJ): dviprlib.c dviprlib.h
++$(DD)dmprt.dev: $(dmprt_)
++ $(SETDEV) $(DD)dmprt $(dmprt_)
++ $(ADDMOD) $(DD)dmprt -ps dmp_init
++
++$(GLOBJ)gdevdmpr.$(OBJ): $(GLSRC)gdevdmpr.c $(GLSRC)dviprlib.h $(PDEVH)
++ $(GLCC) $(GLO_)gdevdmpr.$(OBJ) $(C_) $(GLSRC)gdevdmpr.c
++
++$(GLOBJ)dviprlib.$(OBJ): $(GLSRC)dviprlib.c $(GLSRC)dviprlib.h
++ $(GLCC) $(GLO_)dviprlib.$(OBJ) $(C_) $(GLSRC)dviprlib.c
diff --git a/print/ghostscript-gpl/files/patch-src-gdevijs.c b/print/ghostscript-gpl/files/patch-src-gdevijs.c
new file mode 100644
index 000000000000..b9e8a47b5aff
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src-gdevijs.c
@@ -0,0 +1,659 @@
+--- src/gdevijs.c.orig Wed Mar 24 17:38:53 2004
++++ src/gdevijs.c Thu May 26 01:23:29 2005
+@@ -27,15 +27,29 @@
+ * which is a security risk, since any program can be run.
+ * You should use -dSAFER which sets .LockSafetyParams to true
+ * before opening this device.
++ *
++ * 11/26/03 David Suffield
++ * (c) 2003-2004 Copyright Hewlett-Packard Development Company, LP
++ *
++ * 1. Removed hpijs 1.0-1.0.2 workarounds, use hpijs 1.0.3 or higher.
++ * 2. Added krgb support.
++ *
++ * 02/21/05 David Suffield
++ * 1. Fixed segfault issue with 1-bit color space.
++ * 2. Fixed z-order issue with colored text on black rectangle.
++ *
+ */
+
+ #include "unistd_.h" /* for dup() */
+ #include <stdlib.h>
++#include <fcntl.h>
+ #include "gdevprn.h"
+ #include "gp.h"
+ #include "ijs.h"
+ #include "ijs_client.h"
+
++/*#define KRGB_DEBUG*/
++
+ /* This should go into gdevprn.h, or, better yet, gdevprn should
+ acquire an API for changing resolution. */
+ int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev,
+@@ -51,6 +65,14 @@
+ private dev_proc_get_params(gsijs_get_params);
+ private dev_proc_put_params(gsijs_put_params);
+
++/* Following definitions are for krgb support. */
++private dev_proc_create_buf_device(gsijs_create_buf_device);
++private dev_proc_fill_rectangle(gsijs_fill_rectangle);
++private dev_proc_copy_mono(gsijs_copy_mono);
++private dev_proc_fill_mask(gsijs_fill_mask);
++private dev_proc_fill_path(gsijs_fill_path);
++private dev_proc_stroke_path(gsijs_stroke_path);
++
+ private const gx_device_procs gsijs_procs =
+ prn_color_params_procs(gsijs_open, gsijs_output_page, gsijs_close,
+ gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
+@@ -83,6 +105,14 @@
+
+ IjsClientCtx *ctx;
+ int ijs_version;
++
++ /* Additional parameters for krgb support. */
++ int krgb_mode; /* 0=false, 1=true */
++ int k_path; /* k plane path, 0=false, 1=true */
++ int k_width; /* k plane width in pixels */
++ int k_band_size; /* k plane buffer size in bytes, byte aligned */
++ unsigned char *k_band; /* k plane buffer */
++ gx_device_procs prn_procs; /* banding playback procedures */
+ };
+
+ #define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */
+@@ -110,7 +140,12 @@
+ FALSE, /* Tumble_set */
+
+ NULL, /* IjsClient *ctx */
+- 0 /* ijs_version */
++ 0, /* ijs_version */
++ 0, /* krgb_mode */
++ 0, /* k_path */
++ 0, /* k_width */
++ 0, /* k_band_size */
++ NULL /* k_band buffer */
+ };
+
+
+@@ -126,12 +161,254 @@
+
+ /**************************************************************************/
+
+-/* ------ Private definitions ------ */
++/* ---------------- Low-level graphic procedures ---------------- */
++
++static unsigned char xmask[] =
++{
++ 0x80, /* x=0 */
++ 0x40, /* 1 */
++ 0x20, /* 2 */
++ 0x10, /* 3 */
++ 0x08, /* 4 */
++ 0x04, /* 5 */
++ 0x02, /* 6 */
++ 0x01 /* 7 */
++};
++
++private int gsijs_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
++ gx_color_index color)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++
++ if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0)
++ {
++ int raster = (ijsdev->k_width+7) >> 3;
++ register unsigned char *dest=ijsdev->k_band+(raster*y)+(x >> 3);
++ int dest_start_bit = x & 7;
++ int i,j,w1;
++
++ if (h <= 0 || w <= 0)
++ return 0;
++
++ if ((x+w) > ijsdev->k_width)
++ w1 = ijsdev->k_width - x;
++ else
++ w1 = w;
++
++ /* Note x,y orgin 0,0 is stored first byte 0 left to right. */
++
++ if (color==0x0)
++ {
++ /* Color is black, store in k plane band instead of regular band. */
++ for (j=0; j<h; j++)
++ {
++ for (i=0; i<w1; i++)
++ dest[(dest_start_bit+i)>>3] |= xmask[(dest_start_bit+i)&7];
++ dest+=raster;
++ }
++ return 0;
++ }
++ else
++ {
++ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
++ for (j=0; j<h; j++)
++ {
++ for (i=0; i<w1; i++)
++ dest[(dest_start_bit+i)>>3] &= ~xmask[(dest_start_bit+i)&7];
++ dest+=raster;
++ }
++ }
++ }
++
++ return (*ijsdev->prn_procs.fill_rectangle)(dev, x, y, w, h, color);
++}
++
++private int gsijs_copy_mono(gx_device * dev, const byte * data,
++ int dx, int draster, gx_bitmap_id id,
++ int x, int y, int w, int height, gx_color_index zero, gx_color_index one)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++
++ /* if (ijsdev->krgb_mode && ijsdev->k_path && one==0x0) */
++ if (ijsdev->krgb_mode && ijsdev->k_path)
++ {
++ /* Store in k plane band instead of regular band. */
++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
++ register unsigned char *dest=ijsdev->k_band+(raster*y)+(x >> 3);
++ register const unsigned char *scan=data+(dx >> 3);
++ int dest_start_bit = x & 7;
++ int scan_start_bit = dx & 7;
++ int i, h=height;
++
++ if (h <= 0 || w <= 0)
++ return 0;
++
++ if (one==0x0)
++ {
++ /* Color is black, store in k plane band instead of regular band. */
++ while (h-- > 0)
++ {
++ for (i=0; i<w; i++)
++ {
++ if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
++ dest[(dest_start_bit+i)>>3] |= xmask[(dest_start_bit+i)&7];
++ }
++ scan+=draster;
++ dest+=raster;
++ }
++ return 0;
++ }
++ else
++ {
++ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
++ while (h-- > 0)
++ {
++ for (i=0; i<w; i++)
++ {
++ if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
++ dest[(dest_start_bit+i)>>3] &= ~xmask[(dest_start_bit+i)&7];
++ }
++ scan+=draster;
++ dest+=raster;
++ }
++ }
++ }
++
++ return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one);
++}
++
++/* ---------------- High-level graphic procedures ---------------- */
++
++private int gsijs_fill_mask(gx_device * dev,
++ const byte * data, int dx, int raster, gx_bitmap_id id,
++ int x, int y, int w, int h,
++ const gx_drawing_color * pdcolor, int depth,
++ gs_logical_operation_t lop, const gx_clip_path * pcpath)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++ int code;
++
++ ijsdev->k_path = 1;
++
++ code = (*ijsdev->prn_procs.fill_mask)(dev, data, dx, raster, id, x, y, w, h, pdcolor, depth, lop, pcpath);
++
++ ijsdev->k_path = 0;
++
++ return code;
++}
++
++private int gsijs_fill_path(gx_device * dev, const gs_imager_state * pis,
++ gx_path * ppath, const gx_fill_params * params,
++ const gx_drawing_color * pdcolor,
++ const gx_clip_path * pcpath)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++ int code;
++
++ ijsdev->k_path = 1;
++
++ code = (*ijsdev->prn_procs.fill_path)(dev, pis, ppath, params, pdcolor, pcpath);
++
++ ijsdev->k_path = 0;
++
++ return 0;
++}
++
++private int gsijs_stroke_path(gx_device * dev, const gs_imager_state * pis,
++ gx_path * ppath, const gx_stroke_params * params,
++ const gx_drawing_color * pdcolor,
++ const gx_clip_path * pcpath)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++ int code;
++
++ ijsdev->k_path = 1;
+
+-/* Versions 1.0 through 1.0.2 of hpijs report IJS version 0.29, and
+- require some workarounds. When more up-to-date hpijs versions
+- become ubiquitous, all these workarounds should be removed. */
+-#define HPIJS_1_0_VERSION 29
++ code = (*ijsdev->prn_procs.stroke_path)(dev, pis, ppath, params, pdcolor, pcpath);
++
++ ijsdev->k_path = 0;
++
++ return code;
++}
++
++/* ---------------- krgb banding playback procedures ---------------- */
++
++private int gsijs_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
++ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
++ int band_height = cdev->page_info.band_params.BandHeight;
++ int band_number = y/band_height;
++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
++ int y1=raster*(y-(band_height*band_number));
++
++ if (y1 == 0)
++ {
++ /* First raster for band, clear k_band. Banding playback occurs on first raster. */
++ memset(ijsdev->k_band, 0, ijsdev->k_band_size);
++ }
++
++ return gdev_prn_get_bits(pdev, y, str, actual_data); /* get raster from regular band */
++}
++
++private int gsijs_k_get_bits(gx_device_printer * pdev, int y, byte ** actual_data)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
++ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
++ int band_height = cdev->page_info.band_params.BandHeight;
++ int band_number = y/band_height;
++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
++ int y1=raster*(y-(band_height*band_number));
++
++ *actual_data = ijsdev->k_band+y1;
++
++ return 0;
++}
++
++private int gsijs_create_buf_device(gx_device **pbdev, gx_device *target,
++ const gx_render_plane_t *render_plane, gs_memory_t *mem, bool for_band)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)target;
++ int n_chan = ijsdev->color_info.num_components;
++ int code = gx_default_create_buf_device(pbdev, target, render_plane, mem, for_band);
++ if (code < 0 || n_chan != 3)
++ return code;
++
++ /* Save buffer (vector) procedures so that we can hook them during banding playback. */
++ ijsdev->prn_procs = (*pbdev)->procs;
++
++ /* Replace buffer procedures with krgb procedures. */
++ set_dev_proc(*pbdev, fill_rectangle, gsijs_fill_rectangle);
++ set_dev_proc(*pbdev, copy_mono, gsijs_copy_mono);
++ set_dev_proc(*pbdev, fill_mask, gsijs_fill_mask);
++ set_dev_proc(*pbdev, fill_path, gsijs_fill_path);
++ set_dev_proc(*pbdev, stroke_path, gsijs_stroke_path);
++
++ return code;
++}
++
++/* See if IJS server supports krgb. Return value: 0=false, 1=true. */
++private int
++gsijs_set_krgb_mode(gx_device_ijs *ijsdev)
++{
++ char buf[256];
++ int n_chan = ijsdev->color_info.num_components;
++ int code;
++
++ if (n_chan != 3)
++ return 0; /* no krgb support, not RGB colorspace */
++
++ buf[0] = 0;
++ code = ijs_client_enum_param(ijsdev->ctx, 0, "ColorSpace", buf, sizeof(buf)-1);
++ if (code >= 0)
++ buf[code] = 0;
++ if (strstr(buf, "KRGB") == NULL)
++ return 0; /* no krgb support */
++
++ return 1; /* krgb is supported */
++}
++
++/* ------ Private definitions ------ */
+
+ private int
+ gsijs_parse_wxh (const char *val, int size, double *pw, double *ph)
+@@ -169,34 +446,6 @@
+ }
+
+ /**
+- * gsijs_set_generic_params_hpijs: Set generic IJS parameters.
+- *
+- * This version is specialized for hpijs 1.0 through 1.0.2, and
+- * accommodates a number of quirks.
+- **/
+-private int
+-gsijs_set_generic_params_hpijs(gx_device_ijs *ijsdev)
+-{
+- char buf[256];
+- int code = 0;
+-
+- /* IjsParams, Duplex, and Tumble get set at this point because
+- they may affect margins. */
+- if (ijsdev->IjsParams) {
+- code = gsijs_client_set_param(ijsdev, "IjsParams", ijsdev->IjsParams);
+- }
+-
+- if (code == 0 && ijsdev->Duplex_set) {
+- int duplex_val;
+-
+- duplex_val = ijsdev->Duplex ? (ijsdev->IjsTumble ? 1 : 2) : 0;
+- sprintf (buf, "%d", duplex_val);
+- code = gsijs_client_set_param(ijsdev, "Duplex", buf);
+- }
+- return code;
+-}
+-
+-/**
+ * gsijs_set_generic_params: Set generic IJS parameters.
+ **/
+ private int
+@@ -207,9 +456,6 @@
+ int i, j;
+ char *value;
+
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
+- return gsijs_set_generic_params_hpijs(ijsdev);
+-
+ /* Split IjsParams into separate parameters and send to ijs server */
+ value = NULL;
+ for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
+@@ -250,68 +496,6 @@
+ }
+
+ /**
+- * gsijs_set_margin_params_hpijs: Do margin negotiation with IJS server.
+- *
+- * This version is specialized for hpijs 1.0 through 1.0.2, and
+- * accommodates a number of quirks.
+- **/
+-private int
+-gsijs_set_margin_params_hpijs(gx_device_ijs *ijsdev)
+-{
+- char buf[256];
+- int code = 0;
+-
+- if (code == 0) {
+- sprintf(buf, "%d", ijsdev->width);
+- code = gsijs_client_set_param(ijsdev, "Width", buf);
+- }
+- if (code == 0) {
+- sprintf(buf, "%d", ijsdev->height);
+- code = gsijs_client_set_param(ijsdev, "Height", buf);
+- }
+-
+- if (code == 0) {
+- double printable_width, printable_height;
+- double printable_left, printable_top;
+- float m[4];
+-
+- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableArea",
+- buf, sizeof(buf));
+- if (code == IJS_EUNKPARAM)
+- /* IJS server doesn't support margin negotiations.
+- That's ok. */
+- return 0;
+- else if (code >= 0) {
+- code = gsijs_parse_wxh(buf, code,
+- &printable_width, &printable_height);
+- }
+-
+- if (code == 0) {
+- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableTopLeft",
+- buf, sizeof(buf));
+- if (code == IJS_EUNKPARAM)
+- return 0;
+- else if (code >= 0) {
+- code = gsijs_parse_wxh(buf, code,
+- &printable_left, &printable_top);
+- }
+- }
+-
+- if (code == 0) {
+- m[0] = printable_left;
+- m[1] = ijsdev->MediaSize[1] * (1.0 / 72) -
+- printable_top - printable_height;
+- m[2] = ijsdev->MediaSize[0] * (1.0 / 72) -
+- printable_left - printable_width;
+- m[3] = printable_top;
+- gx_device_set_margins((gx_device *)ijsdev, m, true);
+- }
+- }
+-
+- return code;
+-}
+-
+-/**
+ * gsijs_set_margin_params: Do margin negotiation with IJS server.
+ **/
+ private int
+@@ -322,9 +506,6 @@
+ int i, j;
+ char *value;
+
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
+- return gsijs_set_margin_params_hpijs(ijsdev);
+-
+ /* Split IjsParams into separate parameters and send to ijs server */
+ value = NULL;
+ for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
+@@ -491,12 +672,18 @@
+ char buf[256];
+ bool use_outputfd;
+ int fd = -1;
++ long max_bitmap = ijsdev->space_params.MaxBitmap;
+
+ if (strlen(ijsdev->IjsServer) == 0) {
+ eprintf("ijs server not specified\n");
+ return gs_note_error(gs_error_ioerror);
+ }
+
++ ijsdev->space_params.MaxBitmap = 0; /* force banding */
++
++ /* Set create_buf_device in printer device, so that we can hook the banding playback procedures. */
++ ijsdev->printer_procs.buf_procs.create_buf_device = gsijs_create_buf_device;
++
+ /* Decide whether to use OutputFile or OutputFD. Note: how to
+ determine this is a tricky question, so we just allow the
+ user to set it.
+@@ -511,6 +698,8 @@
+ if (code < 0)
+ return code;
+
++ ijsdev->space_params.MaxBitmap = max_bitmap;
++
+ if (use_outputfd) {
+ /* Note: dup() may not be portable to all interesting IJS
+ platforms. In that case, this branch should be #ifdef'ed out.
+@@ -570,6 +759,9 @@
+ if (code >= 0)
+ code = gsijs_set_margin_params(ijsdev);
+
++ if (code >= 0)
++ ijsdev->krgb_mode = gsijs_set_krgb_mode(ijsdev);
++
+ return code;
+ }
+
+@@ -629,21 +821,6 @@
+ return min(width, end);
+ }
+
+-private int ijs_all_white(unsigned char *data, int size)
+-{
+- int clean = 1;
+- int i;
+- for (i = 0; i < size; i++)
+- {
+- if (data[i] != 0xFF)
+- {
+- clean = 0;
+- break;
+- }
+- }
+- return clean;
+-}
+-
+ /* Print a page. Don't use normal printer gdev_prn_output_page
+ * because it opens the output file.
+ */
+@@ -654,8 +831,9 @@
+ gx_device_printer *pdev = (gx_device_printer *)dev;
+ int raster = gdev_prn_raster(pdev);
+ int ijs_width, ijs_height;
+- int row_bytes;
++ int row_bytes, k_row_bytes=0;
+ int n_chan = pdev->color_info.num_components;
++ int krgb_mode = ijsdev->krgb_mode;
+ unsigned char *data;
+ char buf[256];
+ double xres = pdev->HWResolution[0];
+@@ -671,13 +849,23 @@
+
+ /* Determine bitmap width and height */
+ ijs_height = gdev_prn_print_scan_lines(dev);
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) {
+- ijs_width = pdev->width;
+- } else {
+ ijs_width = gsijs_raster_width(dev);
+- }
++
+ row_bytes = (ijs_width * pdev->color_info.depth + 7) >> 3;
+
++ if (krgb_mode)
++ {
++ gx_device_clist_common *cdev = (gx_device_clist_common *)dev;
++ int band_height = cdev->page_info.band_params.BandHeight;
++ k_row_bytes = (ijs_width + 7) >> 3;
++
++ /* Create banding buffer for k plane. */
++ ijsdev->k_width = ijs_width;
++ ijsdev->k_band_size = band_height * k_row_bytes;
++ if ((ijsdev->k_band = gs_malloc(ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL)
++ return gs_note_error(gs_error_VMerror);
++ }
++
+ /* Required page parameters */
+ sprintf(buf, "%d", n_chan);
+ gsijs_client_set_param(ijsdev, "NumChan", buf);
+@@ -686,44 +874,71 @@
+
+ /* This needs to become more sophisticated for DeviceN. */
+ strcpy(buf, (n_chan == 4) ? "DeviceCMYK" :
+- ((n_chan == 3) ? "DeviceRGB" : "DeviceGray"));
++ ((n_chan == 3) ? (krgb_mode ? "KRGB" : "DeviceRGB") : "DeviceGray"));
+ gsijs_client_set_param(ijsdev, "ColorSpace", buf);
+
+- /* If hpijs 1.0, don't set width and height here, because it
+- expects them to be the paper size. */
+- if (ijsdev->ijs_version != HPIJS_1_0_VERSION) {
+- sprintf(buf, "%d", ijs_width);
+- gsijs_client_set_param(ijsdev, "Width", buf);
+- sprintf(buf, "%d", ijs_height);
+- gsijs_client_set_param(ijsdev, "Height", buf);
+- }
++ sprintf(buf, "%d", ijs_width);
++ gsijs_client_set_param(ijsdev, "Width", buf);
++ sprintf(buf, "%d", ijs_height);
++ gsijs_client_set_param(ijsdev, "Height", buf);
+
+ sprintf(buf, "%gx%g", xres, yres);
+ gsijs_client_set_param(ijsdev, "Dpi", buf);
+
++#ifdef KRGB_DEBUG
++ int kfd, rgbfd;
++ char sz[128];
++ kfd = open("/tmp/k.pbm", O_CREAT | O_TRUNC | O_RDWR, 0644);
++ rgbfd = open("/tmp/rgb.ppm", O_CREAT | O_TRUNC | O_RDWR, 0644);
++ snprintf(sz, sizeof(sz), "P4\n#gdevijs test\n%d\n%d\n", ijs_width, ijs_height);
++ write(kfd, sz, strlen(sz));
++ snprintf(sz, sizeof(sz), "P6\n#gdevijs test\n%d\n%d\n255\n", ijs_width, ijs_height);
++ write(rgbfd, sz, strlen(sz));
++#endif
++
+ for (i=0; i<num_copies; i++) {
+ unsigned char *actual_data;
+ ijs_client_begin_cmd (ijsdev->ctx, IJS_CMD_BEGIN_PAGE);
+ status = ijs_client_send_cmd_wait(ijsdev->ctx);
+
+ for (y = 0; y < ijs_height; y++) {
+- code = gdev_prn_get_bits(pdev, y, data, &actual_data);
+- if (code < 0)
+- break;
++ if (krgb_mode)
++ code = gsijs_get_bits(pdev, y, data, &actual_data);
++ else
++ code = gdev_prn_get_bits(pdev, y, data, &actual_data);
++ if (code < 0)
++ break;
++#ifdef KRGB_DEBUG
++ write(rgbfd, actual_data, row_bytes);
++#endif
++ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, row_bytes);
++ if (status)
++ break;
+
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION &&
+- ijs_all_white(actual_data, row_bytes))
+- status = ijs_client_send_data_wait(ijsdev->ctx, 0, NULL, 0);
+- else
+- status = ijs_client_send_data_wait(ijsdev->ctx, 0,
+- (char *)actual_data, row_bytes);
+- if (status)
+- break;
++ if (krgb_mode) {
++ code = gsijs_k_get_bits(pdev, y, &actual_data);
++ if (code < 0)
++ break;
++#ifdef KRGB_DEBUG
++ write(kfd, actual_data, k_row_bytes);
++#endif
++ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, k_row_bytes);
++ if (status)
++ break;
++ }
+ }
+ ijs_client_begin_cmd(ijsdev->ctx, IJS_CMD_END_PAGE);
+ status = ijs_client_send_cmd_wait(ijsdev->ctx);
+ }
+
++#ifdef KRGB_DEBUG
++ close(kfd);
++ close(rgbfd);
++#endif
++
++ if(krgb_mode)
++ gs_free(ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page");
++
+ gs_free_object(pdev->memory, data, "gsijs_output_page");
+
+ endcode = (pdev->buffer_space && !pdev->is_async_renderer ?
+@@ -1027,7 +1242,6 @@
+ dprintf2("ijs: Can't set parameter %s=%s\n", key, value);
+ return code;
+ }
+-
+
+ private int
+ gsijs_set_color_format(gx_device_ijs *ijsdev)
diff --git a/print/ghostscript-gpl/pkg-descr b/print/ghostscript-gpl/pkg-descr
index 6b6063046e56..7dad8244f26c 100644
--- a/print/ghostscript-gpl/pkg-descr
+++ b/print/ghostscript-gpl/pkg-descr
@@ -7,10 +7,10 @@ Public License, which allows free use, and free copying and redistribution
under certain conditions (including, in some cases, commercial distribution).
This port includes add-on packages (not part of the official gs release)
- o PCL driver for HP DeskJet printers
- - http://home.vrweb.de/~martin.lottermoser/pcl3.html
- o HP2200 driver for HP DeskJet 8xx and Business Inkjet 2200
- - http://hp.sourceforge.net/gs-hp2200.php
+ o HP8XX driver for HP DeskJet 880C/882C/895C
+ - http://www.gelhaus.net/hp880c/
+ o PCL3 driver for HP DeskJet series
+ - http://home.vrweb.de/martin.lottermoser/pcl3.html
o DJ970 driver for HP DeskJet 970CXi
- http://www.harsch.net/Ghostscript/ghostscript.html
o Special drivers for verious printer models
@@ -18,4 +18,5 @@ This port includes add-on packages (not part of the official gs release)
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/GPL/index.htm
+ http://www.ghostscript.com/
diff --git a/print/ghostscript-gpl/pkg-plist b/print/ghostscript-gpl/pkg-plist
index cf4244698355..62279dab99f8 100644
--- a/print/ghostscript-gpl/pkg-plist
+++ b/print/ghostscript-gpl/pkg-plist
@@ -35,6 +35,30 @@ bin/unix-lpr.sh
bin/wftopfa
%%SHLIB%%lib/libgs.so
%%SHLIB%%lib/libgs.so.%%SHLIB_VER%%
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/alps/README.gdevalps
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/bj10v/gdev10v.jis
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/dmprt/gdevdmpr.sj
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/ChangeLog
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/ert.txt
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/gdevepag.txt
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/gsepagif.sh
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/psprint
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/eplaser/readme-eplaser-705.euc
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/gdi/README
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lips/Gdevlips.htm
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lxm3200/README
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lxm3200/RELEASE_NOTES
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lxm3200/Z12-Z31-QuickSetup
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/md2k/README.jis
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/MJ700V2C.FAQ
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/README.mjc
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/README.mje
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/README.noz
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/cpem.doc
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/pcl3/NEWS
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/pcl3/gs-pcl3.html
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/pcl3/how-to-report.txt
+%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/pcl3/pcl3opts.html
%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/78-EUC-H
%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/78-EUC-V
%%DATADIR%%/%%GS_VERSION%%/Resource/CMap/78-H
@@ -220,8 +244,6 @@ bin/wftopfa
%%DATADIR%%/%%GS_VERSION%%/doc/Use.htm
%%DATADIR%%/%%GS_VERSION%%/doc/Xfonts.htm
%%DATADIR%%/%%GS_VERSION%%/doc/gs.css
-%%DATADIR%%/%%GS_VERSION%%/doc/gs-pcl3.html
-%%DATADIR%%/%%GS_VERSION%%/doc/pcl3opts.html
%%DATADIR%%/%%GS_VERSION%%/doc/index.html
%%DATADIR%%/%%GS_VERSION%%/examples/alphabet.ps
%%DATADIR%%/%%GS_VERSION%%/examples/chess.ps
@@ -276,10 +298,13 @@ bin/wftopfa
%%DATADIR%%/%%GS_VERSION%%/lib/cid2code.ps
%%DATADIR%%/%%GS_VERSION%%/lib/cidfmap
%%DATADIR%%/%%GS_VERSION%%/lib/decrypt.ps
+%%DATADIR%%/%%GS_VERSION%%/lib/dmp_init.ps
+%%DATADIR%%/%%GS_VERSION%%/lib/dmp_site.ps
%%DATADIR%%/%%GS_VERSION%%/lib/dnj750c.upp
%%DATADIR%%/%%GS_VERSION%%/lib/dnj750m.upp
%%DATADIR%%/%%GS_VERSION%%/lib/docie.ps
%%DATADIR%%/%%GS_VERSION%%/lib/errpage.ps
+%%DATADIR%%/%%GS_VERSION%%/lib/escp_24.src
%%DATADIR%%/%%GS_VERSION%%/lib/font2c.ps
%%DATADIR%%/%%GS_VERSION%%/lib/font2pcl.ps
%%DATADIR%%/%%GS_VERSION%%/lib/ghostpdf.ppd
@@ -479,9 +504,9 @@ bin/wftopfa
%%DATADIR%%/%%GS_VERSION%%/pcl3/margins-EnvDLRotated.ps
%%DATADIR%%/%%GS_VERSION%%/pcl3/margins-Letter.ps
%%DATADIR%%/%%GS_VERSION%%/pcl3/margins-LetterRotated.ps
-@dirrm %%DATADIR%%/%%GS_VERSION%%/pcl3
@exec ln -s -f %D/share/fonts/CIDFont %%CIDFONTDIR%%/CIDFont
@unexec rm -f %%CIDFONTDIR%%/CIDFont
+@dirrm %%DATADIR%%/%%GS_VERSION%%/pcl3
@dirrm %%DATADIR%%/%%GS_VERSION%%/lib
@dirrm %%DATADIR%%/%%GS_VERSION%%/examples
@dirrm %%DATADIR%%/%%GS_VERSION%%/doc
@@ -491,27 +516,6 @@ bin/wftopfa
@dirrm %%DATADIR%%/%%GS_VERSION%%/Resource
@unexec rmdir %D/%%DATADIR%%/%%GS_VERSION%% 2>/dev/null || true
@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/alps/README.gdevalps
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/bj10v/gdev10v.jis
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/ChangeLog
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/ert.txt
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/gdevepag.txt
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/gsepagif.sh
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/epag/psprint
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/eplaser/readme-eplaser-705.euc
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/gdi/README
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lips/Gdevlips.htm
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lxm3200/README
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lxm3200/RELEASE_NOTES
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/lxm3200/Z12-Z31-QuickSetup
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/md2k/README.jis
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/MJ700V2C.FAQ
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/README.mjc
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/README.mje
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/README.noz
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/mjc/cpem.doc
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/pcl3/NEWS
-%%PORTDOCS%%%%DOCSDIR%%/%%GS_VERSION%%/pcl3/how-to-report.txt
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/pcl3
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/mjc
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/md2k
@@ -520,6 +524,7 @@ bin/wftopfa
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/gdi
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/eplaser
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/epag
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/dmprt
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/bj10v
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%/alps
%%PORTDOCS%%@dirrm %%DOCSDIR%%/%%GS_VERSION%%
diff --git a/print/ghostscript-gpl/scripts/configure b/print/ghostscript-gpl/scripts/configure
index 2e1511576cf1..41389a053bc6 100644
--- a/print/ghostscript-gpl/scripts/configure
+++ b/print/ghostscript-gpl/scripts/configure
@@ -31,6 +31,7 @@ else
lbp1310 lbp1510 lbp1610 lbp1710 lbp1810 lbp1910 \
lips2p lips3 lips4 bjc880j lips4v \
m8510 coslw2p coslwxl uniprint \
+ dmprt \
lj250 declj250 ap3250 epson eps9mid eps9high lp8000 \
epag \
escpage lp2000 \
@@ -50,8 +51,8 @@ else
laserjet ljetplus ljet2p ljet3 ljet3d ljet4 ljet4d lj4dith \
cljet5 cljet5c cljet5pr lj5mono lj5gray \
pj pjetxl pjxl paintjet \
- pcl3 \
pjxl300 pxlmono pxlcolor \
+ pcl3 \
ijs ibmpro jetp3852 imagen fs600 lxm5700m \
lxm3200 lx5000 lex2050 lex3200 lex5700 lex7000 \
cp50 necp6 \
@@ -62,6 +63,7 @@ else
sj48 t4693d2 t4693d4 t4693d8 tek4696 \
bmpmono bmpgray bmp16 bmp256 bmp16m bmp32b bmpsep1 bmpsep8 \
ccr \
+ cgmmono cgm8 cgm24 \
cif \
dfaxhigh dfaxlow \
xcf xcfcmyk \
@@ -144,6 +146,7 @@ Have fun with this new configuration style ! -andreas \n\n\
"coslw2p" "CoStar LabelWriter II II/Plus" "$status_coslw2p" \
"coslwxl" "CoStar LabelWriter XL" "$status_coslwxl" \
"uniprint" "Configurable ESC/P,ESC/P2,HP-RTL/PCL,P2X mono/color driver" "$status_uniprint" \
+ "dmprt" "Configurable dot matrix printer driver [DMPRT]" "$status_dmprt" \
"lj250" "DEC LJ250 Companion color printer" "$status_lj250" \
"declj250" "DEC LJ250 driver (alternate)" "$status_declj250" \
"ap3250" "Epson ActionPrinter 3250" "$status_ap3250" \
@@ -241,9 +244,9 @@ Have fun with this new configuration style ! -andreas \n\n\
"pjxl" "HP PaintJet XL color printer" "$status_pjxl" \
"paintjet" "HP PaintJet color printer (alternate)" "$status_paintjet" \
"pjxl300" "HP PaintJet XL300, DeskJet 1200C color printer, HP CopyJet" "$status_pjxl300" \
- "pcl3" "HP PCL 3 (generic) [PCL3]" "$status_pcl3" \
"pxlmono" "HP PCL XL black-and-white printers (LaserJet 5 and 6 family)" "$status_pxlmono" \
"pxlcolor" "HP PCL XL color printers (Color LaserJet 4500/5000)" "$status_pxlcolor" \
+ "pcl3" "HP PCL 3+ (generic) [PCL3]" "$status_pcl3" \
"ijs" "HP Inkjet and other raster devices" "$status_ijs" \
"ibmpro" "IBM 9-pin Proprinter" "$status_ibmpro" \
"jetp3852" "IBM Jetprinter ink-jet color (Model #3852)" "$status_jetp3852" \