[arch-commits] Commit in ghostscript/trunk (2 files)

andyrtr at archlinux.org andyrtr at archlinux.org
Sat Jan 22 16:37:54 EST 2011


    Date: Saturday, January 22, 2011 @ 16:37:53
  Author: andyrtr
Revision: 107260

upgpkg: ghostscript 9.00-3
add a patch from upstream tracker to solve part of FS#21388

Added:
  ghostscript/trunk/ghostscript-gdevcups-691733.patch
Modified:
  ghostscript/trunk/PKGBUILD

-----------------------------------+
 PKGBUILD                          |   11 ++-
 ghostscript-gdevcups-691733.patch |  107 ++++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-01-22 20:59:50 UTC (rev 107259)
+++ PKGBUILD	2011-01-22 21:37:53 UTC (rev 107260)
@@ -3,7 +3,7 @@
 
 pkgname=ghostscript
 pkgver=9.00
-pkgrel=2
+pkgrel=3
 pkgdesc="An interpreter for the PostScript language"
 arch=('i686' 'x86_64')
 license=('GPL3' 'custom')
@@ -15,12 +15,14 @@
 source=(http://ghostscript.com/releases/ghostscript-${pkgver}.tar.xz
 	ghostscript-fPIC.patch
 	ghostscript-system-jasper.patch
-	svn_rev11948.diff)
+	svn_rev11948.diff
+	ghostscript-gdevcups-691733.patch)
 options=('!libtool' '!makeflags')
 md5sums=('1ca5f245677f78f573e6490bdb40702f'
          '766d44c47c693f96941b658e360c1277'
          '03e27cd02471ab3b642c344fa06b623e'
-         '78f2b9c2d6a5a60891b2d8b593a15b00')
+         '78f2b9c2d6a5a60891b2d8b593a15b00'
+         'e459d4cf897bdb54fefbba9d57bd2fa2')
 
 build() {
   cd ${srcdir}/ghostscript-${pkgver}
@@ -36,6 +38,9 @@
 
   # part of https://bugs.archlinux.org/task/22006 - http://bugs.ghostscript.com/show_bug.cgi?id=691831
   patch -Np2 -i ${srcdir}/svn_rev11948.diff
+  # upstream fix for http://bugs.ghostscript.com/show_bug.cgi?id=691733 / part of https://bugs.archlinux.org/task/21388
+  # patch taken from Fedora RawHide master
+  patch -Np1 -i ${srcdir}/ghostscript-gdevcups-691733.patch
   
   ./autogen.sh
   ./configure --prefix=/usr \

Added: ghostscript-gdevcups-691733.patch
===================================================================
--- ghostscript-gdevcups-691733.patch	                        (rev 0)
+++ ghostscript-gdevcups-691733.patch	2011-01-22 21:37:53 UTC (rev 107260)
@@ -0,0 +1,107 @@
+diff -up ghostscript-9.00/cups/gdevcups.c.gdevcups-691733 ghostscript-9.00/cups/gdevcups.c
+--- ghostscript-9.00/cups/gdevcups.c.gdevcups-691733	2011-01-10 16:48:57.381703112 +0000
++++ ghostscript-9.00/cups/gdevcups.c	2011-01-10 16:52:02.021813786 +0000
+@@ -2898,11 +2898,12 @@ cups_put_params(gx_device     *pdev,	/* 
+   int			margins_set;	/* Were the margins set? */
+   int			size_set;	/* Was the size set? */
+   int			color_set;	/* Were the color attrs set? */
+-  gdev_prn_space_params	sp;		/* Space parameter data */
++  gdev_prn_space_params	sp_old;	        /* Space parameter data */
+   int			width,		/* New width of page */
+                         height,		/* New height of page */
+                         width_old = 0,  /* Previous width of page */
+                         height_old = 0; /* Previous height of page */
++  bool                  transp_old = 0; /* Previous transparency usage state */
+   ppd_attr_t            *backside = NULL,
+                         *backsiderequiresflippedmargins = NULL;
+   float                 swap;
+@@ -2996,11 +2997,23 @@ cups_put_params(gx_device     *pdev,	/* 
+     } \
+   }
+ 
++  sp_old = ((gx_device_printer *)pdev)->space_params;
++  width_old = pdev->width;
++  height_old = pdev->height;
++  transp_old = cups->page_uses_transparency;
+   size_set    = param_read_float_array(plist, ".MediaSize", &arrayval) == 0 ||
+                 param_read_float_array(plist, "PageSize", &arrayval) == 0;
+   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;
++  /* 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
++     time being until we decide finally */
++  if (color_set) {
++    width_old = 1;
++    height_old = 1;
++  }
+   /* We also recompute page size and margins if we simply get onto a new
+      page without necessarily having a page size change in the PostScript
+      code, as for some printers margins have to be flipped on the back sides of
+@@ -3081,9 +3094,9 @@ cups_put_params(gx_device     *pdev,	/* 
+   stringoption(cupsPageSizeName, "cupsPageSizeName");
+ #endif /* CUPS_RASTER_SYNCv1 */
+ 
+-  if ((code = param_read_string(plist, "cups->Profile", &stringval)) < 0)
++  if ((code = param_read_string(plist, "cupsProfile", &stringval)) < 0)
+   {
+-    param_signal_error(plist, "cups->Profile", code);
++    param_signal_error(plist, "cupsProfile", code);
+     return (code);
+   }
+   else if (code == 0)
+@@ -3096,7 +3109,7 @@ cups_put_params(gx_device     *pdev,	/* 
+ 
+   cups_set_color_info(pdev);
+ 
+- /*
++  /*
+   * Then process standard page device options...
+   */
+ 
+@@ -3404,17 +3417,6 @@ cups_put_params(gx_device     *pdev,	/* 
+     * does not keep track of the margins in the bitmap size...
+     */
+ 
+-    /* 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 preven crashes like in bug 690435. We keep it for the
+-       time being until we decide finally */
+-    if (color_set) {
+-      width_old = -1;
+-      height_old = -1;
+-    } else {
+-      width_old = pdev->width;
+-      height_old = pdev->height;
+-    }
+     if (cups->landscape)
+     {
+       width  = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3]) *
+@@ -3457,11 +3459,10 @@ cups_put_params(gx_device     *pdev,	/* 
+ 	       pdev->MediaSize[0], pdev->MediaSize[1], width, height);
+ #endif /* DEBUG */
+ 
+-      sp = ((gx_device_printer *)pdev)->space_params;
+-
+-      if ((code = gdev_prn_maybe_realloc_memory((gx_device_printer *)pdev, &sp, 
++      if ((code = gdev_prn_maybe_realloc_memory((gx_device_printer *)pdev,
++                                                &sp_old, 
+ 						width_old, height_old,
+-						cups->page_uses_transparency))
++						transp_old))
+ 	  < 0)
+ 	return (code);
+ #ifdef DEBUG
+@@ -3642,6 +3643,10 @@ cups_set_color_info(gx_device *pdev)	/* 
+         cups->header.cupsBitsPerPixel   = cups->header.cupsBitsPerColor;
+         cups->color_info.depth          = cups->header.cupsBitsPerPixel;
+         cups->color_info.num_components = 1;
++        cups->color_info.dither_grays = 1L << cups->header.cupsBitsPerColor;
++        cups->color_info.dither_colors = 1L << cups->header.cupsBitsPerColor;
++        cups->color_info.max_gray = cups->color_info.dither_grays - 1;
++        cups->color_info.max_color = cups->color_info.dither_grays - 1;
+         break;
+ 
+     case CUPS_CSPACE_CMY :
+



More information about the arch-commits mailing list