Author: cillian
Date: Wed Feb 16 23:34:19 2011
New Revision: 26003
URL: https://svn.nixos.org/websvn/nix/?rev=26003&sc=1

Log:
Applying a patch for pstoraster, without this the cups test page was printing 
solid black, as described in the bug report: 
http://bugs.ghostscript.com/show_bug.cgi?id=691108 The patch was kindly taken 
from https://bugs.archlinux.org/task/18339

Added:
   nixpkgs/trunk/pkgs/misc/ghostscript/pstoraster.patch
Modified:
   nixpkgs/trunk/pkgs/misc/ghostscript/default.nix

Modified: nixpkgs/trunk/pkgs/misc/ghostscript/default.nix
==============================================================================
--- nixpkgs/trunk/pkgs/misc/ghostscript/default.nix     Wed Feb 16 22:50:06 
2011        (r26002)
+++ nixpkgs/trunk/pkgs/misc/ghostscript/default.nix     Wed Feb 16 23:34:19 
2011        (r26003)
@@ -37,7 +37,7 @@
 
   CFLAGS = "-fPIC";
 
-  patches = [ ./purity.patch ./urw-font-files.patch ];
+  patches = [ ./purity.patch ./urw-font-files.patch ./pstoraster.patch];
 
   doCheck = true;
 

Added: nixpkgs/trunk/pkgs/misc/ghostscript/pstoraster.patch
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/misc/ghostscript/pstoraster.patch        Wed Feb 16 
23:34:19 2011        (r26003)
@@ -0,0 +1,81 @@
+Upstream issue: http://bugs.ghostscript.com/show_bug.cgi?id=691108
+e.g. printing a test page prints only black
+
+Patch: https://bugs.archlinux.org/task/18339
+
+--- a/cups/gdevcups.c
++++ b/cups/gdevcups.c
+@@ -975,7 +975,8 @@ cups_map_cmyk(gx_device *pdev,             /* I - Device 
info */
+             frac      k,              /* I - Black value */
+             frac      *out)           /* O - Device colors */
+ {
+-  int c0, c1, c2, c3;                 /* Temporary color values */
++  int c0 = 0, c1 = 0,
++        c2 = 0, c3 = 0;                       /* Temporary color values */
+   float       rr, rg, rb,                     /* Real RGB colors */
+       ciex, ciey, ciez,               /* CIE XYZ colors */
+       ciey_yn,                        /* Normalized luminance */
+@@ -2703,9 +2704,13 @@ cups_put_params(gx_device     *pdev,    /* I - Device 
info */
+   int                 color_set;      /* Were the color attrs set? */
+   gdev_prn_space_params       sp;             /* Space parameter data */
+   int                 width,          /* New width of page */
+-                        height;               /* New height of page */
++                        height,               /* New height of page */
++                        colorspace,     /* New color space */
++                        bitspercolor;   /* New bits per color */
+   static int            width_old = 0,  /* Previous width */
+-                        height_old = 0; /* Previous height */
++                        height_old = 0, /* Previous height */
++                        colorspace_old = 0,/* Previous color space */
++                        bitspercolor_old = 0;/* Previous bits per color */
+   ppd_attr_t            *backside = NULL,
+                         *backsiderequiresflippedmargins = NULL;
+   float                 swap;
+@@ -2800,9 +2805,10 @@ cups_put_params(gx_device     *pdev,    /* I - Device 
info */
+   else if (code == 0) \
+   { \
+     dprintf1("DEBUG: Setting %s to", sname); \
+-    for (i = 0; i < count; i ++) \
+-      dprintf1(" %d", (unsigned)(arrayval.data[i]));   \
+-      cups->header.name[i] = (unsigned)arrayval.data[i]; \
++    for (i = 0; i < count; i ++) { \
++      dprintf1(" %d", (unsigned)(arrayval.data[i])); \
++      cups->header.name[i] = (unsigned)(arrayval.data[i]); \
++    } \
+     dprintf("...\n"); \
+   }
+ 
+@@ -3243,23 +3249,31 @@ cups_put_params(gx_device     *pdev,   /* I - Device 
info */
+     }
+ #endif /* CUPS_RASTER_SYNCv1 */
+ 
++    colorspace = cups->header.cupsColorSpace;
++    bitspercolor = cups->header.cupsBitsPerColor;
++
+    /*
+     * Don't reallocate memory unless the device has been opened...
+     * Also reallocate only if the size has actually changed...
+     */
+ 
+-    if (pdev->is_open && (width != width_old || height != height_old))
++    if (pdev->is_open &&
++      (width != width_old || height != height_old ||
++       colorspace != colorspace_old || bitspercolor != bitspercolor_old))
+     {
+ 
+       width_old = width;
+       height_old = height;
++      colorspace_old = colorspace;
++      bitspercolor_old = bitspercolor;
+ 
+      /*
+       * Device is open and size has changed, so reallocate...
+       */
+ 
+-      dprintf4("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n",
+-             pdev->MediaSize[0], pdev->MediaSize[1], width, height);
++      dprintf6("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels, 
color space: %d, bits per color: %d...\n",
++             pdev->MediaSize[0], pdev->MediaSize[1], width, height,
++             colorspace, bitspercolor);
+ 
+       sp = ((gx_device_printer *)pdev)->space_params;
\ No newline at end of file
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to