aboutsummaryrefslogtreecommitdiff
path: root/print/ghostscript8-x11
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2015-08-22 17:48:35 +0000
committerHiroki Sato <hrs@FreeBSD.org>2015-08-22 17:48:35 +0000
commit27470e1676e69455acf06ae25ebd42ebd5bdecdb (patch)
tree445c3e315f03aa972de87391f921c655e4634f60 /print/ghostscript8-x11
parentcb9ed09fda5119f533f6a0b50796a275dfe64587 (diff)
downloadports-27470e1676e69455acf06ae25ebd42ebd5bdecdb.tar.gz
ports-27470e1676e69455acf06ae25ebd42ebd5bdecdb.zip
Notes
Diffstat (limited to 'print/ghostscript8-x11')
-rw-r--r--print/ghostscript8-x11/Makefile57
-rw-r--r--print/ghostscript8-x11/distinfo4
-rw-r--r--print/ghostscript8-x11/files/patch-base-Makefile.in124
-rw-r--r--print/ghostscript8-x11/files/patch-base-configure.ac94
-rw-r--r--print/ghostscript8-x11/files/patch-base-devs.mak42
-rw-r--r--print/ghostscript8-x11/files/patch-base-errors.h10
-rw-r--r--print/ghostscript8-x11/files/patch-base-gdevl256.c30
-rw-r--r--print/ghostscript8-x11/files/patch-base-gdevperm.c11
-rw-r--r--print/ghostscript8-x11/files/patch-base-gdevvglb.c32
-rw-r--r--print/ghostscript8-x11/files/patch-base-gp_unix.c47
-rw-r--r--print/ghostscript8-x11/files/patch-base-gs.mak11
-rw-r--r--print/ghostscript8-x11/files/patch-base-gsmalloc.c11
-rw-r--r--print/ghostscript8-x11/files/patch-base-gxobj.h18
-rw-r--r--print/ghostscript8-x11/files/patch-base-ijs.mak20
-rw-r--r--print/ghostscript8-x11/files/patch-base-lib.mak26
-rw-r--r--print/ghostscript8-x11/files/patch-base-sjpx.c36
-rw-r--r--print/ghostscript8-x11/files/patch-base-unix-dll.mak17
-rw-r--r--print/ghostscript8-x11/files/patch-base-unix-gcc.mak216
-rw-r--r--print/ghostscript8-x11/files/patch-base-unixinst.mak20
-rw-r--r--print/ghostscript8-x11/pkg-descr8
20 files changed, 834 insertions, 0 deletions
diff --git a/print/ghostscript8-x11/Makefile b/print/ghostscript8-x11/Makefile
new file mode 100644
index 000000000000..2d234ced94cf
--- /dev/null
+++ b/print/ghostscript8-x11/Makefile
@@ -0,0 +1,57 @@
+# Created by: Andreas Klemm <andreas@klemm.gtn.com>
+# $FreeBSD$
+
+PORTNAME= ghostscript
+PORTVERSION= 8.71
+PORTREVISION= 19
+CATEGORIES= print
+MASTER_SITES= http://downloads.ghostscript.com/public/ \
+ SF/ghostscript/GPL%20Ghostscript/${PORTVERSION}/ \
+ ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs${PORTVERSION:S/.//}/
+PKGNAMESUFFIX= 8-x11
+DIST_SUBDIR= ${PORTNAME}
+
+MAINTAINER= doceng@FreeBSD.org
+COMMENT= Ghostscript 8.x PostScript interpreter, X11 support
+
+LICENSE= GPLv3
+
+CONFLICTS_INSTALL= \
+ gambc-[0-9]* \
+ ghostscript[789]-[0-9]* \
+ ghostscript[789]-nox11-[0-9]* \
+ ghostscript9-agpl-[0-9]* \
+ ghostscript9-agpl-nox11-[0-9]*
+
+USES= autoreconf ghostscript:8 gmake tar:xz
+USE_LDCONFIG= yes
+USE_XORG= ice sm x11 xext xt
+GNU_CONFIGURE= yes
+EXTRACT_AFTER_ARGS= ${EXCLUDE_DIRS:S/^/--exclude /}
+MAKE_ENV= CFLAGS_STANDARD="${CFLAGS}" \
+ XLDFLAGS="${XLDFLAGS}"
+CONFIGURE_ENV= ${MAKE_ENV}
+CONFIGURE_ARGS= --disable-compile-inits \
+ --disable-contrib \
+ --enable-dynamic \
+ --without-ijs \
+ --without-jasper \
+ --without-libpaper \
+ --with-x \
+ --x-includes=${LOCALBASE}/include \
+ --x-libraries=${LOCALBASE}/lib \
+ --with-drivers=""
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+XLDFLAGS= -lpthread
+ALL_TARGET= ./obj/X11.so
+INSTALL_TARGET= install-shared
+PLIST_FILES= ${GS_LIBDIR}/X11.so
+
+GS_LIBDIR= lib/${PORTNAME}/${PORTVERSION}
+EXCLUDE_DIRS= jbig2dec jpeg expat jasper libpng tiff zlib
+
+pre-build:
+ ${MKDIR} ${WRKSRC}/obj
+
+.include <bsd.port.mk>
diff --git a/print/ghostscript8-x11/distinfo b/print/ghostscript8-x11/distinfo
new file mode 100644
index 000000000000..1ca75e1e5231
--- /dev/null
+++ b/print/ghostscript8-x11/distinfo
@@ -0,0 +1,4 @@
+SHA256 (ghostscript/ghostscript-8.71.tar.xz) = f48f7370a00f24fce174b147074aca3f6bede82154dd2bf93d24430a62e4de73
+SIZE (ghostscript/ghostscript-8.71.tar.xz) = 15698644
+SHA256 (ghostscript/epag-3.09.tar.gz) = ad10eca44c781a5851d5a8993dcd95b2e2b99392cbf2c8372a5a658f3b991b3b
+SIZE (ghostscript/epag-3.09.tar.gz) = 12858
diff --git a/print/ghostscript8-x11/files/patch-base-Makefile.in b/print/ghostscript8-x11/files/patch-base-Makefile.in
new file mode 100644
index 000000000000..589acac05131
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-Makefile.in
@@ -0,0 +1,124 @@
+--- base/Makefile.in.orig 2009-12-18 16:04:10.000000000 +0900
++++ base/Makefile.in 2015-08-21 20:58:35.641049000 +0900
+@@ -47,9 +47,9 @@
+ # the directories also define the default search path for the
+ # initialization files (gs_*.ps) and the fonts.
+
+-INSTALL = $(GLSRCDIR)/instcopy -c
+-INSTALL_PROGRAM = $(INSTALL) -m 755
+-INSTALL_DATA = $(INSTALL) -m 644
++INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM}
++INSTALL_SCRIPT = ${BSD_INSTALL_SCRIPT}
++INSTALL_DATA = ${BSD_INSTALL_DATA}
+ INSTALL_SHARED = @INSTALL_SHARED@
+
+ prefix = @prefix@
+@@ -156,7 +156,7 @@
+ # some older JPEG streams that violate the standard. If the JPEG
+ # library built from local sources, the patch will be applied.
+
+-SHARE_JPEG=@SHARE_LIBJPEG@
++SHARE_JPEG=1
+ JPEG_NAME=jpeg
+
+ # Define the directory where the PNG library sources are stored,
+@@ -164,12 +164,12 @@
+ # You may need to change this if the libpng version changes.
+ # See libpng.mak for more information.
+
+-SHARE_LIBPNG=@SHARE_LIBPNG@
++SHARE_LIBPNG=1
+ PNGSRCDIR=@LIBPNGDIR@
+ LIBPNG_NAME=png
+
+ # libtiff
+-SHARE_LIBTIFF=@SHARE_LIBTIFF@
++SHARE_LIBTIFF=1
+ TIFFSRCDIR=@LIBTIFFDIR@
+ TIFFPLATFORM=unix
+ TIFFCONFIG_SUFFIX=
+@@ -178,7 +178,7 @@
+ # Define the directory where the zlib sources are stored.
+ # See zlib.mak for more information.
+
+-SHARE_ZLIB=@SHARE_ZLIB@
++SHARE_ZLIB=1
+ ZSRCDIR=@ZLIBDIR@
+ #ZLIB_NAME=gz
+ ZLIB_NAME=z
+@@ -254,7 +254,7 @@
+ # Define the added flags for standard, debugging, profiling
+ # and shared object builds.
+
+-CFLAGS_STANDARD=@OPT_CFLAGS@
++CFLAGS_STANDARD?=@OPT_CFLAGS@
+ CFLAGS_DEBUG=-g -O0
+ CFLAGS_PROFILE=-pg @OPT_CFLAGS@
+ CFLAGS_SO=@DYNAMIC_CFLAGS@
+@@ -299,7 +299,7 @@
+ # Solaris may need -lnsl -lsocket -lposix4.
+ # (Libraries required by individual drivers are handled automatically.)
+
+-EXTRALIBS=@LIBS@ @DYNAMIC_LIBS@ @FONTCONFIG_LIBS@
++EXTRALIBS=@LIBS@ @DYNAMIC_LIBS@ @FONTCONFIG_LIBS@ -Wl,-export-dynamic
+
+ # Define the standard libraries to search at the end of linking.
+ # Most platforms require -lpthread for the POSIX threads library;
+@@ -343,7 +343,7 @@
+ # the pthread library. Otherwise use SYNC=nosync
+ #SYNC=posync
+ #SYNC=nosync
+-SYNC=@SYNC@
++SYNC=nosync
+
+ # programs we use
+ RM=rm -f
+@@ -436,27 +436,27 @@
+ #DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev
+ #DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev
+ DEVICE_DEVS=$(DISPLAY_DEV) @X_DEVS@
+-DEVICE_DEVS1=@FILES@
+-DEVICE_DEVS2=@PRINTERS@
+-DEVICE_DEVS3=@CUPSDEV@
+-DEVICE_DEVS4=@IJSDEVS@
+-DEVICE_DEVS5=@OMNIDEVS@
+-DEVICE_DEVS6=@PNGDEVS@
+-DEVICE_DEVS7=@JBIG2DEVS@
+-DEVICE_DEVS8=$(DD)svgwrite.dev
+-DEVICE_DEVS9=
+-DEVICE_DEVS10=
+-DEVICE_DEVS11=
+-DEVICE_DEVS12=
+-DEVICE_DEVS13=
+-DEVICE_DEVS14=
+-DEVICE_DEVS15=
+-DEVICE_DEVS16=
+-DEVICE_DEVS17=
+-DEVICE_DEVS18=
+-DEVICE_DEVS19=
+-DEVICE_DEVS20=
+-DEVICE_DEVS21=
++#DEVICE_DEVS1=@FILES@
++#DEVICE_DEVS2=@PRINTERS@
++#DEVICE_DEVS3=@CUPSDEV@
++#DEVICE_DEVS4=@IJSDEVS@
++#DEVICE_DEVS5=@OMNIDEVS@
++#DEVICE_DEVS6=@PNGDEVS@
++#DEVICE_DEVS7=@JBIG2DEVS@
++#DEVICE_DEVS8=$(DD)svgwrite.dev
++#DEVICE_DEVS9=
++#DEVICE_DEVS10=
++#DEVICE_DEVS11=
++#DEVICE_DEVS12=
++#DEVICE_DEVS13=
++#DEVICE_DEVS14=
++#DEVICE_DEVS15=
++#DEVICE_DEVS16=
++#DEVICE_DEVS17=
++#DEVICE_DEVS18=
++#DEVICE_DEVS19=
++#DEVICE_DEVS20=
++#DEVICE_DEVS21=
+
+
+ # Shared library target to build.
diff --git a/print/ghostscript8-x11/files/patch-base-configure.ac b/print/ghostscript8-x11/files/patch-base-configure.ac
new file mode 100644
index 000000000000..cf4085dfeebb
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-configure.ac
@@ -0,0 +1,94 @@
+--- base/configure.ac.orig 2009-11-24 17:36:27.000000000 +0900
++++ base/configure.ac 2015-08-21 20:57:47.140818000 +0900
+@@ -322,35 +322,6 @@
+
+ AC_CHECK_LIB(dl, dlopen)
+
+-AC_MSG_CHECKING([for local jpeg library source])
+-dnl At present, we give the local source priority over the shared
+-dnl build, so that the D_MAX_BLOCKS_IN_MCU patch will be applied.
+-dnl A more sophisticated approach would be to test the shared lib
+-dnl to see whether it has already been patched.
+-LIBJPEGDIR=src
+-if test -f jpeg/jpeglib.h; then
+- AC_MSG_RESULT([jpeg])
+- SHARE_LIBJPEG=0
+- LIBJPEGDIR=jpeg
+-elif test -f jpeg-6b/jpeglib.h; then
+- AC_MSG_RESULT([jpeg-6b])
+- SHARE_LIBJPEG=0
+- LIBJPEGDIR=jpeg-6b
+-else
+- AC_MSG_RESULT([no])
+- AC_CHECK_LIB(jpeg, jpeg_set_defaults, [
+- AC_CHECK_HEADERS([jpeglib.h], [SHARE_LIBJPEG=1])
+- ])
+-fi
+-if test -z "$SHARE_LIBJPEG"; then
+- AC_MSG_ERROR([I wasn't able to find a copy
+- of the jpeg library. This is required for compiling
+- ghostscript. Please download a copy of the source,
+- e.g. from http://www.ijg.org/, unpack it at the
+- top level of the gs source tree, and rename
+- the directory to 'jpeg'.
+- ])
+-fi
+ AC_SUBST(SHARE_LIBJPEG)
+ AC_SUBST(LIBJPEGDIR)
+ dnl check for the internal jpeg memory header
+@@ -402,7 +373,7 @@
+ PNGDEVS="$PNGDEVS_ALL"
+ else
+ AC_MSG_RESULT([no])
+- AC_CHECK_LIB(png, png_check_sig, [
++ AC_CHECK_LIB(png, png_sig_cmp, [
+ AC_CHECK_HEADERS(png.h, [
+ SHARE_LIBPNG=1
+ PNGDEVS="$PNGDEVS_ALL"
+@@ -434,7 +405,7 @@
+ AC_CHECK_LIB(tiff, TIFFOpen,
+ [AC_CHECK_HEADERS(tiff.h, [HAVE_SYSTEM_LIBTIFF=1;SHARE_LIBTIFF=1])],
+ [], [-ljpeg])
+- if test -z $LOCAL_LIBTIFF_VERSION && test "x$HAVE_SYSTEM_LIBTIFF" == x; then
++ if test -z $LOCAL_LIBTIFF_VERSION && test "x$HAVE_SYSTEM_LIBTIFF" = x; then
+ AC_MSG_NOTICE([Could not find a copy of libtiff on your system.
+ Disabling tiff output devices.])
+ else
+@@ -758,7 +729,7 @@
+ X_DEVS=""
+ X_LIBS=""
+
+-if test x$no_x != xyes; then
++if test x$with_x != xno; then
+ if test "$x_libraries" = "/usr/lib"; then
+ echo "Ignoring X library directory \"$x_libraries\" requested by configure."
+ x_libraries="NONE"
+@@ -1063,7 +1034,12 @@
+ ;;
+ *BSD)
+ DYNAMIC_CFLAGS="-fPIC"
+- DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
++ if test "x$X_DEVS" != x; then
++ DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so"
++ INSTALL_SHARED="install-shared"
++ else
++ DYNAMIC_DEVS=""
++ fi
+ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\""
+ DYNAMIC_LDFLAGS="-fPIC -shared"
+ DYNAMIC_LIBS=""
+@@ -1119,11 +1095,11 @@
+ fontpath="${fontpath}:$datadir/fonts/default/TrueType"
+
+ # These font directories are used by IRIX...
+- fontpath="${fontpath}:/usr/lib/DPS/outline/base"
++ # fontpath="${fontpath}:/usr/lib/DPS/outline/base"
+
+ # These font directories are used by Solaris...
+- fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/Type1"
+- fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/TrueType"
++ # fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/Type1"
++ # fontpath="${fontpath}:/usr/openwin/lib/X11/fonts/TrueType"
+
+ # This font directory is used by CUPS...
+ if test "x$CUPSCONFIG" != x; then
diff --git a/print/ghostscript8-x11/files/patch-base-devs.mak b/print/ghostscript8-x11/files/patch-base-devs.mak
new file mode 100644
index 000000000000..8c7cc96f7620
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-devs.mak
@@ -0,0 +1,42 @@
+--- base/devs.mak.orig 2009-11-12 00:50:28.000000000 +0900
++++ base/devs.mak 2015-08-21 20:37:24.364436000 +0900
+@@ -421,10 +421,10 @@
+ ### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
+
+ $(GLOBJ)lvga256.so : $(lvga256_)
+- $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)lvga256.so $(lvga256_) -lvga -lvgagl
++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)lvga256.so $(lvga256_) -lvga -lvgagl $(XLDFLAGS)
+
+ $(GLOBJ)vgalib.so : $(vgalib_)
+- $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)vgalib.so $(vgalib_) -lvga -lvgagl
++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)vgalib.so $(vgalib_) -lvga -lvgagl $(XLDFLAGS)
+
+ ### -------------------------- The X11 device -------------------------- ###
+
+@@ -457,7 +457,7 @@
+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c
+
+ $(GLOBJ)gdevxcmp.$(OBJ) : $(GLSRC)gdevxcmp.c $(GDEVX) $(math__h)
+- $(GLCC) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
+
+ $(GLOBJ)gdevxini.$(OBJ) : $(GLSRC)gdevxini.c $(GDEVX) $(memory__h)\
+ $(gserrors_h) $(gsparamx_h) $(gxdevmem_h) $(gdevbbox_h)
+@@ -467,7 +467,7 @@
+ # const/non-const cast required by the X headers that we can't work around.
+ $(GLOBJ)gdevxres.$(OBJ) : $(GLSRC)gdevxres.c $(std_h) $(x__h)\
+ $(gsmemory_h) $(gstypes_h) $(gxdevice_h) $(gdevx_h)
+- $(CC_NO_WARN) $(GLCCFLAGS) $(XINCLUDE) $(GLO_)gdevxres.$(OBJ) $(C_) $(GLSRC)gdevxres.c
++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxres.$(OBJ) $(C_) $(GLSRC)gdevxres.c
+
+ $(GLOBJ)gdevxxf.$(OBJ) : $(GLSRC)gdevxxf.c $(GDEVX) $(math__h) $(memory__h)\
+ $(gsstruct_h) $(gsutil_h) $(gxxfont_h)
+@@ -527,7 +527,7 @@
+ ### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
+
+ $(GLOBJ)X11.so : $(x11alt_) $(x11_)
+- $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)X11.so $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)X11.so $(x11alt_) $(x11_) -L$(LOCALBASE)/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
+
+ ###### --------------- Memory-buffered printer devices --------------- ######
+
diff --git a/print/ghostscript8-x11/files/patch-base-errors.h b/print/ghostscript8-x11/files/patch-base-errors.h
new file mode 100644
index 000000000000..89a493c96120
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-errors.h
@@ -0,0 +1,10 @@
+--- base/errors.h.orig 2007-06-06 07:23:38.000000000 +0900
++++ base/errors.h 2009-03-29 03:53:40.000000000 +0900
+@@ -21,6 +21,6 @@
+ */
+
+ /* We include that file here to backward compatibility */
+-#include "ierrors.h"
++#include "../psi/ierrors.h"
+
+ #endif /* errors_INCLUDED */
diff --git a/print/ghostscript8-x11/files/patch-base-gdevl256.c b/print/ghostscript8-x11/files/patch-base-gdevl256.c
new file mode 100644
index 000000000000..60be4a072b51
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gdevl256.c
@@ -0,0 +1,30 @@
+--- base/gdevl256.c.orig 2007-09-25 22:31:24.000000000 +0900
++++ base/gdevl256.c 2010-08-01 23:05:56.000000000 +0900
+@@ -143,9 +143,12 @@
+ /* for compatibility with the older display modes: */
+ /* these are indexed as 0.0.R0.G0.B0.R1.G1.B1. */
+ gx_color_index
+-lvga256_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g,
+- gx_color_value b)
++lvga256_map_rgb_color(gx_device * dev, const gx_color_value cv[])
+ {
++ gx_color_value r = cv[0];
++ gx_color_value g = cv[1];
++ gx_color_value b = cv[2];
++
+ #define cv_bits(v,n) (v >> (gx_color_value_bits - n))
+ ushort r5 = cv_bits(r, 5), g5 = cv_bits(g, 5), b5 = cv_bits(b, 5);
+ static const byte cube_bits[32] =
+@@ -301,12 +304,3 @@
+ gl_line(x0, y0, x1, y1, color);
+ return 0;
+ }
+-
+-#ifdef GS_DEVS_SHARED
+-extern void gs_lib_register_device(const gx_device *dev);
+-void
+-gs_shared_init(void)
+-{
+- gs_lib_register_device(&gs_lvga256_device);
+-}
+-#endif
diff --git a/print/ghostscript8-x11/files/patch-base-gdevperm.c b/print/ghostscript8-x11/files/patch-base-gdevperm.c
new file mode 100644
index 000000000000..94b9020eb2c5
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gdevperm.c
@@ -0,0 +1,11 @@
+--- base/gdevperm.c.orig Tue Sep 25 22:31:24 2007
++++ base/gdevperm.c Sat Nov 24 15:11:12 2007
+@@ -286,7 +286,7 @@
+ (strncmp((const char *)name, (const char *)str, name_size) == 0))
+
+ static 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 --git a/print/ghostscript8-x11/files/patch-base-gdevvglb.c b/print/ghostscript8-x11/files/patch-base-gdevvglb.c
new file mode 100644
index 000000000000..b0f061ff3a66
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gdevvglb.c
@@ -0,0 +1,32 @@
+--- base/gdevvglb.c.orig 2007-09-25 22:31:24.000000000 +0900
++++ base/gdevvglb.c 2010-08-01 23:08:53.000000000 +0900
+@@ -149,10 +149,13 @@
+ }
+
+ static gx_color_index
+-vgalib_map_rgb_color(gx_device * dev, gx_color_value red,
+- gx_color_value green, gx_color_value blue)
++vgalib_map_rgb_color(gx_device * dev, const gx_color_value cv[])
+ {
+- return pc_4bit_map_rgb_color(dev, red, green, blue);
++ gx_color_value r = cv[0];
++ gx_color_value g = cv[1];
++ gx_color_value b = cv[2];
++
++ return pc_4bit_map_rgb_color(dev, cv);
+ }
+
+ static int
+@@ -368,12 +371,3 @@
+ }
+ return 0;
+ }
+-
+-#ifdef GS_DEVS_SHARED
+-extern void gs_lib_register_device(const gx_device *dev);
+-void
+-gs_shared_init(void)
+-{
+- gs_lib_register_device(&gs_vgalib_device);
+-}
+-#endif
diff --git a/print/ghostscript8-x11/files/patch-base-gp_unix.c b/print/ghostscript8-x11/files/patch-base-gp_unix.c
new file mode 100644
index 000000000000..c1dc7b830c9b
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gp_unix.c
@@ -0,0 +1,47 @@
+--- base/gp_unix.c.orig 2015-08-21 21:07:48.028144000 +0900
++++ base/gp_unix.c 2015-08-21 21:10:17.913478000 +0900
+@@ -50,6 +50,7 @@
+ * and applied as a patch (preferable).
+ */
+ #include <sys/types.h>
++#include <limits.h>
+ #include <dirent.h>
+ #include <dlfcn.h>
+ #include <string.h>
+@@ -59,26 +60,25 @@
+ {
+ DIR* dir = NULL;
+ struct dirent* dirent;
+- char buff[1024];
++ char buff[PATH_MAX];
+ char* pbuff;
+ void* handle;
+ void (*gs_shared_init)(void);
+
+- strncpy(buff, GS_DEVS_SHARED_DIR, sizeof(buff) - 2);
+- pbuff = buff + strlen(buff);
+- *pbuff++ = '/'; *pbuff = '\0';
+-
+ dir = opendir(GS_DEVS_SHARED_DIR);
+ if (dir == 0) return;
+
+ while ((dirent = readdir(dir)) != 0) {
+- strncpy(pbuff, dirent->d_name, sizeof(buff) - (pbuff - buff) - 1);
+- if ((handle = dlopen(buff, RTLD_NOW)) != 0) {
+- if ((gs_shared_init = dlsym(handle, "gs_shared_init")) != 0) {
++ snprintf(buff, sizeof(buff), "%s/%s", GS_DEVS_SHARED_DIR, dirent->d_name);
++ pbuff = buff + strlen(buff) - 3;
++ if (strcmp(pbuff, ".so") != 0)
++ continue;
++ handle = dlopen(buff, RTLD_NOW);
++ if (handle == NULL)
++ continue;
++ gs_shared_init = dlsym(handle, "gs_shared_init");
++ if (gs_shared_init != NULL)
+ (*gs_shared_init)();
+- } else {
+- }
+- }
+ }
+
+ closedir(dir);
diff --git a/print/ghostscript8-x11/files/patch-base-gs.mak b/print/ghostscript8-x11/files/patch-base-gs.mak
new file mode 100644
index 000000000000..ecb6f57e0dd7
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gs.mak
@@ -0,0 +1,11 @@
+--- base/gs.mak.orig 2010-05-23 15:46:23.000000000 +0900
++++ base/gs.mak 2010-05-23 15:57:37.000000000 +0900
+@@ -415,7 +415,7 @@
+ ld_tr=$(GLGENDIR)$(D)ld.tr
+ $(ld_tr) : \
+ $(GS_MAK) $(TOP_MAKEFILES) $(GLSRCDIR)$(D)version.mak $(GENCONF_XE) $(ECHOGS_XE) $(devs_tr) $(DEVS_ALL) $(GLGENDIR)$(D)libcore.dev
+- $(EXP)$(GENCONF_XE) $(devs_tr) -h $(gconfig_h) $(CONFILES) $(CONFLDTR) $(ld_tr)
++ $(EXP)$(GENCONF_XE) $(devs_tr) -h /dev/stdout $(CONFILES) $(CONFLDTR) $(ld_tr) | awk 'BEGIN{j=0; p=1;} /jpeg_device/ {if(j++ > 0) p=0;} // {if(p==1) { print; } else { p=1 } }' > $(gconfig_h)
+ $(EXP)$(ECHOGS_XE) -a $(gconfig_h) $(GCONFIG_EXTRAS)
+
+ $(gconfig_h) : $(ld_tr)
diff --git a/print/ghostscript8-x11/files/patch-base-gsmalloc.c b/print/ghostscript8-x11/files/patch-base-gsmalloc.c
new file mode 100644
index 000000000000..c4982de93012
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gsmalloc.c
@@ -0,0 +1,11 @@
+--- base/gsmalloc.c.orig 2015-07-24 09:52:39.718916000 +0900
++++ base/gsmalloc.c 2015-07-24 09:54:31.761202000 +0900
+@@ -174,7 +174,7 @@
+ } else {
+ uint added = size + sizeof(gs_malloc_block_t);
+
+- if (mmem->limit - added < mmem->used)
++ if (added <= size || mmem->limit - added < mmem->used)
+ set_msg("exceeded limit");
+ else if ((ptr = (byte *) malloc(added)) == 0)
+ set_msg("failed");
diff --git a/print/ghostscript8-x11/files/patch-base-gxobj.h b/print/ghostscript8-x11/files/patch-base-gxobj.h
new file mode 100644
index 000000000000..529efe379df2
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-gxobj.h
@@ -0,0 +1,18 @@
+--- base/gxobj.h.orig Tue Mar 14 01:18:19 2006
++++ base/gxobj.h Fri Mar 23 14:41:44 2007
+@@ -109,11 +109,15 @@
+ * required by the hardware, regardless of the value of obj_align_mod.
+ * See gsmemraw.h for more information about this.
+ */
++#if !defined(__ia64__) && !defined(__amd64__)
+ #define obj_align_mod\
+ (((ARCH_ALIGN_MEMORY_MOD - 1) |\
+ (align_bitmap_mod - 1) |\
+ (obj_back_scale - 1)) + 1)
+ /* The only possible values for obj_align_mod are 4, 8, or 16.... */
++#else
++#define obj_align_mod 16
++#endif
+ #if obj_align_mod == 4
+ # define log2_obj_align_mod 2
+ #else
diff --git a/print/ghostscript8-x11/files/patch-base-ijs.mak b/print/ghostscript8-x11/files/patch-base-ijs.mak
new file mode 100644
index 000000000000..26e407247ede
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-ijs.mak
@@ -0,0 +1,20 @@
+--- base/ijs.mak.orig 2012-06-13 02:06:36.000000000 +0900
++++ base/ijs.mak 2012-06-13 02:07:44.000000000 +0900
+@@ -41,7 +41,7 @@
+ ijs.clean : ijs.config-clean ijs.clean-not-config-clean
+
+ ### WRONG. MUST DELETE OBJ AND GEN FILES SELECTIVELY.
+-ijs.clean-not-config-clean :
++ijs.clean-not-config-clean : $(ECHOGS_XE)
+ # echo $(IJSSRC) $(IJSGEN) $(IJSOBJ) $(IJSO_)
+ $(EXP)$(ECHOGS_XE) $(IJSSRC) $(IJSGEN) $(IJSOBJ) $(IJSO_)
+ $(RM_) $(IJSOBJ)*.$(OBJ)
+@@ -61,7 +61,7 @@
+ ijs_client_h=$(IJSSRC)$(D)ijs_client.h
+ ijs_server_h=$(IJSSRC)$(D)ijs_server.h
+
+-$(IJSOBJ)ijs.$(OBJ) : $(IJSSRC)ijs.c $(IJSDEP) $(ijs_h)
++$(IJSOBJ)ijs.$(OBJ) : $(ECHOGS_XE) $(IJSSRC)ijs.c $(IJSDEP) $(ijs_h)
+ # echo $(IJS_CCFLAGS)
+ $(EXP)$(ECHOGS_XE) $(IJS_CCFLAGS)
+ $(IJS_CC) $(IJSO_)ijs.$(OBJ) $(C_) $(IJSSRC)ijs.c
diff --git a/print/ghostscript8-x11/files/patch-base-lib.mak b/print/ghostscript8-x11/files/patch-base-lib.mak
new file mode 100644
index 000000000000..037390f44f0d
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-lib.mak
@@ -0,0 +1,26 @@
+--- base/lib.mak.orig 2009-12-30 07:18:01.000000000 +0900
++++ base/lib.mak 2015-08-21 20:39:55.003384000 +0900
+@@ -895,7 +895,7 @@
+ $(GLOBJ)gsparamx.$(OBJ) : $(GLSRC)gsparamx.c $(string__h)\
+ $(gserror_h) $(gserrors_h) $(gsmemory_h) $(gsparam_h) $(gsparamx_h)\
+ $(gstypes_h)
+- $(GLCC) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c
++ $(GLCCSHARED) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c
+
+ # Future replacement for gsparams.c
+ $(GLOBJ)gsparam2.$(OBJ) : $(GLSRC)gsparam2.c $(GXERR) $(memory__h)\
+@@ -2684,12 +2684,12 @@
+ # This is used to access compressed, compiled-in support files
+ gsiorom_h=$(GLSRC)gsiorom.h
+ romfs_=$(GLOBJ)gsiorom.$(OBJ)
+-$(GLD)romfs1.dev : $(LIB_MAK) $(ECHO_XE) $(romfs_)
++$(GLD)romfs1.dev : $(LIB_MAK) $(ECHOGS_XE) $(romfs_)
+ $(SETMOD) $(GLD)romfs1 $(romfs_)
+ $(ADDMOD) $(GLD)romfs1 -iodev rom
+
+ # A dummy romfs when we aren't using COMPILE_INITS
+-$(GLD)romfs0.dev : $(LIB_MAK) $(ECHO_XE)
++$(GLD)romfs0.dev : $(LIB_MAK) $(ECHOGS_XE)
+ $(SETMOD) $(GLD)romfs0
+
+ $(GLGEN)gsromfs1.c : $(MKROMFS_XE) $(PS_ROMFS_DEPS)
diff --git a/print/ghostscript8-x11/files/patch-base-sjpx.c b/print/ghostscript8-x11/files/patch-base-sjpx.c
new file mode 100644
index 000000000000..761f1423b700
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-sjpx.c
@@ -0,0 +1,36 @@
+Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
+Date: 2009-02-11
+Initial Package Version: 8.63 (well, it's needed for 8.63, obviously ex 8.61)
+Upstream Status: unknown
+Origin: fedora
+Description: Allows gnu-ghostscript to compile against external libjasper.
+ To do that, you need to remove the jasper/ directory. The included version
+is 1.701 which is somewhat old. Forward-ported to 8.64 (the structure of
+the file source tree has changed) by km.
+
+diff -Naur ghostscript-8.64.orig/base/sjpx.c ghostscript-8.64/base/sjpx.c
+--- base/sjpx.c 2008-08-21 00:22:49.000000000 +0100
++++ base/sjpx.c 2009-02-10 21:59:41.000000000 +0000
+@@ -34,14 +34,6 @@
+ private_st_jpxd_state(); /* creates a gc object for our state,
+ defined in sjpx.h */
+
+-/* error reporting callback for the jpx library */
+-static void
+-s_jpx_jas_error_cb(jas_error_t err, char *msg)
+-{
+- dprintf2("jasper (code %d) %s", (int)err, msg);
+-}
+-
+-
+ /* initialize the steam.
+ this involves allocating the stream and image structures, and
+ initializing the decoder.
+@@ -59,7 +51,6 @@
+ }
+
+ status = jas_init();
+- jas_set_error_cb(s_jpx_jas_error_cb);
+ #ifdef JPX_DEBUG
+ /* raise the error reporting threshold from the default (0) */
+ jas_setdbglevel(1);
diff --git a/print/ghostscript8-x11/files/patch-base-unix-dll.mak b/print/ghostscript8-x11/files/patch-base-unix-dll.mak
new file mode 100644
index 000000000000..96876e3bfb15
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-unix-dll.mak
@@ -0,0 +1,17 @@
+--- base/unix-dll.mak.orig 2009-10-20 05:24:53.000000000 +0900
++++ base/unix-dll.mak 2010-04-03 12:22:35.000000000 +0900
+@@ -79,12 +79,11 @@
+ # Build the small Ghostscript loaders, with Gtk+ and without
+
+ $(GSSOC_XE): $(GS_SO) $(PSSRC)$(SOC_LOADER)
+- $(GLCC) -g -o $(GSSOC_XE) $(PSSRC)dxmainc.c \
+- $(LDFLAGS) -L$(BINDIR) -l$(GS)
++ $(GLCC) -g -o $(GSSOC_XE) $(PSSRC)dxmainc.c -L$(BINDIR) -l$(GS)
+
+ $(GSSOX_XE): $(GS_SO) $(PSSRC)$(SOC_LOADER)
+ $(GLCC) -g $(SOC_CFLAGS) -o $(GSSOX_XE) $(PSSRC)$(SOC_LOADER) \
+- $(LDFLAGS) -L$(BINDIR) -l$(GS) $(SOC_LIBS)
++ -L$(BINDIR) -l$(GS) $(SOC_LIBS)
+
+ # ------------------------- Recursive make targets ------------------------- #
+
diff --git a/print/ghostscript8-x11/files/patch-base-unix-gcc.mak b/print/ghostscript8-x11/files/patch-base-unix-gcc.mak
new file mode 100644
index 000000000000..4277ce7ed6c3
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-unix-gcc.mak
@@ -0,0 +1,216 @@
+--- base/unix-gcc.mak.orig 2008-10-03 04:33:22.000000000 +0900
++++ base/unix-gcc.mak 2009-03-29 03:33:35.000000000 +0900
+@@ -21,15 +21,18 @@
+ # source, generated intermediate file, and object directories
+ # for the graphics library (GL) and the PostScript/PDF interpreter (PS).
+
++.CURDIR?=.
+ BINDIR=./bin
+-GLSRCDIR=./base
+-GLGENDIR=./obj
+-GLOBJDIR=./obj
+-PSSRCDIR=./psi
+-PSLIBDIR=./lib
+-PSRESDIR=./Resource
+-PSGENDIR=./obj
+-PSOBJDIR=./obj
++BINDIR=${.CURDIR}/bin
++GLSRCDIR=${.CURDIR}/base
++GLGENDIR=${.CURDIR}/obj
++GLOBJDIR=${.CURDIR}/obj
++PSSRCDIR=${.CURDIR}/psi
++PSLIBDIR=${.CURDIR}/lib
++PSRESDIR=${.CURDIR}/Resource
++PSGENDIR=${.CURDIR}/obj
++PSOBJDIR=${.CURDIR}/obj
++CONTRIBDIR=${.CURDIR}/contrib
+
+ # Do not edit the next group of lines.
+
+@@ -48,11 +51,10 @@
+ # the directories also define the default search path for the
+ # initialization files (gs_*.ps) and the fonts.
+
+-INSTALL = $(GLSRCDIR)/instcopy -c
+-INSTALL_PROGRAM = $(INSTALL) -m 755
+-INSTALL_DATA = $(INSTALL) -m 644
++INSTALL_PROGRAM = ${BSD_INSTALL_SCRIPT}
++INSTALL_DATA = ${BSD_INSTALL_DATA}
+
+-prefix = /usr/local
++prefix = ${PREFIX}
+ exec_prefix = $(prefix)
+ bindir = $(exec_prefix)/bin
+ scriptdir = $(bindir)
+@@ -107,7 +109,7 @@
+ # -DHAVE_HYPOT
+ # use the system hypot() call
+
+-CAPOPT= -DHAVE_MKSTEMP
++CAPOPT= -DHAVE_MKSTEMP -DHAVE_HYPOT
+
+ # Define the name of the executable file.
+
+@@ -131,7 +133,7 @@
+ # some older JPEG streams that violate the standard. If the JPEG
+ # library built from local sources, the patch will be applied.
+
+-SHARE_JPEG=0
++SHARE_JPEG=1
+ JPEG_NAME=jpeg
+
+ # Define the directory where the PNG library sources are stored,
+@@ -145,7 +147,7 @@
+ # what its name is.
+ # See gs.mak and Make.htm for more information.
+
+-SHARE_LIBPNG=0
++SHARE_LIBPNG=1
+ LIBPNG_NAME=png
+
+ # Define the directory where the zlib sources are stored.
+@@ -157,7 +159,7 @@
+ # what its name is (usually libz, but sometimes libgz).
+ # See gs.mak and Make.htm for more information.
+
+-SHARE_ZLIB=0
++SHARE_ZLIB=1
+ #ZLIB_NAME=gz
+ ZLIB_NAME=z
+
+@@ -166,6 +168,14 @@
+ JBIG2_LIB=jbig2dec
+ JBIG2SRCDIR=jbig2dec
+
++# Choose the library to use for (JPXDecode support)
++# whether to link to an external build or compile in from source
++# and source location and configuration flags for compiling in
++JPX_LIB=jasper
++SHARE_JPX=0
++JPXSRCDIR=jasper
++JPX_CFLAGS=-DJAS_CONFIGURE
++
+ # Define the directory where the icclib source are stored.
+ # See icclib.mak for more information
+
+@@ -194,7 +204,7 @@
+
+ # Define the name of the C compiler.
+
+-CC=gcc
++CC?=cc
+
+ # Define the name of the linker for the final link step.
+ # Normally this is the same as the C compiler.
+@@ -211,10 +221,10 @@
+ # Define the added flags for standard, debugging, profiling
+ # and shared object builds.
+
+-CFLAGS_STANDARD=-O2
++CFLAGS_STANDARD?=-O2
+ CFLAGS_DEBUG=-g -O0
+ CFLAGS_PROFILE=-pg -O2
+-CFLAGS_SO=-fPIC -shared
++CFLAGS_SO=-fPIC
+
+ # Define the other compilation flags. Add at most one of the following:
+ # -DBSD4_2 for 4.2bsd systems.
+@@ -227,7 +237,8 @@
+ # We don't include -ansi, because this gets in the way of the platform-
+ # specific stuff that <math.h> typically needs; nevertheless, we expect
+ # gcc to accept ANSI-style function prototypes and function definitions.
+-XCFLAGS=-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"$(gssharedir)\"
++#XCFLAGS+=-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"$(gssharedir)\"
++XCFLAGS+=-DUPD_SIGNAL=0 -I${JPXSRCDIR}/src/libjasper/include -I${LOCALBASE}/include/libpng -I${LOCALBASE}/include
+
+ CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
+
+@@ -238,7 +249,7 @@
+ # -R /usr/local/xxx/lib:/usr/local/lib
+ # giving the full path names of the shared library directories.
+ # XLDFLAGS can be set from the command line.
+-XLDFLAGS=
++XLDFLAGS+=-L${LOCALBASE}/lib
+
+ LDFLAGS=$(XLDFLAGS)
+
+@@ -249,7 +260,7 @@
+ # Solaris may need -lnsl -lsocket -lposix4.
+ # (Libraries required by individual drivers are handled automatically.)
+
+-EXTRALIBS=-rdynamic -ldl
++EXTRALIBS+=-Wl,-export-dynamic
+
+ # Define the standard libraries to search at the end of linking.
+ # Most platforms require -lpthread for the POSIX threads library;
+@@ -271,7 +282,7 @@
+ # Note that x_.h expects to find the header files in $(XINCLUDE)/X11,
+ # not in $(XINCLUDE).
+
+-XINCLUDE=-I/usr/X11R6/include
++XINCLUDE=-I${LOCALBASE}/include
+
+ # Define the directory/ies and library names for the X11 library files.
+ # XLIBDIRS is for ld and should include -L; XLIBDIR is for LD_RUN_PATH
+@@ -283,28 +294,28 @@
+ # Solaris and other SVR4 systems with dynamic linking probably want
+ #XLIBDIRS=-L/usr/openwin/lib -R/usr/openwin/lib
+ # X11R6 (on any platform) may need
+-#XLIBS=Xt SM ICE Xext X11
++XLIBS=Xt SM ICE Xext X11
+
+ #XLIBDIRS=-L/usr/local/X/lib
+-XLIBDIRS=-L/usr/X11R6/lib
++XLIBDIRS=-L${LOCALBASE}/lib
+ XLIBDIR=
+-XLIBS=Xt Xext X11
++#XLIBS=Xt Xext X11
+
+ # Define the .dev module that implements thread and synchronization
+ # primitives for this platform.
+
+ # If POSIX sync primitives are used, also change the STDLIBS to include
+ # the pthread library.
+-#SYNC=posync
++SYNC=posync
+
+ # Default is No sync primitives since some platforms don't have it (HP-UX)
+-SYNC=nosync
++#SYNC=nosync
+
+ # ------ Devices and features ------ #
+
+ # Choose the language feature(s) to include. See gs.mak for details.
+
+-FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev $(PSD)fapi.dev
++FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(GLD)pipe.dev $(PSD)fapi.dev $(PSD)jbig2.dev $(PSD)jpx.dev
+ #FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev
+ # The following is strictly for testing.
+ FEATURE_DEVS_ALL=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)rasterop.dev $(PSD)double.dev $(PSD)trapping.dev $(PSD)stocht.dev $(GLD)pipe.dev
+@@ -389,7 +400,7 @@
+ DEVICE_DEVS21=$(DD)spotcmyk.dev $(DD)devicen.dev $(DD)xcf.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16m.dev $(DD)bmp32b.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev $(DD)pamcmyk32.dev
+
+ # Shared library target to build.
+-GS_SHARED_OBJS=$(GLOBJDIR)/X11.so $(GLOBJDIR)/lvga256.so $(GLOBJDIR)/vgalib.so
++#GS_SHARED_OBJS=$(GLOBJDIR)/X11.so $(GLOBJDIR)/lvga256.so $(GLOBJDIR)/vgalib.so
+ #GS_SHARED_OBJS=$(GLOBJDIR)/X11.so
+
+ # ---------------------------- End of options --------------------------- #
+@@ -429,6 +440,9 @@
+ include $(GLSRCDIR)/zlib.mak
+ include $(GLSRCDIR)/libpng.mak
+ include $(GLSRCDIR)/jbig2.mak
++include $(GLSRCDIR)/jasper.mak
++include $(GLSRCDIR)/ldf_jb2.mak
++include $(GLSRCDIR)/lwf_jp2.mak
+ include $(GLSRCDIR)/icclib.mak
+ include $(GLSRCDIR)/ijs.mak
+ include $(GLSRCDIR)/devs.mak
+@@ -438,6 +452,7 @@
+ include $(GLSRCDIR)/unix-dll.mak
+ include $(GLSRCDIR)/unix-end.mak
+ include $(GLSRCDIR)/unixinst.mak
++include $(CONTRIBDIR)/contrib.mak
+
+ # This has to come last so it won't be taken as the default target.
+ $(AK):
diff --git a/print/ghostscript8-x11/files/patch-base-unixinst.mak b/print/ghostscript8-x11/files/patch-base-unixinst.mak
new file mode 100644
index 000000000000..4f6006f3a9a8
--- /dev/null
+++ b/print/ghostscript8-x11/files/patch-base-unixinst.mak
@@ -0,0 +1,20 @@
+--- base/unixinst.mak.orig 2009-11-19 09:09:15.000000000 +0900
++++ base/unixinst.mak 2014-11-23 17:40:46.000000000 +0900
+@@ -44,7 +44,7 @@
+ wftopfa fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh ;\
+ do if ( test -f $(PSLIBDIR)/$$f ); then \
+ (cat $(PSLIBDIR)/$$f | sed -e "s/GS_EXECUTABLE=gs/GS_EXECUTABLE=$(GS)/" > $(PSOBJDIR)/$$f); \
+- $(INSTALL_PROGRAM) $(PSOBJDIR)/$$f $(DESTDIR)$(scriptdir)/$$f; \
++ $(INSTALL_SCRIPT) $(PSOBJDIR)/$$f $(DESTDIR)$(scriptdir)/$$f; \
+ fi;\
+ done'
+
+@@ -128,7 +128,7 @@
+ done'
+
+ # install the man pages for each locale
+-MAN_LCDIRS=. de
++MAN_LCDIRS=.
+ MAN1_LINKS_PS2PS=eps2eps
+ MAN1_LINKS_PS2PDF=ps2pdf12 ps2pdf13
+ MAN1_LINKS_GSLP=gsbj gsdj gsdj500 gslj
diff --git a/print/ghostscript8-x11/pkg-descr b/print/ghostscript8-x11/pkg-descr
new file mode 100644
index 000000000000..716d1ee60082
--- /dev/null
+++ b/print/ghostscript8-x11/pkg-descr
@@ -0,0 +1,8 @@
+This package installs X11 support library which adds the following
+devices to the installed Ghostscript:
+
+ x11, x11alpha, x11cmyk, x11cmyk2, x11cmyk4, x11cmyk8, x11gray2,
+ x11gray4, and x11mono.
+
+WWW: http://www.cs.wisc.edu/~ghost/doc/GPL/index.htm
+ http://www.ghostscript.com/