Gentoo Archives: gentoo-commits

From: "Timo Gurr (tgurr)" <tgurr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/ghostscript-gpl/files: ghostscript-8.60-scripts.patch ghostscript-8.60-multilib.patch djvu-gs-gpl-8.60.patch digest-ghostscript-gpl-8.60 ghostscript-8.60-ijs-krgb.patch ghostscript-8.60-fPIC.patch ghostscript-8.60-noopt.patch
Date: Wed, 17 Oct 2007 22:11:24
Message-Id: E1IiGwX-0002eB-Ud@stork.gentoo.org
1 tgurr 07/10/17 22:00:45
2
3 Added: ghostscript-8.60-scripts.patch
4 ghostscript-8.60-multilib.patch
5 djvu-gs-gpl-8.60.patch digest-ghostscript-gpl-8.60
6 ghostscript-8.60-ijs-krgb.patch
7 ghostscript-8.60-fPIC.patch
8 ghostscript-8.60-noopt.patch
9 Log:
10 Add ghostscript-gpl-8.60, first release with ghostscript-esp merged. Fixes bug #187502.
11 (Portage version: 2.1.3.14)
12
13 Revision Changes Path
14 1.1 app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch
15
16 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch?rev=1.1&view=markup
17 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch?rev=1.1&content-type=text/plain
18
19 Index: ghostscript-8.60-scripts.patch
20 ===================================================================
21 --- ghostscript-8.60-r8112/lib/pv.sh.scripts 2007-07-05 11:41:52.000000000 +0100
22 +++ ghostscript-8.60-r8112/lib/pv.sh 2007-07-10 16:08:47.000000000 +0100
23 @@ -31,7 +31,7 @@
24 GS_EXECUTABLE=gs
25
26 TEMPDIR=.
27 -PAGE=$1
28 +PAGE="$1"
29 shift
30 FILE="$1"
31 shift
32 @@ -44,7 +44,7 @@
33 tmpfile="$TEMPDIR/$FILE.$$.pv"
34 fi
35 trap "rm -rf $tmpfile" 0 1 2 15
36 -#dvips -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
37 -dvips -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
38 +#dvips -R -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
39 +dvips -R -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
40 $GS_EXECUTABLE $tmpfile
41 exit 0
42 --- ghostscript-8.60-r8112/lib/dvipdf.scripts 2007-07-10 16:08:57.000000000 +0100
43 +++ ghostscript-8.60-r8112/lib/dvipdf 2007-07-10 16:09:17.000000000 +0100
44 @@ -44,4 +44,4 @@
45
46 # We have to include the options twice because -I only takes effect if it
47 # appears before other options.
48 -exec dvips $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
49 +exec dvips -R $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
50
51
52
53 1.1 app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch
54
55 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch?rev=1.1&view=markup
56 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch?rev=1.1&content-type=text/plain
57
58 Index: ghostscript-8.60-multilib.patch
59 ===================================================================
60 --- ghostscript-8.60-r8112/ijs/ijs-config.in.multilib 2002-01-31 19:09:46.000000000 +0000
61 +++ ghostscript-8.60-r8112/ijs/ijs-config.in 2007-07-10 17:46:44.000000000 +0100
62 @@ -43,8 +43,7 @@
63 echo $includes
64 ;;
65 --libs)
66 - libdirs=-L@libdir@
67 - echo $libdirs -lijs
68 + echo -lijs
69 ;;
70 *)
71 echo "${usage}" 1>&2
72 --- ghostscript-8.60-r8112/ijs/Makefile.am.multilib 2007-07-10 18:00:36.000000000 +0100
73 +++ ghostscript-8.60-r8112/ijs/Makefile.am 2007-07-10 18:00:39.000000000 +0100
74 @@ -34,7 +34,7 @@
75
76 pkgincludedir=$(includedir)/ijs
77 m4datadir = $(datadir)/aclocal
78 -pkgconfigdatadir = $(prefix)/lib/pkgconfig
79 +pkgconfigdatadir = $(libdir)/pkgconfig
80
81 lib_LTLIBRARIES = libijs.la
82
83
84
85
86
87
88 1.1 app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch
89
90 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch?rev=1.1&view=markup
91 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch?rev=1.1&content-type=text/plain
92
93 Index: djvu-gs-gpl-8.60.patch
94 ===================================================================
95 diff -ur ghostscript-8.60-gpl.orig/gsdjvu ghostscript-8.60-gpl/gsdjvu
96 --- ghostscript-8.54-gpl.orig/gsdjvu 2006-12-14 19:14:43.000000000 +0100
97 +++ ghostscript-8.54-gpl/gsdjvu 2006-12-14 19:23:16.000000000 +0100
98 @@ -56,4 +56,4 @@
99 # Step 2 -- execute ghostscript
100
101 gsdir="$progdir"
102 -GS_LIB="$gsdir/lib:$gsdir/fonts:$gsdir" exec "$gsdir/bin/gs" "$@"
103 +GS_LIB="$gsdir/lib:$gsdir/fonts:$gsdir" exec "/usr/bin/gs" "$@"
104 diff -ur ghostscript-8.60-gpl.orig/src/gdevdjvu.c ghostscript-8.60-gpl/src/gdevdjvu.c
105 --- ghostscript-8.60-gpl.orig/src/gdevdjvu.c 2007-05-14 06:01:45.000000000 +0200
106 +++ ghostscript-8.60-gpl/src/gdevdjvu.c 2007-08-03 10:18:25.353066136 +0200
107 @@ -155,8 +155,8 @@
108 private void
109 lbassertfail(const char *file, int line)
110 {
111 - fprintf(STDERR,"Internal error at %s:%d\n", file, line);
112 - fclose(STDERR);
113 + //fprintf(STDERR,"Internal error at %s:%d\n", file, line);
114 + //fclose(STDERR);
115 abort();
116 }
117
118 @@ -4940,12 +4942,6 @@
119 0, cdev->width-1, 0, cdev->height-1, comment);
120 if (code < 0) return code;
121 }
122 - /* Print message */
123 - if (! cdev->quiet) {
124 - fprintf(STDOUT, "Page %dx%d (%s )\n",
125 - cdev->width, cdev->height, comment);
126 - fflush(STDOUT);
127 - }
128 /* Terminate */
129 runmap_free(fgmap);
130 #ifdef DEBUG
131 @@ -5342,12 +5338,6 @@
132 if (code < 0)
133 return code;
134 }
135 - /* Print message */
136 - if (! cdev->quiet) {
137 - fprintf(STDOUT,"Page %dx%d (%s )\n",
138 - cdev->width, cdev->height, comment);
139 - fflush(STDOUT);
140 - }
141 /* Terminate */
142 runmap_free(fgmap);
143 #ifdef DEBUG
144
145
146
147 1.1 app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.60
148
149 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.60?rev=1.1&view=markup
150 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.60?rev=1.1&content-type=text/plain
151
152 Index: digest-ghostscript-gpl-8.60
153 ===================================================================
154 MD5 2fbae60417d42779f6488ab897dcaaf6 acro5-cmaps-2001.tar.gz 631653
155 RMD160 c723afc2207157a434988b46bcf0a458281c29a4 acro5-cmaps-2001.tar.gz 631653
156 SHA256 80abec481fd4b5e59ac3d3f5790542dbfabe3c9269a6ac17064160d6dab38ee4 acro5-cmaps-2001.tar.gz 631653
157 MD5 dfc93dd2aaaf2b86d2fd55f654c13261 adobe-cmaps-200406.tar.gz 5001983
158 RMD160 284b943b3476f6f7e2bc49842fd027c6f7f57552 adobe-cmaps-200406.tar.gz 5001983
159 SHA256 0f397255506cda4b20e362ab5e3f6cdacba09e0a0cca7f4d93afd980977c5689 adobe-cmaps-200406.tar.gz 5001983
160 MD5 89fc0a90e67caf151a9d6855200c68ca ghostscript-8.60.tar.bz2 12942029
161 RMD160 208168fcd6bc5fd931d15b288ce9324f59ba07a3 ghostscript-8.60.tar.bz2 12942029
162 SHA256 f615f936e38d2e7a6da588de6655f2b23207c0a906df1960b1d7e83c3241982a ghostscript-8.60.tar.bz2 12942029
163 MD5 cbb24f8c50b5a94ecf1635048d2f11d6 gsdjvu-1.2.tar.gz 214539
164 RMD160 6cf27e95955b5ae0cc15dacc36ce514ff8347ab0 gsdjvu-1.2.tar.gz 214539
165 SHA256 ab4a81eddb44241bb71b5ec813242036312effc9eb1b343b3c257fb563fa8a49 gsdjvu-1.2.tar.gz 214539
166
167
168
169 1.1 app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch
170
171 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch?rev=1.1&view=markup
172 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch?rev=1.1&content-type=text/plain
173
174 Index: ghostscript-8.60-ijs-krgb.patch
175 ===================================================================
176 diff -uraN gs-orig/src/gdevijs.c gs-krgb/src/gdevijs.c
177 --- gs-orig/src/gdevijs.c 2007-04-24 13:00:22.000000000 +0100
178 +++ gs-krgb/src/gdevijs.c 2007-04-27 14:44:05.000000000 +0100
179 @@ -23,15 +23,50 @@
180 * which is a security risk, since any program can be run.
181 * You should use -dSAFER which sets .LockSafetyParams to true
182 * before opening this device.
183 + *
184 + * 11/26/03 David Suffield (gdevijs-krgb-1.0.patch)
185 + * (c) 2003-2004 Copyright Hewlett-Packard Development Company, LP
186 + *
187 + * 1. Removed hpijs 1.0-1.0.2 workarounds, use hpijs 1.0.3 or higher.
188 + * 2. Added krgb support.
189 + *
190 + * 02/21/05 David Suffield (gdevijs-krgb-1.1.patch)
191 + * 1. Fixed segfault issue with 1-bit color space.
192 + * 2. Fixed z-order issue with colored text on black rectangle.
193 + *
194 + * 02/22/06 David Suffield (gdevijs-krgb-1.2.patch)
195 + * 1. Fixed krgb buffer overflow issue with out-of-band data in fill_rectangle and copy_mono.
196 + * This buffer overflow condition occurred with fullbleed print jobs that had k-band images.
197 + * 2. Added Dan Coby (artifex) fix for gsijs_read_string_malloc gs_free *str memory leak.
198 + *
199 + * 06/02/06 David Suffield (gdevijs-krgb-1.3.patch)
200 + * 1. Revisited the krgb buffer overflow issue with out-of-band data in fill_rectangle and
201 + * copy_mono. Changed the fill_rectangle and copy_mono to an inner loop buffer check
202 + * instead of a outer loop x/y extent check.
203 + * 2. As requested by Ralph Giles, added K 1-bit and 8-bit support for krgb, but only 1-bit is
204 + * implemented for now.
205 + *
206 + * KRGB definition:
207 + * 1. K=1-bit or 8-bit black plane, RGB=24 bit color raster.
208 + * 2. K-plane will only contain objects that are black text and black line drawings.
209 + * 3. RGB raster will not contain K-plane objects.
210 + * 4. K resolution and RGB resolution will be equal.
211 + * 5. K-plane will be byte aligned.
212 + * 6. K-plane 1-bit definition; 1=black, 0=nothing (KRGB).
213 + * 7. K-plane 8-bit definition; 255=black, 0=nothing (KxRGB).
214 + *
215 */
216
217 #include "unistd_.h" /* for dup() */
218 #include <stdlib.h>
219 +#include <fcntl.h>
220 #include "gdevprn.h"
221 #include "gp.h"
222 #include "ijs.h"
223 #include "ijs_client.h"
224
225 +//#define KRGB_DEBUG
226 +
227 /* This should go into gdevprn.h, or, better yet, gdevprn should
228 acquire an API for changing resolution. */
229 int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev,
230 @@ -49,6 +84,14 @@
231 private dev_proc_put_params(gsijs_put_params);
232 private dev_proc_finish_copydevice(gsijs_finish_copydevice);
233
234 +/* Following definitions are for krgb support. */
235 +private dev_proc_create_buf_device(gsijs_create_buf_device);
236 +private dev_proc_fill_rectangle(gsijs_fill_rectangle);
237 +private dev_proc_copy_mono(gsijs_copy_mono);
238 +private dev_proc_fill_mask(gsijs_fill_mask);
239 +private dev_proc_fill_path(gsijs_fill_path);
240 +private dev_proc_stroke_path(gsijs_stroke_path);
241 +
242 private const gx_device_procs gsijs_procs = {
243 gsijs_open,
244 NULL, /* get_initial_matrix */
245 @@ -123,6 +166,15 @@
246
247 IjsClientCtx *ctx;
248 int ijs_version;
249 +
250 + /* Additional parameters for krgb support. */
251 + int krgb_mode; /* 0=false, 1=true */
252 + int k_bits; /* number of bits in k plane, 1 or 8 */
253 + int k_path; /* k plane path, 0=false, 1=true */
254 + int k_width; /* k plane width in pixels */
255 + int k_band_size; /* k plane buffer size in bytes, byte aligned */
256 + unsigned char *k_band; /* k plane buffer */
257 + gx_device_procs prn_procs; /* banding playback procedures */
258 };
259
260 #define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */
261 @@ -150,7 +202,13 @@
262 FALSE, /* Tumble_set */
263
264 NULL, /* IjsClient *ctx */
265 - 0 /* ijs_version */
266 + 0, /* ijs_version */
267 + 0, /* krgb_mode */
268 + 0, /* k_bits */
269 + 0, /* k_path */
270 + 0, /* k_width */
271 + 0, /* k_band_size */
272 + NULL /* k_band buffer */
273 };
274
275
276 @@ -166,12 +224,299 @@
277
278 /**************************************************************************/
279
280 -/* ------ Private definitions ------ */
281 +/* ---------------- Low-level graphic procedures ---------------- */
282 +
283 +static unsigned char xmask[] =
284 +{
285 + 0x80, /* x=0 */
286 + 0x40, /* 1 */
287 + 0x20, /* 2 */
288 + 0x10, /* 3 */
289 + 0x08, /* 4 */
290 + 0x04, /* 5 */
291 + 0x02, /* 6 */
292 + 0x01 /* 7 */
293 +};
294 +
295 +private int gsijs_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
296 + gx_color_index color)
297 +{
298 + gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
299 +
300 + if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0)
301 + {
302 + int raster = (ijsdev->k_width+7) >> 3;
303 + register unsigned char *dest;
304 + int dest_start_bit;
305 + int band_height = ijsdev->k_band_size/raster;
306 + int i,j;
307 + unsigned char *beg = ijsdev->k_band;
308 + unsigned char *end = ijsdev->k_band+ijsdev->k_band_size;
309 + unsigned char *p;
310 +
311 + if (h <= 0 || w <= 0)
312 + return 0;
313 +
314 + /* Check for out-of-band graphic. */
315 + if (x >= ijsdev->k_width || y >= band_height)
316 + return 0; /* out-of-band */
317 +
318 + dest_start_bit = x & 7;
319 + dest=ijsdev->k_band+(raster*y)+(x >> 3);
320 +
321 + /* Note x,y orgin 0,0 is stored first byte 0 left to right. */
322 +
323 + if (color==0x0)
324 + {
325 + /* Color is black, store in k plane band instead of regular band. */
326 + for (j=0; j<h; j++)
327 + {
328 + for (i=0; i<w; i++)
329 + {
330 + p = &dest[(dest_start_bit+i)>>3];
331 + if (p >= beg && p <= end)
332 + *p |= xmask[(dest_start_bit+i)&7];
333 + }
334 + dest+=raster;
335 + }
336 + return 0;
337 + }
338 + else
339 + {
340 + /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
341 + for (j=0; j<h; j++)
342 + {
343 + for (i=0; i<w; i++)
344 + {
345 + p = &dest[(dest_start_bit+i)>>3];
346 + if (p >= beg && p <= end)
347 + *p &= ~xmask[(dest_start_bit+i)&7];
348 + }
349 + dest+=raster;
350 + }
351 + }
352 + }
353 +
354 + return (*ijsdev->prn_procs.fill_rectangle)(dev, x, y, w, h, color);
355 +}
356 +
357 +private int gsijs_copy_mono(gx_device * dev, const byte * data,
358 + int dx, int draster, gx_bitmap_id id,
359 + int x, int y, int w, int height, gx_color_index zero, gx_color_index one)
360 +{
361 + gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
362 +
363 + // if (ijsdev->krgb_mode && ijsdev->k_path && one==0x0)
364 + if (ijsdev->krgb_mode && ijsdev->k_path)
365 + {
366 + /* Store in k plane band instead of regular band. */
367 + int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
368 + register unsigned char *dest;
369 + register const unsigned char *scan;
370 + int dest_start_bit;
371 + int scan_start_bit;
372 + int band_height = ijsdev->k_band_size/raster;
373 + int i,h=height;
374 + unsigned char *beg = ijsdev->k_band;
375 + unsigned char *end = ijsdev->k_band+ijsdev->k_band_size;
376 + unsigned char *p;
377 +
378 + if (h <= 0 || w <= 0)
379 + return 0;
380 +
381 + /* Check for out-of-band graphic. */
382 + if (x >= ijsdev->k_width || y >= band_height)
383 + return 0; /* out-of-band */
384 +
385 + scan=data+(dx >> 3);
386 + dest_start_bit = x & 7;
387 + scan_start_bit = dx & 7;
388 + dest=ijsdev->k_band+(raster*y)+(x >> 3);
389 +
390 + if (one==0x0)
391 + {
392 + /* Color is black, store in k plane band instead of regular band. */
393 + while (h-- > 0)
394 + {
395 + for (i=0; i<w; i++)
396 + {
397 + if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
398 + {
399 + p = &dest[(dest_start_bit+i)>>3];
400 + if (p >= beg && p <= end)
401 + *p |= xmask[(dest_start_bit+i)&7];
402 + }
403 + }
404 + scan+=draster;
405 + dest+=raster;
406 + }
407 + return 0;
408 + }
409 + else
410 + {
411 + /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
412 + while (h-- > 0)
413 + {
414 + for (i=0; i<w; i++)
415 + {
416 + if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
417 + {
418 + p = &dest[(dest_start_bit+i)>>3];
419 + if (p >= beg && p <= end)
420 + *p &= ~xmask[(dest_start_bit+i)&7];
421 + }
422 + }
423 + scan+=draster;
424 + dest+=raster;
425 + }
426 + }
427 + }
428 +
429 + return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one);
430 +}
431 +
432 +/* ---------------- High-level graphic procedures ---------------- */
433 +
434 +private int gsijs_fill_mask(gx_device * dev,
435 + const byte * data, int dx, int raster, gx_bitmap_id id,
436 + int x, int y, int w, int h,
437 + const gx_drawing_color * pdcolor, int depth,
438 + gs_logical_operation_t lop, const gx_clip_path * pcpath)
439 +{
440 + gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
441 + int code;
442 +
443 + ijsdev->k_path = 1;
444 +
445 + code = (*ijsdev->prn_procs.fill_mask)(dev, data, dx, raster, id, x, y, w, h, pdcolor, depth, lop, pcpath);
446
447 -/* Versions 1.0 through 1.0.2 of hpijs report IJS version 0.29, and
448 - require some workarounds. When more up-to-date hpijs versions
449 - become ubiquitous, all these workarounds should be removed. */
450 -#define HPIJS_1_0_VERSION 29
451 + ijsdev->k_path = 0;
452 +
453 + return code;
454 +}
455 +
456 +private int gsijs_fill_path(gx_device * dev, const gs_imager_state * pis,
457 + gx_path * ppath, const gx_fill_params * params,
458 + const gx_drawing_color * pdcolor,
459 + const gx_clip_path * pcpath)
460 +{
461 + gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
462 + int code;
463 +
464 + ijsdev->k_path = 1;
465 +
466 + code = (*ijsdev->prn_procs.fill_path)(dev, pis, ppath, params, pdcolor, pcpath);
467 +
468 + ijsdev->k_path = 0;
469 +
470 + return 0;
471 +}
472 +
473 +private int gsijs_stroke_path(gx_device * dev, const gs_imager_state * pis,
474 + gx_path * ppath, const gx_stroke_params * params,
475 + const gx_drawing_color * pdcolor,
476 + const gx_clip_path * pcpath)
477 +{
478 + gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
479 + int code;
480 +
481 + ijsdev->k_path = 1;
482 +
483 + code = (*ijsdev->prn_procs.stroke_path)(dev, pis, ppath, params, pdcolor, pcpath);
484 +
485 + ijsdev->k_path = 0;
486 +
487 + return code;
488 +}
489 +
490 +/* ---------------- krgb banding playback procedures ---------------- */
491 +
492 +private int gsijs_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data)
493 +{
494 + gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
495 + gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
496 + int band_height = cdev->page_info.band_params.BandHeight;
497 + int band_number = y/band_height;
498 + int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
499 + int y1=raster*(y-(band_height*band_number));
500 +
501 + if (y1 == 0)
502 + {
503 + /* First raster for band, clear k_band. Banding playback occurs on first raster. */
504 + memset(ijsdev->k_band, 0, ijsdev->k_band_size);
505 + }
506 +
507 + return gdev_prn_get_bits(pdev, y, str, actual_data); /* get raster from regular band */
508 +}
509 +
510 +private int gsijs_k_get_bits(gx_device_printer * pdev, int y, byte ** actual_data)
511 +{
512 + gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
513 + gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
514 + int band_height = cdev->page_info.band_params.BandHeight;
515 + int band_number = y/band_height;
516 + int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
517 + int y1=raster*(y-(band_height*band_number));
518 +
519 + *actual_data = ijsdev->k_band+y1;
520 +
521 + return 0;
522 +}
523 +
524 +private int gsijs_create_buf_device(gx_device **pbdev, gx_device *target,
525 + const gx_render_plane_t *render_plane, gs_memory_t *mem, gx_band_complexity_t *band_complexity)
526 +{
527 + gx_device_ijs *ijsdev = (gx_device_ijs *)target;
528 + int n_chan = ijsdev->color_info.num_components;
529 + int code = gx_default_create_buf_device(pbdev, target, render_plane, mem, band_complexity);
530 + if (code < 0 || n_chan != 3)
531 + return code;
532 +
533 + /* Save buffer (vector) procedures so that we can hook them during banding playback. */
534 + ijsdev->prn_procs = (*pbdev)->procs;
535 +
536 + /* Replace buffer procedures with krgb procedures. */
537 + set_dev_proc(*pbdev, fill_rectangle, gsijs_fill_rectangle);
538 + set_dev_proc(*pbdev, copy_mono, gsijs_copy_mono);
539 + set_dev_proc(*pbdev, fill_mask, gsijs_fill_mask);
540 + set_dev_proc(*pbdev, fill_path, gsijs_fill_path);
541 + set_dev_proc(*pbdev, stroke_path, gsijs_stroke_path);
542 +
543 + return code;
544 +}
545 +
546 +/* See if IJS server supports krgb. */
547 +private int
548 +gsijs_set_krgb_mode(gx_device_ijs *ijsdev)
549 +{
550 + char buf[256];
551 + int n_chan = ijsdev->color_info.num_components;
552 + int code;
553 +
554 + ijsdev->krgb_mode = 0; /* default is no krgb */
555 +
556 + if (n_chan != 3)
557 + return 0; /* no krgb support, not RGB colorspace */
558 +
559 + buf[0] = 0;
560 + code = ijs_client_enum_param(ijsdev->ctx, 0, "ColorSpace", buf, sizeof(buf)-1);
561 + if (code >= 0)
562 + buf[code] = 0;
563 + if (strstr(buf, "KRGB") != NULL)
564 + {
565 + ijsdev->krgb_mode = 1; /* yes KRGB is supported */
566 + ijsdev->k_bits = 1; /* KRGB = 1x8x8x8 */
567 + }
568 + else if (strstr(buf, "KxRGB") != NULL)
569 + {
570 + ijsdev->krgb_mode = 1; /* yes KRGB is supported */
571 + ijsdev->k_bits = 8; /* KRGB = 8x8x8x8 */
572 + }
573 +
574 + return 0;
575 +}
576 +
577 +/* ------ Private definitions ------ */
578
579 private int
580 gsijs_parse_wxh (const char *val, int size, double *pw, double *ph)
581 @@ -209,34 +554,6 @@
582 }
583
584 /**
585 - * gsijs_set_generic_params_hpijs: Set generic IJS parameters.
586 - *
587 - * This version is specialized for hpijs 1.0 through 1.0.2, and
588 - * accommodates a number of quirks.
589 - **/
590 -private int
591 -gsijs_set_generic_params_hpijs(gx_device_ijs *ijsdev)
592 -{
593 - char buf[256];
594 - int code = 0;
595 -
596 - /* IjsParams, Duplex, and Tumble get set at this point because
597 - they may affect margins. */
598 - if (ijsdev->IjsParams) {
599 - code = gsijs_client_set_param(ijsdev, "IjsParams", ijsdev->IjsParams);
600 - }
601 -
602 - if (code == 0 && ijsdev->Duplex_set) {
603 - int duplex_val;
604 -
605 - duplex_val = ijsdev->Duplex ? (ijsdev->IjsTumble ? 1 : 2) : 0;
606 - sprintf (buf, "%d", duplex_val);
607 - code = gsijs_client_set_param(ijsdev, "Duplex", buf);
608 - }
609 - return code;
610 -}
611 -
612 -/**
613 * gsijs_set_generic_params: Set generic IJS parameters.
614 **/
615 private int
616 @@ -247,9 +564,6 @@
617 int i, j;
618 char *value;
619
620 - if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
621 - return gsijs_set_generic_params_hpijs(ijsdev);
622 -
623 /* Split IjsParams into separate parameters and send to ijs server */
624 value = NULL;
625 for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
626 @@ -290,68 +604,6 @@
627 }
628
629 /**
630 - * gsijs_set_margin_params_hpijs: Do margin negotiation with IJS server.
631 - *
632 - * This version is specialized for hpijs 1.0 through 1.0.2, and
633 - * accommodates a number of quirks.
634 - **/
635 -private int
636 -gsijs_set_margin_params_hpijs(gx_device_ijs *ijsdev)
637 -{
638 - char buf[256];
639 - int code = 0;
640 -
641 - if (code == 0) {
642 - sprintf(buf, "%d", ijsdev->width);
643 - code = gsijs_client_set_param(ijsdev, "Width", buf);
644 - }
645 - if (code == 0) {
646 - sprintf(buf, "%d", ijsdev->height);
647 - code = gsijs_client_set_param(ijsdev, "Height", buf);
648 - }
649 -
650 - if (code == 0) {
651 - double printable_width, printable_height;
652 - double printable_left, printable_top;
653 - float m[4];
654 -
655 - code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableArea",
656 - buf, sizeof(buf));
657 - if (code == IJS_EUNKPARAM)
658 - /* IJS server doesn't support margin negotiations.
659 - That's ok. */
660 - return 0;
661 - else if (code >= 0) {
662 - code = gsijs_parse_wxh(buf, code,
663 - &printable_width, &printable_height);
664 - }
665 -
666 - if (code == 0) {
667 - code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableTopLeft",
668 - buf, sizeof(buf));
669 - if (code == IJS_EUNKPARAM)
670 - return 0;
671 - else if (code >= 0) {
672 - code = gsijs_parse_wxh(buf, code,
673 - &printable_left, &printable_top);
674 - }
675 - }
676 -
677 - if (code == 0) {
678 - m[0] = printable_left;
679 - m[1] = ijsdev->MediaSize[1] * (1.0 / 72) -
680 - printable_top - printable_height;
681 - m[2] = ijsdev->MediaSize[0] * (1.0 / 72) -
682 - printable_left - printable_width;
683 - m[3] = printable_top;
684 - gx_device_set_margins((gx_device *)ijsdev, m, true);
685 - }
686 - }
687 -
688 - return code;
689 -}
690 -
691 -/**
692 * gsijs_set_margin_params: Do margin negotiation with IJS server.
693 **/
694 private int
695 @@ -362,9 +614,6 @@
696 int i, j;
697 char *value;
698
699 - if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
700 - return gsijs_set_margin_params_hpijs(ijsdev);
701 -
702 /* Split IjsParams into separate parameters and send to ijs server */
703 value = NULL;
704 for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
705 @@ -531,12 +780,18 @@
706 char buf[256];
707 bool use_outputfd;
708 int fd = -1;
709 + long max_bitmap = ijsdev->space_params.MaxBitmap;
710
711 if (strlen(ijsdev->IjsServer) == 0) {
712 eprintf("ijs server not specified\n");
713 return gs_note_error(gs_error_ioerror);
714 }
715
716 + ijsdev->space_params.MaxBitmap = 0; /* force banding */
717 +
718 + /* Set create_buf_device in printer device, so that we can hook the banding playback procedures. */
719 + ijsdev->printer_procs.buf_procs.create_buf_device = gsijs_create_buf_device;
720 +
721 /* Decide whether to use OutputFile or OutputFD. Note: how to
722 determine this is a tricky question, so we just allow the
723 user to set it.
724 @@ -551,6 +806,8 @@
725 if (code < 0)
726 return code;
727
728 + ijsdev->space_params.MaxBitmap = max_bitmap;
729 +
730 if (use_outputfd) {
731 /* Note: dup() may not be portable to all interesting IJS
732 platforms. In that case, this branch should be #ifdef'ed out.
733 @@ -610,6 +867,9 @@
734 if (code >= 0)
735 code = gsijs_set_margin_params(ijsdev);
736
737 + if (code >= 0)
738 + code = gsijs_set_krgb_mode(ijsdev);
739 +
740 return code;
741 }
742
743 @@ -690,21 +950,6 @@
744 return min(width, end);
745 }
746
747 -private int ijs_all_white(unsigned char *data, int size)
748 -{
749 - int clean = 1;
750 - int i;
751 - for (i = 0; i < size; i++)
752 - {
753 - if (data[i] != 0xFF)
754 - {
755 - clean = 0;
756 - break;
757 - }
758 - }
759 - return clean;
760 -}
761 -
762 /* Print a page. Don't use normal printer gdev_prn_output_page
763 * because it opens the output file.
764 */
765 @@ -715,8 +960,10 @@
766 gx_device_printer *pdev = (gx_device_printer *)dev;
767 int raster = gdev_prn_raster(pdev);
768 int ijs_width, ijs_height;
769 - int row_bytes;
770 + int row_bytes, k_row_bytes=0;
771 int n_chan = pdev->color_info.num_components;
772 + int krgb_mode = ijsdev->krgb_mode;
773 + int k_bits = ijsdev->k_bits;
774 unsigned char *data;
775 char buf[256];
776 double xres = pdev->HWResolution[0];
777 @@ -732,13 +979,23 @@
778
779 /* Determine bitmap width and height */
780 ijs_height = gdev_prn_print_scan_lines(dev);
781 - if (ijsdev->ijs_version == HPIJS_1_0_VERSION) {
782 - ijs_width = pdev->width;
783 - } else {
784 ijs_width = gsijs_raster_width(dev);
785 - }
786 +
787 row_bytes = (ijs_width * pdev->color_info.depth + 7) >> 3;
788
789 + if (krgb_mode)
790 + {
791 + gx_device_clist_common *cdev = (gx_device_clist_common *)dev;
792 + int band_height = cdev->page_info.band_params.BandHeight;
793 + k_row_bytes = (ijs_width + 7) >> 3;
794 +
795 + /* Create banding buffer for k plane. */
796 + ijsdev->k_width = ijs_width;
797 + ijsdev->k_band_size = band_height * k_row_bytes;
798 + if ((ijsdev->k_band = gs_malloc(pdev->memory, ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL)
799 + return gs_note_error(gs_error_VMerror);
800 + }
801 +
802 /* Required page parameters */
803 sprintf(buf, "%d", n_chan);
804 gsijs_client_set_param(ijsdev, "NumChan", buf);
805 @@ -747,44 +1004,71 @@
806
807 /* This needs to become more sophisticated for DeviceN. */
808 strcpy(buf, (n_chan == 4) ? "DeviceCMYK" :
809 - ((n_chan == 3) ? "DeviceRGB" : "DeviceGray"));
810 + ((n_chan == 3) ? (krgb_mode ? ((k_bits == 1) ? "KRGB" : "KxRGB") : "DeviceRGB") : "DeviceGray"));
811 gsijs_client_set_param(ijsdev, "ColorSpace", buf);
812
813 - /* If hpijs 1.0, don't set width and height here, because it
814 - expects them to be the paper size. */
815 - if (ijsdev->ijs_version != HPIJS_1_0_VERSION) {
816 - sprintf(buf, "%d", ijs_width);
817 - gsijs_client_set_param(ijsdev, "Width", buf);
818 - sprintf(buf, "%d", ijs_height);
819 - gsijs_client_set_param(ijsdev, "Height", buf);
820 - }
821 + sprintf(buf, "%d", ijs_width);
822 + gsijs_client_set_param(ijsdev, "Width", buf);
823 + sprintf(buf, "%d", ijs_height);
824 + gsijs_client_set_param(ijsdev, "Height", buf);
825
826 sprintf(buf, "%gx%g", xres, yres);
827 gsijs_client_set_param(ijsdev, "Dpi", buf);
828
829 +#ifdef KRGB_DEBUG
830 + int kfd, rgbfd;
831 + char sz[128];
832 + kfd = open("/tmp/k.pbm", O_CREAT | O_TRUNC | O_RDWR, 0644);
833 + rgbfd = open("/tmp/rgb.ppm", O_CREAT | O_TRUNC | O_RDWR, 0644);
834 + snprintf(sz, sizeof(sz), "P4\n#gdevijs test\n%d\n%d\n", ijs_width, ijs_height);
835 + write(kfd, sz, strlen(sz));
836 + snprintf(sz, sizeof(sz), "P6\n#gdevijs test\n%d\n%d\n255\n", ijs_width, ijs_height);
837 + write(rgbfd, sz, strlen(sz));
838 +#endif
839 +
840 for (i=0; i<num_copies; i++) {
841 unsigned char *actual_data;
842 ijs_client_begin_cmd (ijsdev->ctx, IJS_CMD_BEGIN_PAGE);
843 status = ijs_client_send_cmd_wait(ijsdev->ctx);
844
845 for (y = 0; y < ijs_height; y++) {
846 - code = gdev_prn_get_bits(pdev, y, data, &actual_data);
847 - if (code < 0)
848 - break;
849 + if (krgb_mode)
850 + code = gsijs_get_bits(pdev, y, data, &actual_data);
851 + else
852 + code = gdev_prn_get_bits(pdev, y, data, &actual_data);
853 + if (code < 0)
854 + break;
855 +#ifdef KRGB_DEBUG
856 + write(rgbfd, actual_data, row_bytes);
857 +#endif
858 + status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, row_bytes);
859 + if (status)
860 + break;
861
862 - if (ijsdev->ijs_version == HPIJS_1_0_VERSION &&
863 - ijs_all_white(actual_data, row_bytes))
864 - status = ijs_client_send_data_wait(ijsdev->ctx, 0, NULL, 0);
865 - else
866 - status = ijs_client_send_data_wait(ijsdev->ctx, 0,
867 - (char *)actual_data, row_bytes);
868 - if (status)
869 - break;
870 + if (krgb_mode) {
871 + code = gsijs_k_get_bits(pdev, y, &actual_data);
872 + if (code < 0)
873 + break;
874 +#ifdef KRGB_DEBUG
875 + write(kfd, actual_data, k_row_bytes);
876 +#endif
877 + status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, k_row_bytes);
878 + if (status)
879 + break;
880 + }
881 }
882 ijs_client_begin_cmd(ijsdev->ctx, IJS_CMD_END_PAGE);
883 status = ijs_client_send_cmd_wait(ijsdev->ctx);
884 }
885
886 +#ifdef KRGB_DEBUG
887 + close(kfd);
888 + close(rgbfd);
889 +#endif
890 +
891 + if(krgb_mode)
892 + gs_free(pdev->memory, ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page");
893 +
894 gs_free_object(pdev->memory, data, "gsijs_output_page");
895
896 endcode = (pdev->buffer_space && !pdev->is_async_renderer ?
897 @@ -1090,7 +1374,6 @@
898 dprintf2("ijs: Can't set parameter %s=%s\n", key, value);
899 return code;
900 }
901 -
902
903 private int
904 gsijs_set_color_format(gx_device_ijs *ijsdev)
905
906
907
908 1.1 app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch
909
910 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch?rev=1.1&view=markup
911 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch?rev=1.1&content-type=text/plain
912
913 Index: ghostscript-8.60-fPIC.patch
914 ===================================================================
915 --- ghostscript-8.60-r8112/src/lib.mak.fPIC 2007-07-10 17:03:11.000000000 +0100
916 +++ ghostscript-8.60-r8112/src/lib.mak 2007-07-10 17:05:56.000000000 +0100
917 @@ -874,7 +874,7 @@
918 $(GLOBJ)gsparamx.$(OBJ) : $(GLSRC)gsparamx.c $(string__h)\
919 $(gserror_h) $(gserrors_h) $(gsmemory_h) $(gsparam_h) $(gsparamx_h)\
920 $(gstypes_h)
921 - $(GLCC) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c
922 + $(GLCCSHARED) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c
923
924 # Future replacement for gsparams.c
925 $(GLOBJ)gsparam2.$(OBJ) : $(GLSRC)gsparam2.c $(GXERR) $(memory__h)\
926 @@ -1077,7 +1077,7 @@
927
928 # Provide a mapping between StandardEncoding and ISOLatin1Encoding.
929 $(GLOBJ)gdevemap.$(OBJ) : $(GLSRC)gdevemap.c $(AK) $(std_h)
930 - $(GLCC) $(GLO_)gdevemap.$(OBJ) $(C_) $(GLSRC)gdevemap.c
931 + $(GLCCSHARED) $(GLO_)gdevemap.$(OBJ) $(C_) $(GLSRC)gdevemap.c
932
933 ###### Create a pseudo-"feature" for the entire graphics library.
934
935 --- ghostscript-8.60-r8112/src/devs.mak.fPIC 2007-07-10 17:05:00.000000000 +0100
936 +++ ghostscript-8.60-r8112/src/devs.mak 2007-07-10 17:05:07.000000000 +0100
937 @@ -464,7 +464,7 @@
938 $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c
939
940 $(GLOBJ)gdevxcmp.$(OBJ) : $(GLSRC)gdevxcmp.c $(GDEVX) $(math__h)
941 - $(GLCC) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
942 + $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
943
944 $(GLOBJ)gdevxini.$(OBJ) : $(GLSRC)gdevxini.c $(GDEVX) $(memory__h)\
945 $(gserrors_h) $(gsparamx_h) $(gxdevmem_h) $(gdevbbox_h)
946
947
948
949 1.1 app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch
950
951 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch?rev=1.1&view=markup
952 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch?rev=1.1&content-type=text/plain
953
954 Index: ghostscript-8.60-noopt.patch
955 ===================================================================
956 --- ghostscript-7.07/src/int.mak.noopt 2005-03-10 17:22:53.000000000 +0000
957 +++ ghostscript-7.07/src/int.mak 2005-03-10 17:24:10.000000000 +0000
958 @@ -105,7 +105,7 @@
959 $(PSOBJ)igcref.$(OBJ) : $(PSSRC)igcref.c $(GH) $(memory__h)\
960 $(gsexit_h) $(gsstruct_h)\
961 $(iastate_h) $(idebug_h) $(igc_h) $(iname_h) $(ipacked_h) $(store_h)
962 - $(PSCC) $(PSO_)igcref.$(OBJ) $(C_) $(PSSRC)igcref.c
963 + $(PSCC) -O0 $(PSO_)igcref.$(OBJ) $(C_) $(PSSRC)igcref.c
964
965 $(PSOBJ)igcstr.$(OBJ) : $(PSSRC)igcstr.c $(GH) $(memory__h)\
966 $(gsmdebug_h) $(gsstruct_h) $(iastate_h) $(igcstr_h)
967
968
969
970 --
971 gentoo-commits@g.o mailing list