summaryrefslogtreecommitdiff
path: root/libre/ghostscript-libre
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-11-10 15:40:13 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-11-10 15:40:13 -0300
commit670af4204ef3b1963ef9529cd420dfeb4d66cd84 (patch)
treef8c093cf4040e38a91395ef841572fcf3ac53ed8 /libre/ghostscript-libre
parent8c6397096a684881fb3e15f3685f06861d0b685d (diff)
downloadabslibre-670af4204ef3b1963ef9529cd420dfeb4d66cd84.tar.gz
abslibre-670af4204ef3b1963ef9529cd420dfeb4d66cd84.tar.bz2
abslibre-670af4204ef3b1963ef9529cd420dfeb4d66cd84.zip
libre/ghostscript-libre-9.04-5
Diffstat (limited to 'libre/ghostscript-libre')
-rw-r--r--libre/ghostscript-libre/PKGBUILD25
-rw-r--r--libre/ghostscript-libre/SRCBUILD31
-rw-r--r--libre/ghostscript-libre/ghostscript-cups-rgbw.patch264
3 files changed, 311 insertions, 9 deletions
diff --git a/libre/ghostscript-libre/PKGBUILD b/libre/ghostscript-libre/PKGBUILD
index fb41750cf..eda488048 100644
--- a/libre/ghostscript-libre/PKGBUILD
+++ b/libre/ghostscript-libre/PKGBUILD
@@ -3,12 +3,12 @@
# Maintainer (Parabola): xihh
pkgname=ghostscript-libre
-pkgver=9.02
-pkgrel=2
+pkgver=9.04
+pkgrel=5
pkgdesc="An interpreter for the PostScript language without non-free files"
arch=('i686' 'x86_64')
license=('GPL3') #non free files removed
-depends=('libxt' 'libcups' 'fontconfig' 'jasper' 'zlib' 'libpng' 'libjpeg' 'libtiff')
+depends=('libxt' 'libcups' 'fontconfig' 'jasper' 'zlib' 'libpng' 'libjpeg' 'libtiff' 'lcms') # 'lcms2' won't get used) # move in libpaper from community?
makedepends=('gtk2' 'gnutls')
optdepends=('texlive-core: needed for dvipdf'
'gtk2: needed for gsx')
@@ -16,17 +16,18 @@ conflicts=('ghostscript')
replaces=('ghostscript-lrpng' 'ghostscript')
provides=('ghostscript-lprng' "ghostscript=$pkgver")
url="http://www.ghostscript.com/"
-source=(http://downloads.ghostscript.com/public/ghostscript-${pkgver}.tar.bz2)
+source=(https://repo.parabolagnulinux.org/other/${pkgname}-${pkgver}-${pkgrel}-any.src.tar.xz
+ ghostscript-cups-rgbw.patch)
options=('!libtool' '!makeflags')
-md5sums=('f67151444bd56a7904579fc75a083dd6')
build() {
cd ${srcdir}/ghostscript-${pkgver}
+
+ # fix broken color printing https://bugs.archlinux.org/task/25519
+ patch -Np1 -i ${srcdir}/ghostscript-cups-rgbw.patch
# force it to use system-libs
- rm -rf jpeg libpng zlib jasper expat tiff
- # delete non-free packages
- grep -l "are not altered" Resource/CMap/* | xargs rm -fv
+ rm -rf jpeg libpng zlib jasper expat tiff freetype lcms
./configure --prefix=/usr \
--enable-dynamic \
@@ -36,7 +37,11 @@ build() {
--with-x \
--with-drivers=ALL\
--with-fontpath=/usr/share/fonts/Type1:/usr/share/fonts \
- --disable-compile-inits # needed for linking with system-zlib
+ --with-install-cups \
+ --enable-fontconfig \
+ --enable-freetype \
+ --without-luratech \
+ --disable-compile-inits #--help # needed for linking with system-zlib
make
# Build IJS
@@ -65,3 +70,5 @@ package() {
cd ${srcdir}/ghostscript-${pkgver}/ijs
make DESTDIR=${pkgdir} install
}
+md5sums=('ac8f77c94a6b5d5f0170c2e6db38c6bb'
+ 'fd89baafac6589dc93ba71a48c2ba9b4')
diff --git a/libre/ghostscript-libre/SRCBUILD b/libre/ghostscript-libre/SRCBUILD
new file mode 100644
index 000000000..d7cac0a76
--- /dev/null
+++ b/libre/ghostscript-libre/SRCBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 123066 2011-05-07 23:01:49Z stephane $
+# Maintainer: AndyRTR <andyrtr@archlinux.org>
+# Maintainer (Parabola): xihh
+
+pkgname=ghostscript-libre
+pkgver=9.04
+pkgrel=5
+pkgdesc="An interpreter for the PostScript language without non-free files"
+arch=('any')
+license=('GPL3') #non free files removed
+url="http://www.ghostscript.com/"
+source=(http://downloads.ghostscript.com/public/ghostscript-${pkgver}.tar.bz2)
+md5sums=('9f6899e821ab6d78ab2c856f10fa3023')
+options=(!strip !docs !libtool !emptydirs !zipman !purge)
+
+build() {
+ cd ${srcdir}/ghostscript-${pkgver}
+
+ export PKGEXT=.src.tar.xz
+
+ # delete non-free packages
+ grep -l "are not altered" Resource/CMap/* | xargs rm -fv
+}
+
+package() {
+ cd ${srcdir}
+ export PKGEXT=.src.tar.xz
+
+ mv ghostscript-${pkgver} ${pkgdir}/
+
+}
diff --git a/libre/ghostscript-libre/ghostscript-cups-rgbw.patch b/libre/ghostscript-libre/ghostscript-cups-rgbw.patch
new file mode 100644
index 000000000..00f99c844
--- /dev/null
+++ b/libre/ghostscript-libre/ghostscript-cups-rgbw.patch
@@ -0,0 +1,264 @@
+diff -up ghostscript-9.04/cups/gdevcups.c.cups-rgbw ghostscript-9.04/cups/gdevcups.c
+--- ghostscript-9.04/cups/gdevcups.c.cups-rgbw 2011-08-05 12:12:21.000000000 +0100
++++ ghostscript-9.04/cups/gdevcups.c 2011-08-22 10:54:24.614010581 +0100
+@@ -225,6 +225,7 @@ typedef struct gx_device_cups_s
+ unsigned short EncodeLUT[gx_max_color_value + 1];/* RGB value to output color LUT */
+ int Density[CUPS_MAX_VALUE + 1];/* Density LUT */
+ int Matrix[3][3][CUPS_MAX_VALUE + 1];/* Color transform matrix LUT */
++ int user_icc;
+ int cupsRasterVersion;
+
+ /* Used by cups_put_params(): */
+@@ -426,6 +427,7 @@ gx_device_cups gs_cups_device =
+ {0x00}, /* EncodeLUT */
+ {0x00}, /* Density */
+ {0x00}, /* Matrix */
++ 0,
+ 3 /* cupsRasterVersion */
+ };
+
+@@ -1182,15 +1184,18 @@ cups_map_cmyk(gx_device *pdev, /* I - D
+
+ case CUPS_CSPACE_RGB :
+ case CUPS_CSPACE_RGBW :
++ c0 = c + k;
++ c1 = m + k;
++ c2 = y + k;
+ if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW) {
+- c0 = c;
+- c1 = m;
+- c2 = y;
+- c3 = k;
+- } else {
+- c0 = c + k;
+- c1 = m + k;
+- c2 = y + k;
++ if ((k >= frac_1 - 1) ||
++ ((c0 >= frac_1) && (c1 >= frac_1) && (c2 >= frac_1))) {
++ c0 = frac_1;
++ c1 = frac_1;
++ c2 = frac_1;
++ c3 = frac_1;
++ } else
++ c3 = 0;
+ }
+
+ if (c0 < 0)
+@@ -1212,11 +1217,12 @@ cups_map_cmyk(gx_device *pdev, /* I - D
+ out[2] = frac_1 - (frac)cups->Density[c2];
+
+ if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW) {
+- if (c3 < 0)
+- c3 = 0;
+- else if (c3 > frac_1)
+- c3 = frac_1;
+- out[3] = frac_1 - (frac)cups->Density[c3];
++ if (c3 == 0)
++ out[3] = frac_1;
++ else if (c3 == frac_1)
++ out[3] = 0;
++ else
++ out[3] = frac_1;
+ }
+ break;
+
+@@ -2034,10 +2040,15 @@ cups_map_color_rgb(gx_device *pdev,
+ * cups->DecodeLUT actually maps to RGBW, not CMYK...
+ */
+
+- k = cups->DecodeLUT[c3];
+- c = cups->DecodeLUT[c0] + k - gx_max_color_value;
+- m = cups->DecodeLUT[c1] + k - gx_max_color_value;
+- y = cups->DecodeLUT[c2] + k - gx_max_color_value;
++ if (c3 == 0) {
++ c = 0;
++ m = 0;
++ y = 0;
++ } else {
++ c = cups->DecodeLUT[c0];
++ m = cups->DecodeLUT[c1];
++ y = cups->DecodeLUT[c2];
++ }
+
+ if (c > gx_max_color_value)
+ prgb[0] = gx_max_color_value;
+@@ -2282,20 +2293,20 @@ cups_map_rgb_color(gx_device *pdev,
+ switch (cups->header.cupsBitsPerColor)
+ {
+ default :
+- i = 0x0e;
++ i = 0x00;
+ break;
+ case 2 :
+- i = 0xfc;
++ i = 0x00;
+ break;
+ case 4 :
+- i = 0xfff0;
++ i = 0x0000;
+ break;
+ case 8 :
+- i = 0xffffff00;
++ i = 0x00000000;
+ break;
+ #ifdef GX_COLOR_INDEX_TYPE
+ case 16 :
+- i = 0xffffffffffff0000;
++ i = 0x0000000000000000;
+ break;
+ #endif /* GX_COLOR_INDEX_TYPE */
+ }
+@@ -2929,7 +2940,10 @@ cups_put_params(gx_device *pdev, /*
+ int xflip = 0,
+ yflip = 0;
+ int found = 0;
+-
++ gs_param_string icc_pro_dummy;
++ int old_cmps = cups->color_info.num_components;
++ int old_depth = cups->color_info.depth;
++
+ #ifdef DEBUG
+ dprintf2("DEBUG2: cups_put_params(%p, %p)\n", pdev, plist);
+ #endif /* DEBUG */
+@@ -3024,6 +3038,11 @@ cups_put_params(gx_device *pdev, /*
+ margins_set = param_read_float_array(plist, "Margins", &arrayval) == 0;
+ color_set = param_read_int(plist, "cupsColorSpace", &intval) == 0 ||
+ param_read_int(plist, "cupsBitsPerColor", &intval) == 0;
++
++ if (!cups->user_icc) {
++ cups->user_icc = param_read_string(plist, "OutputICCProfile", &icc_pro_dummy) == 0;
++ }
++
+ /* We set the old dimensions to 1 if we have a color depth change, so
+ that memory reallocation gets forced. This is perhaps not the correct
+ approach to prevent crashes like in bug 690435. We keep it for the
+@@ -3134,12 +3153,20 @@ cups_put_params(gx_device *pdev, /*
+ if ((code = gdev_prn_put_params(pdev, plist)) < 0)
+ return (code);
+
++ /* If cups_set_color_info() changed the color model of the device we want to
++ * force the raster memory to be recreated/reinitialized
++ */
++ if (cups->color_info.num_components != old_cmps || cups->color_info.depth != old_depth) {
++ width_old = 0;
++ height_old = 0;
++ }
++ else {
+ /* pdev->width/height may have been changed by the call to
+ * gdev_prn_put_params()
+ */
+- width_old = pdev->width;
+- height_old = pdev->height;
+-
++ width_old = pdev->width;
++ height_old = pdev->height;
++ }
+ /*
+ * Update margins/sizes as needed...
+ */
+@@ -4044,22 +4071,88 @@ cups_set_color_info(gx_device *pdev) /*
+ for (k = 0; k <= CUPS_MAX_VALUE; k ++)
+ cups->Density[k] = k;
+ }
+- /* Set up the ICC profile for ghostscript to use based upon the color space.
+- This is different than the PPD profile above which appears to be some sort
+- of matrix based TRC profile */
+- switch (cups->header.cupsColorSpace) {
+- /* Use RGB profile for this */
+- case CUPS_CSPACE_RGBW:
+- if (pdev->icc_struct == NULL) {
+- pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
+- }
+- if (pdev->icc_struct->device_profile[gsDEFAULTPROFILE] == NULL) {
+- code = gsicc_set_device_profile(pdev, pdev->memory,
+- DEFAULT_RGB_ICC, gsDEFAULTPROFILE);
+- }
+- break;
+- default:
+- break;
++ if (!cups->user_icc) {
++ /* Set up the ICC profile for ghostscript to use based upon the color space.
++ This is different than the PPD profile above which appears to be some sort
++ of matrix based TRC profile */
++ switch (cups->header.cupsColorSpace)
++ {
++ default :
++ case CUPS_CSPACE_RGBW :
++ case CUPS_CSPACE_RGB :
++ case CUPS_CSPACE_RGBA :
++ case CUPS_CSPACE_CMY :
++ case CUPS_CSPACE_YMC :
++# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
++ case CUPS_CSPACE_CIELab :
++ case CUPS_CSPACE_ICC1 :
++ case CUPS_CSPACE_ICC2 :
++ case CUPS_CSPACE_ICC3 :
++ case CUPS_CSPACE_ICC4 :
++ case CUPS_CSPACE_ICC5 :
++ case CUPS_CSPACE_ICC6 :
++ case CUPS_CSPACE_ICC7 :
++ case CUPS_CSPACE_ICC8 :
++ case CUPS_CSPACE_ICC9 :
++ case CUPS_CSPACE_ICCA :
++ case CUPS_CSPACE_ICCB :
++ case CUPS_CSPACE_ICCC :
++ case CUPS_CSPACE_ICCD :
++ case CUPS_CSPACE_ICCE :
++ case CUPS_CSPACE_ICCF :
++# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
++ if (!pdev->icc_struct || (pdev->icc_struct &&
++ pdev->icc_struct->device_profile[gsDEFAULTPROFILE]->data_cs != gsRGB)) {
++
++ if (pdev->icc_struct) {
++ rc_decrement(pdev->icc_struct, "cups_set_color_info");
++ }
++ pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
++
++ code = gsicc_set_device_profile(pdev, pdev->memory,
++ (char *)DEFAULT_RGB_ICC, gsDEFAULTPROFILE);
++ }
++ break;
++
++ case CUPS_CSPACE_W :
++ case CUPS_CSPACE_WHITE :
++ case CUPS_CSPACE_K :
++ case CUPS_CSPACE_GOLD :
++ case CUPS_CSPACE_SILVER :
++ if (!pdev->icc_struct || (pdev->icc_struct &&
++ pdev->icc_struct->device_profile[gsDEFAULTPROFILE]->data_cs != gsGRAY)) {
++
++ if (pdev->icc_struct) {
++ rc_decrement(pdev->icc_struct, "cups_set_color_info");
++ }
++ pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
++
++ code = gsicc_set_device_profile(pdev, pdev->memory->non_gc_memory,
++ (char *)DEFAULT_GRAY_ICC, gsDEFAULTPROFILE);
++ }
++ break;
++ case CUPS_CSPACE_KCMYcm :
++# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
++ case CUPS_CSPACE_CIEXYZ :
++#endif
++ case CUPS_CSPACE_CMYK :
++ case CUPS_CSPACE_YMCK :
++ case CUPS_CSPACE_KCMY :
++ case CUPS_CSPACE_GMCK :
++ case CUPS_CSPACE_GMCS :
++ if (!pdev->icc_struct || (pdev->icc_struct &&
++ pdev->icc_struct->device_profile[gsDEFAULTPROFILE]->data_cs != gsCMYK)) {
++
++ if (pdev->icc_struct) {
++ rc_decrement(pdev->icc_struct, "cups_set_color_info");
++ }
++ pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
++
++ code = gsicc_set_device_profile(pdev, pdev->memory,
++ (char *)DEFAULT_CMYK_ICC, gsDEFAULTPROFILE);
++ }
++ break;
++ }
+ }
+ }
+
+