summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Gurr <tgurr@gentoo.org>2007-10-17 22:00:45 +0000
committerTimo Gurr <tgurr@gentoo.org>2007-10-17 22:00:45 +0000
commite8b1e506ac685f8908d68fb56fc46897a3ebee5b (patch)
tree390121271ee0ecaf970f0011b38b55d6c3b82e56 /app-text
parentFix fb module typo, bug 196201 (diff)
downloadhistorical-e8b1e506ac685f8908d68fb56fc46897a3ebee5b.tar.gz
historical-e8b1e506ac685f8908d68fb56fc46897a3ebee5b.tar.bz2
historical-e8b1e506ac685f8908d68fb56fc46897a3ebee5b.zip
Add ghostscript-gpl-8.60, first release with ghostscript-esp merged. Fixes bug #187502.
Package-Manager: portage-2.1.3.14
Diffstat (limited to 'app-text')
-rw-r--r--app-text/ghostscript-gpl/ChangeLog14
-rw-r--r--app-text/ghostscript-gpl/Manifest41
-rw-r--r--app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.6012
-rw-r--r--app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch49
-rw-r--r--app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch31
-rw-r--r--app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch729
-rw-r--r--app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch25
-rw-r--r--app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch11
-rw-r--r--app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch29
-rw-r--r--app-text/ghostscript-gpl/ghostscript-gpl-8.60.ebuild139
10 files changed, 1075 insertions, 5 deletions
diff --git a/app-text/ghostscript-gpl/ChangeLog b/app-text/ghostscript-gpl/ChangeLog
index 0364de53fbb3..dee73f945c4f 100644
--- a/app-text/ghostscript-gpl/ChangeLog
+++ b/app-text/ghostscript-gpl/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for app-text/ghostscript-gpl
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ChangeLog,v 1.14 2007/08/15 12:30:22 fmccor Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ChangeLog,v 1.15 2007/10/17 22:00:44 tgurr Exp $
+
+*ghostscript-gpl-8.60 (17 Oct 2007)
+
+ 17 Oct 2007; Timo Gurr <tgurr@gentoo.org>
+ +files/ghostscript-8.60-fPIC.patch,
+ +files/ghostscript-8.60-ijs-krgb.patch,
+ +files/ghostscript-8.60-multilib.patch,
+ +files/ghostscript-8.60-noopt.patch,
+ +files/ghostscript-8.60-scripts.patch, +files/djvu-gs-gpl-8.60.patch,
+ +ghostscript-gpl-8.60.ebuild:
+ Add ghostscript-gpl-8.60, first release with ghostscript-esp merged. Fixes
+ bug #187502.
15 Aug 2007; Ferris McCormick <fmccor@gentoo.org> ChangeLog:
That's Bug #187280 we need the ~sparc keyword for, of course. This cures it.
diff --git a/app-text/ghostscript-gpl/Manifest b/app-text/ghostscript-gpl/Manifest
index acca777c6ff1..11042e16e6cf 100644
--- a/app-text/ghostscript-gpl/Manifest
+++ b/app-text/ghostscript-gpl/Manifest
@@ -1,3 +1,7 @@
+AUX djvu-gs-gpl-8.60.patch 1636 RMD160 ae4e7e848b0e44f7d58d3121c27dd4425c174844 SHA1 cb1bff94ec47ccdeb7914375d472a02f22b3f1db SHA256 8a30f9d8bc02ecd3cddb4c18d38fab125228b116e9939c8f8c23fa9642f54009
+MD5 7cabb316b2258839672fbad4e0629ad0 files/djvu-gs-gpl-8.60.patch 1636
+RMD160 ae4e7e848b0e44f7d58d3121c27dd4425c174844 files/djvu-gs-gpl-8.60.patch 1636
+SHA256 8a30f9d8bc02ecd3cddb4c18d38fab125228b116e9939c8f8c23fa9642f54009 files/djvu-gs-gpl-8.60.patch 1636
AUX djvu-gs-gpl.patch 2565 RMD160 cd398bf51e1279628c52138da75a555021fedf12 SHA1 7e82d3067de1e871283e736676fb73c1f4d61f6e SHA256 7c76e41416845b1497ddb38898f89ce3e645dcd77c93551cc4d8db47e799116d
MD5 d2d2cc58946c5956c12ea2979ffec99a files/djvu-gs-gpl.patch 2565
RMD160 cd398bf51e1279628c52138da75a555021fedf12 files/djvu-gs-gpl.patch 2565
@@ -10,6 +14,26 @@ AUX gdevhl12-hl1250.mak 678 RMD160 10640a63ece09315186c4567802d1bf21f72c8a4 SHA1
MD5 e5838642567ec2da6660ef2d6a602cff files/gdevhl12-hl1250.mak 678
RMD160 10640a63ece09315186c4567802d1bf21f72c8a4 files/gdevhl12-hl1250.mak 678
SHA256 1acde11d9ebd11a590e33b76ec3a1ead12ab775e42b0ebb52d685310380ff7a8 files/gdevhl12-hl1250.mak 678
+AUX ghostscript-8.60-fPIC.patch 1488 RMD160 1e73d1faddb1b000a5a1e4d9ba521894fb11e964 SHA1 1c6cfa131b726082f73b6b677d7edced5d3e6a8d SHA256 af0e19a16ebd5561907e8e302bc99171cfb4c4405708d44b30edae1aae57ee0d
+MD5 29540cd88aad9a3a788d68193523080d files/ghostscript-8.60-fPIC.patch 1488
+RMD160 1e73d1faddb1b000a5a1e4d9ba521894fb11e964 files/ghostscript-8.60-fPIC.patch 1488
+SHA256 af0e19a16ebd5561907e8e302bc99171cfb4c4405708d44b30edae1aae57ee0d files/ghostscript-8.60-fPIC.patch 1488
+AUX ghostscript-8.60-ijs-krgb.patch 23397 RMD160 afb91c856f688549947fd695021fbc365c6e1190 SHA1 e1e743fc0e5be45f0f9e0138d89e5af6f311588d SHA256 8aaceb0dd31565880bc5b1318c4da040ba20c2118405807bdf0ed230a62db01b
+MD5 9367bf6f6b7a82a3182ba9f74fb8fa21 files/ghostscript-8.60-ijs-krgb.patch 23397
+RMD160 afb91c856f688549947fd695021fbc365c6e1190 files/ghostscript-8.60-ijs-krgb.patch 23397
+SHA256 8aaceb0dd31565880bc5b1318c4da040ba20c2118405807bdf0ed230a62db01b files/ghostscript-8.60-ijs-krgb.patch 23397
+AUX ghostscript-8.60-multilib.patch 722 RMD160 b2542b5d35e0626fab75e80a153f6cca8c574190 SHA1 3b09b2c76105343b9a6362e5934eacf8ae395696 SHA256 21a91efee35b1d5a7f2dba59f6e4aa6f74ba8830707efd3d324bcc7310a648f9
+MD5 3a9b98c6cd57dc5f49450d49eafbc945 files/ghostscript-8.60-multilib.patch 722
+RMD160 b2542b5d35e0626fab75e80a153f6cca8c574190 files/ghostscript-8.60-multilib.patch 722
+SHA256 21a91efee35b1d5a7f2dba59f6e4aa6f74ba8830707efd3d324bcc7310a648f9 files/ghostscript-8.60-multilib.patch 722
+AUX ghostscript-8.60-noopt.patch 557 RMD160 579feb72d004e49ed8058c2ce75a16fd47242a49 SHA1 6afb3819e4b9a4d02d9b067cf5288ed39fbd6439 SHA256 0fcfd6fb8e80440d49d55bf6d7f50dda831824ce2093f2ebdac8b302dc4c2a59
+MD5 01cfb541633de9580aa5151543a0075f files/ghostscript-8.60-noopt.patch 557
+RMD160 579feb72d004e49ed8058c2ce75a16fd47242a49 files/ghostscript-8.60-noopt.patch 557
+SHA256 0fcfd6fb8e80440d49d55bf6d7f50dda831824ce2093f2ebdac8b302dc4c2a59 files/ghostscript-8.60-noopt.patch 557
+AUX ghostscript-8.60-scripts.patch 1192 RMD160 95bace3214b0d2b9896b281f42c25fd24f6e2797 SHA1 721a95e6daa37dca5d1f5f0ed526ebfbae600001 SHA256 e05700c3747a86d2984c3e174aaebc7f21a1f9d55c0f35be6ebc287675671709
+MD5 84384d5f89ef13b51606cf6abefeeefd files/ghostscript-8.60-scripts.patch 1192
+RMD160 95bace3214b0d2b9896b281f42c25fd24f6e2797 files/ghostscript-8.60-scripts.patch 1192
+SHA256 e05700c3747a86d2984c3e174aaebc7f21a1f9d55c0f35be6ebc287675671709 files/ghostscript-8.60-scripts.patch 1192
AUX ghostscript-afpl-8.54-big-cmap-post.patch 7588 RMD160 7afa1acae19228903e94b7203515602701d45bff SHA1 4b1e94f885053c63d4f90d5289474bff15be0e2c SHA256 e207a316591ab6d827c1752efd79e7d5c0b072e93a7adca1508bf63b51cae549
MD5 33ed647c4208f611993c427a0d5a0264 files/ghostscript-afpl-8.54-big-cmap-post.patch 7588
RMD160 7afa1acae19228903e94b7203515602701d45bff files/ghostscript-afpl-8.54-big-cmap-post.patch 7588
@@ -60,7 +84,9 @@ DIST cups-1.1.23-source.tar.bz2 8705521 RMD160 255ec4c22422b14f2367d69f3ec7e590d
DIST gdevhl12.c.gz 7613 RMD160 3adffbf7df824abd02242dadf847b09246f411bb SHA1 b5ac9ebe654b0ace453f1aec501dd363311efeed SHA256 3905677ab494a1b82ee2a6cc78975a5fdc08d81a65c12af35746bb3d2889b3e2
DIST ghostscript-8.54-gpl.tar.bz2 12365361 RMD160 f61f6da568ffe440a466cd0d7b5871a3d87d1116 SHA1 5da69b04ddc8a4660a2c40b0e561a358c737c310 SHA256 64f43553223390a3e519efed2b3dfee8a4c79df5a373a0e96861483565957e1b
DIST ghostscript-8.57.tar.bz2 11934408 RMD160 034331d9713cb551e1081c6bd53dbe4c983c2908 SHA1 17975b561a05b036fe06c96e8efdc512b9960062 SHA256 29c4cbf8bd95a14046d72eba7edbec60ffd25c37b3b3427f7c8ad5f81636ab15
+DIST ghostscript-8.60.tar.bz2 12942029 RMD160 208168fcd6bc5fd931d15b288ce9324f59ba07a3 SHA1 f0045b5055d7f83bf34b205976f73a7dafdac863 SHA256 f615f936e38d2e7a6da588de6655f2b23207c0a906df1960b1d7e83c3241982a
DIST gsdjvu-1.1.tar.gz 214364 RMD160 aa1ff4a80b02b16e43bf8e14719613f98bdf13c6 SHA1 cc33916f86a0f826159e5afed43d7fae722b3133 SHA256 39f32b9946a65cbe8d5b7c2882ef0e82d5858e78e04b568bb525d2c4e2d6ce78
+DIST gsdjvu-1.2.tar.gz 214539 RMD160 6cf27e95955b5ae0cc15dacc36ce514ff8347ab0 SHA1 e393193d8794c8a9c17e5642f90f2644c7ced155 SHA256 ab4a81eddb44241bb71b5ec813242036312effc9eb1b343b3c257fb563fa8a49
EBUILD ghostscript-gpl-8.54.ebuild 5551 RMD160 9ce56d8df42553a6cdf4bda95ec9010605b5c609 SHA1 5ab09c1efdf4cdb67ccadce590c62f025cdd955b SHA256 87fbc9296139d93d29a2be534d588d907dfdae6a599487c0ceb960c3c44f4970
MD5 203240523659481e554b331a2e435bb0 ghostscript-gpl-8.54.ebuild 5551
RMD160 9ce56d8df42553a6cdf4bda95ec9010605b5c609 ghostscript-gpl-8.54.ebuild 5551
@@ -69,10 +95,14 @@ EBUILD ghostscript-gpl-8.57.ebuild 5523 RMD160 e0ef9cf7285ea9b7a61b248fbb904e168
MD5 f05120c3fe1e7a236870201970a362b7 ghostscript-gpl-8.57.ebuild 5523
RMD160 e0ef9cf7285ea9b7a61b248fbb904e168ecf6875 ghostscript-gpl-8.57.ebuild 5523
SHA256 f88cb9dabd61e46c991ffc815e07ea1fad25e2b5685796b70af33b499bc4e510 ghostscript-gpl-8.57.ebuild 5523
-MISC ChangeLog 4019 RMD160 cf7ffcd72e45946189c91ce9f4ab2c198cf993a7 SHA1 e7e75ec0e7ee03a5a217a5d9845d8aa1badaf95d SHA256 c6514bd30b79716b1aa0e65f5a65b31bb3c4c4a3955acad72386f0817b9e7637
-MD5 983e7e8cc3636d07187113dacba5cf8a ChangeLog 4019
-RMD160 cf7ffcd72e45946189c91ce9f4ab2c198cf993a7 ChangeLog 4019
-SHA256 c6514bd30b79716b1aa0e65f5a65b31bb3c4c4a3955acad72386f0817b9e7637 ChangeLog 4019
+EBUILD ghostscript-gpl-8.60.ebuild 4417 RMD160 a451522e7e5c9e910fa9716d84437d76774c6ec3 SHA1 204a3557a7d8bd389615c78a6ce51b16bb2807e6 SHA256 09ada098ed686aa65e904144c1e0dffe9d39f2864676a710947c116c791da198
+MD5 eaa6996e87d1308d3534c1d23fe711ca ghostscript-gpl-8.60.ebuild 4417
+RMD160 a451522e7e5c9e910fa9716d84437d76774c6ec3 ghostscript-gpl-8.60.ebuild 4417
+SHA256 09ada098ed686aa65e904144c1e0dffe9d39f2864676a710947c116c791da198 ghostscript-gpl-8.60.ebuild 4417
+MISC ChangeLog 4457 RMD160 220f64817428515d3db26021d7e994d04715f8f2 SHA1 bfb6f6efedd19c1af08e2ae23029146fffdbfa04 SHA256 875afe1b499c20aee5fb3631f6fb6b6cb54e32df11b6de8c3298662625428829
+MD5 1f0137f51e5939a33d27763271021304 ChangeLog 4457
+RMD160 220f64817428515d3db26021d7e994d04715f8f2 ChangeLog 4457
+SHA256 875afe1b499c20aee5fb3631f6fb6b6cb54e32df11b6de8c3298662625428829 ChangeLog 4457
MISC metadata.xml 161 RMD160 1e5b1e42553c8869b93c4a5448e9a2a2ed9fe525 SHA1 209c6a46e4cdd891980115e42ba419e3799f8088 SHA256 7c85e6739a71f5bb23e8de36c88677d772946e61f7285892f7554e37bd2bca76
MD5 26b4b081d538c195dc39bcb2ec8e6f3a metadata.xml 161
RMD160 1e5b1e42553c8869b93c4a5448e9a2a2ed9fe525 metadata.xml 161
@@ -83,3 +113,6 @@ SHA256 0c2f61b7b0575c76d83fbfd9ddddb87b151118444609d0f3ae55fba35587f7c4 files/di
MD5 55331e222ea7c63743453ec4aee0658a files/digest-ghostscript-gpl-8.57 1476
RMD160 ac943d61c81167cab7007e993f56b663057059f4 files/digest-ghostscript-gpl-8.57 1476
SHA256 173e6238b3990e0e9b71b04d108159d2fb6457f866be92571aa810360a2c0b0a files/digest-ghostscript-gpl-8.57 1476
+MD5 ad2c51586f706c781698d86b63308fe2 files/digest-ghostscript-gpl-8.60 1000
+RMD160 f314aa1cac8387a24be632548a20249212f16cc7 files/digest-ghostscript-gpl-8.60 1000
+SHA256 2b6a56bd1d93f9fce20899b6e023e9e3e25bcd96d7d30a414d73c9dde39e6a29 files/digest-ghostscript-gpl-8.60 1000
diff --git a/app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.60 b/app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.60
new file mode 100644
index 000000000000..a6cd5c99e4c8
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/digest-ghostscript-gpl-8.60
@@ -0,0 +1,12 @@
+MD5 2fbae60417d42779f6488ab897dcaaf6 acro5-cmaps-2001.tar.gz 631653
+RMD160 c723afc2207157a434988b46bcf0a458281c29a4 acro5-cmaps-2001.tar.gz 631653
+SHA256 80abec481fd4b5e59ac3d3f5790542dbfabe3c9269a6ac17064160d6dab38ee4 acro5-cmaps-2001.tar.gz 631653
+MD5 dfc93dd2aaaf2b86d2fd55f654c13261 adobe-cmaps-200406.tar.gz 5001983
+RMD160 284b943b3476f6f7e2bc49842fd027c6f7f57552 adobe-cmaps-200406.tar.gz 5001983
+SHA256 0f397255506cda4b20e362ab5e3f6cdacba09e0a0cca7f4d93afd980977c5689 adobe-cmaps-200406.tar.gz 5001983
+MD5 89fc0a90e67caf151a9d6855200c68ca ghostscript-8.60.tar.bz2 12942029
+RMD160 208168fcd6bc5fd931d15b288ce9324f59ba07a3 ghostscript-8.60.tar.bz2 12942029
+SHA256 f615f936e38d2e7a6da588de6655f2b23207c0a906df1960b1d7e83c3241982a ghostscript-8.60.tar.bz2 12942029
+MD5 cbb24f8c50b5a94ecf1635048d2f11d6 gsdjvu-1.2.tar.gz 214539
+RMD160 6cf27e95955b5ae0cc15dacc36ce514ff8347ab0 gsdjvu-1.2.tar.gz 214539
+SHA256 ab4a81eddb44241bb71b5ec813242036312effc9eb1b343b3c257fb563fa8a49 gsdjvu-1.2.tar.gz 214539
diff --git a/app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch b/app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch
new file mode 100644
index 000000000000..ad7b89873ff7
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/djvu-gs-gpl-8.60.patch
@@ -0,0 +1,49 @@
+diff -ur ghostscript-8.60-gpl.orig/gsdjvu ghostscript-8.60-gpl/gsdjvu
+--- ghostscript-8.54-gpl.orig/gsdjvu 2006-12-14 19:14:43.000000000 +0100
++++ ghostscript-8.54-gpl/gsdjvu 2006-12-14 19:23:16.000000000 +0100
+@@ -56,4 +56,4 @@
+ # Step 2 -- execute ghostscript
+
+ gsdir="$progdir"
+-GS_LIB="$gsdir/lib:$gsdir/fonts:$gsdir" exec "$gsdir/bin/gs" "$@"
++GS_LIB="$gsdir/lib:$gsdir/fonts:$gsdir" exec "/usr/bin/gs" "$@"
+diff -ur ghostscript-8.60-gpl.orig/src/gdevdjvu.c ghostscript-8.60-gpl/src/gdevdjvu.c
+--- ghostscript-8.60-gpl.orig/src/gdevdjvu.c 2007-05-14 06:01:45.000000000 +0200
++++ ghostscript-8.60-gpl/src/gdevdjvu.c 2007-08-03 10:18:25.353066136 +0200
+@@ -155,8 +155,8 @@
+ private void
+ lbassertfail(const char *file, int line)
+ {
+- fprintf(STDERR,"Internal error at %s:%d\n", file, line);
+- fclose(STDERR);
++ //fprintf(STDERR,"Internal error at %s:%d\n", file, line);
++ //fclose(STDERR);
+ abort();
+ }
+
+@@ -4940,12 +4942,6 @@
+ 0, cdev->width-1, 0, cdev->height-1, comment);
+ if (code < 0) return code;
+ }
+- /* Print message */
+- if (! cdev->quiet) {
+- fprintf(STDOUT, "Page %dx%d (%s )\n",
+- cdev->width, cdev->height, comment);
+- fflush(STDOUT);
+- }
+ /* Terminate */
+ runmap_free(fgmap);
+ #ifdef DEBUG
+@@ -5342,12 +5338,6 @@
+ if (code < 0)
+ return code;
+ }
+- /* Print message */
+- if (! cdev->quiet) {
+- fprintf(STDOUT,"Page %dx%d (%s )\n",
+- cdev->width, cdev->height, comment);
+- fflush(STDOUT);
+- }
+ /* Terminate */
+ runmap_free(fgmap);
+ #ifdef DEBUG
diff --git a/app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch b/app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch
new file mode 100644
index 000000000000..9b4deb23aa22
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/ghostscript-8.60-fPIC.patch
@@ -0,0 +1,31 @@
+--- ghostscript-8.60-r8112/src/lib.mak.fPIC 2007-07-10 17:03:11.000000000 +0100
++++ ghostscript-8.60-r8112/src/lib.mak 2007-07-10 17:05:56.000000000 +0100
+@@ -874,7 +874,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)\
+@@ -1077,7 +1077,7 @@
+
+ # Provide a mapping between StandardEncoding and ISOLatin1Encoding.
+ $(GLOBJ)gdevemap.$(OBJ) : $(GLSRC)gdevemap.c $(AK) $(std_h)
+- $(GLCC) $(GLO_)gdevemap.$(OBJ) $(C_) $(GLSRC)gdevemap.c
++ $(GLCCSHARED) $(GLO_)gdevemap.$(OBJ) $(C_) $(GLSRC)gdevemap.c
+
+ ###### Create a pseudo-"feature" for the entire graphics library.
+
+--- ghostscript-8.60-r8112/src/devs.mak.fPIC 2007-07-10 17:05:00.000000000 +0100
++++ ghostscript-8.60-r8112/src/devs.mak 2007-07-10 17:05:07.000000000 +0100
+@@ -464,7 +464,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)
diff --git a/app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch b/app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch
new file mode 100644
index 000000000000..2f1e5f19b37f
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/ghostscript-8.60-ijs-krgb.patch
@@ -0,0 +1,729 @@
+diff -uraN gs-orig/src/gdevijs.c gs-krgb/src/gdevijs.c
+--- gs-orig/src/gdevijs.c 2007-04-24 13:00:22.000000000 +0100
++++ gs-krgb/src/gdevijs.c 2007-04-27 14:44:05.000000000 +0100
+@@ -23,15 +23,50 @@
+ * which is a security risk, since any program can be run.
+ * You should use -dSAFER which sets .LockSafetyParams to true
+ * before opening this device.
++ *
++ * 11/26/03 David Suffield (gdevijs-krgb-1.0.patch)
++ * (c) 2003-2004 Copyright Hewlett-Packard Development Company, LP
++ *
++ * 1. Removed hpijs 1.0-1.0.2 workarounds, use hpijs 1.0.3 or higher.
++ * 2. Added krgb support.
++ *
++ * 02/21/05 David Suffield (gdevijs-krgb-1.1.patch)
++ * 1. Fixed segfault issue with 1-bit color space.
++ * 2. Fixed z-order issue with colored text on black rectangle.
++ *
++ * 02/22/06 David Suffield (gdevijs-krgb-1.2.patch)
++ * 1. Fixed krgb buffer overflow issue with out-of-band data in fill_rectangle and copy_mono.
++ * This buffer overflow condition occurred with fullbleed print jobs that had k-band images.
++ * 2. Added Dan Coby (artifex) fix for gsijs_read_string_malloc gs_free *str memory leak.
++ *
++ * 06/02/06 David Suffield (gdevijs-krgb-1.3.patch)
++ * 1. Revisited the krgb buffer overflow issue with out-of-band data in fill_rectangle and
++ * copy_mono. Changed the fill_rectangle and copy_mono to an inner loop buffer check
++ * instead of a outer loop x/y extent check.
++ * 2. As requested by Ralph Giles, added K 1-bit and 8-bit support for krgb, but only 1-bit is
++ * implemented for now.
++ *
++ * KRGB definition:
++ * 1. K=1-bit or 8-bit black plane, RGB=24 bit color raster.
++ * 2. K-plane will only contain objects that are black text and black line drawings.
++ * 3. RGB raster will not contain K-plane objects.
++ * 4. K resolution and RGB resolution will be equal.
++ * 5. K-plane will be byte aligned.
++ * 6. K-plane 1-bit definition; 1=black, 0=nothing (KRGB).
++ * 7. K-plane 8-bit definition; 255=black, 0=nothing (KxRGB).
++ *
+ */
+
+ #include "unistd_.h" /* for dup() */
+ #include <stdlib.h>
++#include <fcntl.h>
+ #include "gdevprn.h"
+ #include "gp.h"
+ #include "ijs.h"
+ #include "ijs_client.h"
+
++//#define KRGB_DEBUG
++
+ /* This should go into gdevprn.h, or, better yet, gdevprn should
+ acquire an API for changing resolution. */
+ int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev,
+@@ -49,6 +84,14 @@
+ private dev_proc_put_params(gsijs_put_params);
+ private dev_proc_finish_copydevice(gsijs_finish_copydevice);
+
++/* Following definitions are for krgb support. */
++private dev_proc_create_buf_device(gsijs_create_buf_device);
++private dev_proc_fill_rectangle(gsijs_fill_rectangle);
++private dev_proc_copy_mono(gsijs_copy_mono);
++private dev_proc_fill_mask(gsijs_fill_mask);
++private dev_proc_fill_path(gsijs_fill_path);
++private dev_proc_stroke_path(gsijs_stroke_path);
++
+ private const gx_device_procs gsijs_procs = {
+ gsijs_open,
+ NULL, /* get_initial_matrix */
+@@ -123,6 +166,15 @@
+
+ IjsClientCtx *ctx;
+ int ijs_version;
++
++ /* Additional parameters for krgb support. */
++ int krgb_mode; /* 0=false, 1=true */
++ int k_bits; /* number of bits in k plane, 1 or 8 */
++ int k_path; /* k plane path, 0=false, 1=true */
++ int k_width; /* k plane width in pixels */
++ int k_band_size; /* k plane buffer size in bytes, byte aligned */
++ unsigned char *k_band; /* k plane buffer */
++ gx_device_procs prn_procs; /* banding playback procedures */
+ };
+
+ #define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */
+@@ -150,7 +202,13 @@
+ FALSE, /* Tumble_set */
+
+ NULL, /* IjsClient *ctx */
+- 0 /* ijs_version */
++ 0, /* ijs_version */
++ 0, /* krgb_mode */
++ 0, /* k_bits */
++ 0, /* k_path */
++ 0, /* k_width */
++ 0, /* k_band_size */
++ NULL /* k_band buffer */
+ };
+
+
+@@ -166,12 +224,299 @@
+
+ /**************************************************************************/
+
+-/* ------ Private definitions ------ */
++/* ---------------- Low-level graphic procedures ---------------- */
++
++static unsigned char xmask[] =
++{
++ 0x80, /* x=0 */
++ 0x40, /* 1 */
++ 0x20, /* 2 */
++ 0x10, /* 3 */
++ 0x08, /* 4 */
++ 0x04, /* 5 */
++ 0x02, /* 6 */
++ 0x01 /* 7 */
++};
++
++private int gsijs_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
++ gx_color_index color)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++
++ if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0)
++ {
++ int raster = (ijsdev->k_width+7) >> 3;
++ register unsigned char *dest;
++ int dest_start_bit;
++ int band_height = ijsdev->k_band_size/raster;
++ int i,j;
++ unsigned char *beg = ijsdev->k_band;
++ unsigned char *end = ijsdev->k_band+ijsdev->k_band_size;
++ unsigned char *p;
++
++ if (h <= 0 || w <= 0)
++ return 0;
++
++ /* Check for out-of-band graphic. */
++ if (x >= ijsdev->k_width || y >= band_height)
++ return 0; /* out-of-band */
++
++ dest_start_bit = x & 7;
++ dest=ijsdev->k_band+(raster*y)+(x >> 3);
++
++ /* Note x,y orgin 0,0 is stored first byte 0 left to right. */
++
++ if (color==0x0)
++ {
++ /* Color is black, store in k plane band instead of regular band. */
++ for (j=0; j<h; j++)
++ {
++ for (i=0; i<w; i++)
++ {
++ p = &dest[(dest_start_bit+i)>>3];
++ if (p >= beg && p <= end)
++ *p |= xmask[(dest_start_bit+i)&7];
++ }
++ dest+=raster;
++ }
++ return 0;
++ }
++ else
++ {
++ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
++ for (j=0; j<h; j++)
++ {
++ for (i=0; i<w; i++)
++ {
++ p = &dest[(dest_start_bit+i)>>3];
++ if (p >= beg && p <= end)
++ *p &= ~xmask[(dest_start_bit+i)&7];
++ }
++ dest+=raster;
++ }
++ }
++ }
++
++ return (*ijsdev->prn_procs.fill_rectangle)(dev, x, y, w, h, color);
++}
++
++private int gsijs_copy_mono(gx_device * dev, const byte * data,
++ int dx, int draster, gx_bitmap_id id,
++ int x, int y, int w, int height, gx_color_index zero, gx_color_index one)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++
++ // if (ijsdev->krgb_mode && ijsdev->k_path && one==0x0)
++ if (ijsdev->krgb_mode && ijsdev->k_path)
++ {
++ /* Store in k plane band instead of regular band. */
++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
++ register unsigned char *dest;
++ register const unsigned char *scan;
++ int dest_start_bit;
++ int scan_start_bit;
++ int band_height = ijsdev->k_band_size/raster;
++ int i,h=height;
++ unsigned char *beg = ijsdev->k_band;
++ unsigned char *end = ijsdev->k_band+ijsdev->k_band_size;
++ unsigned char *p;
++
++ if (h <= 0 || w <= 0)
++ return 0;
++
++ /* Check for out-of-band graphic. */
++ if (x >= ijsdev->k_width || y >= band_height)
++ return 0; /* out-of-band */
++
++ scan=data+(dx >> 3);
++ dest_start_bit = x & 7;
++ scan_start_bit = dx & 7;
++ dest=ijsdev->k_band+(raster*y)+(x >> 3);
++
++ if (one==0x0)
++ {
++ /* Color is black, store in k plane band instead of regular band. */
++ while (h-- > 0)
++ {
++ for (i=0; i<w; i++)
++ {
++ if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
++ {
++ p = &dest[(dest_start_bit+i)>>3];
++ if (p >= beg && p <= end)
++ *p |= xmask[(dest_start_bit+i)&7];
++ }
++ }
++ scan+=draster;
++ dest+=raster;
++ }
++ return 0;
++ }
++ else
++ {
++ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
++ while (h-- > 0)
++ {
++ for (i=0; i<w; i++)
++ {
++ if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
++ {
++ p = &dest[(dest_start_bit+i)>>3];
++ if (p >= beg && p <= end)
++ *p &= ~xmask[(dest_start_bit+i)&7];
++ }
++ }
++ scan+=draster;
++ dest+=raster;
++ }
++ }
++ }
++
++ return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one);
++}
++
++/* ---------------- High-level graphic procedures ---------------- */
++
++private int gsijs_fill_mask(gx_device * dev,
++ const byte * data, int dx, int raster, gx_bitmap_id id,
++ int x, int y, int w, int h,
++ const gx_drawing_color * pdcolor, int depth,
++ gs_logical_operation_t lop, const gx_clip_path * pcpath)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++ int code;
++
++ ijsdev->k_path = 1;
++
++ code = (*ijsdev->prn_procs.fill_mask)(dev, data, dx, raster, id, x, y, w, h, pdcolor, depth, lop, pcpath);
+
+-/* Versions 1.0 through 1.0.2 of hpijs report IJS version 0.29, and
+- require some workarounds. When more up-to-date hpijs versions
+- become ubiquitous, all these workarounds should be removed. */
+-#define HPIJS_1_0_VERSION 29
++ ijsdev->k_path = 0;
++
++ return code;
++}
++
++private int gsijs_fill_path(gx_device * dev, const gs_imager_state * pis,
++ gx_path * ppath, const gx_fill_params * params,
++ const gx_drawing_color * pdcolor,
++ const gx_clip_path * pcpath)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++ int code;
++
++ ijsdev->k_path = 1;
++
++ code = (*ijsdev->prn_procs.fill_path)(dev, pis, ppath, params, pdcolor, pcpath);
++
++ ijsdev->k_path = 0;
++
++ return 0;
++}
++
++private int gsijs_stroke_path(gx_device * dev, const gs_imager_state * pis,
++ gx_path * ppath, const gx_stroke_params * params,
++ const gx_drawing_color * pdcolor,
++ const gx_clip_path * pcpath)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
++ int code;
++
++ ijsdev->k_path = 1;
++
++ code = (*ijsdev->prn_procs.stroke_path)(dev, pis, ppath, params, pdcolor, pcpath);
++
++ ijsdev->k_path = 0;
++
++ return code;
++}
++
++/* ---------------- krgb banding playback procedures ---------------- */
++
++private int gsijs_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
++ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
++ int band_height = cdev->page_info.band_params.BandHeight;
++ int band_number = y/band_height;
++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
++ int y1=raster*(y-(band_height*band_number));
++
++ if (y1 == 0)
++ {
++ /* First raster for band, clear k_band. Banding playback occurs on first raster. */
++ memset(ijsdev->k_band, 0, ijsdev->k_band_size);
++ }
++
++ return gdev_prn_get_bits(pdev, y, str, actual_data); /* get raster from regular band */
++}
++
++private int gsijs_k_get_bits(gx_device_printer * pdev, int y, byte ** actual_data)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
++ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
++ int band_height = cdev->page_info.band_params.BandHeight;
++ int band_number = y/band_height;
++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
++ int y1=raster*(y-(band_height*band_number));
++
++ *actual_data = ijsdev->k_band+y1;
++
++ return 0;
++}
++
++private int gsijs_create_buf_device(gx_device **pbdev, gx_device *target,
++ const gx_render_plane_t *render_plane, gs_memory_t *mem, gx_band_complexity_t *band_complexity)
++{
++ gx_device_ijs *ijsdev = (gx_device_ijs *)target;
++ int n_chan = ijsdev->color_info.num_components;
++ int code = gx_default_create_buf_device(pbdev, target, render_plane, mem, band_complexity);
++ if (code < 0 || n_chan != 3)
++ return code;
++
++ /* Save buffer (vector) procedures so that we can hook them during banding playback. */
++ ijsdev->prn_procs = (*pbdev)->procs;
++
++ /* Replace buffer procedures with krgb procedures. */
++ set_dev_proc(*pbdev, fill_rectangle, gsijs_fill_rectangle);
++ set_dev_proc(*pbdev, copy_mono, gsijs_copy_mono);
++ set_dev_proc(*pbdev, fill_mask, gsijs_fill_mask);
++ set_dev_proc(*pbdev, fill_path, gsijs_fill_path);
++ set_dev_proc(*pbdev, stroke_path, gsijs_stroke_path);
++
++ return code;
++}
++
++/* See if IJS server supports krgb. */
++private int
++gsijs_set_krgb_mode(gx_device_ijs *ijsdev)
++{
++ char buf[256];
++ int n_chan = ijsdev->color_info.num_components;
++ int code;
++
++ ijsdev->krgb_mode = 0; /* default is no krgb */
++
++ if (n_chan != 3)
++ return 0; /* no krgb support, not RGB colorspace */
++
++ buf[0] = 0;
++ code = ijs_client_enum_param(ijsdev->ctx, 0, "ColorSpace", buf, sizeof(buf)-1);
++ if (code >= 0)
++ buf[code] = 0;
++ if (strstr(buf, "KRGB") != NULL)
++ {
++ ijsdev->krgb_mode = 1; /* yes KRGB is supported */
++ ijsdev->k_bits = 1; /* KRGB = 1x8x8x8 */
++ }
++ else if (strstr(buf, "KxRGB") != NULL)
++ {
++ ijsdev->krgb_mode = 1; /* yes KRGB is supported */
++ ijsdev->k_bits = 8; /* KRGB = 8x8x8x8 */
++ }
++
++ return 0;
++}
++
++/* ------ Private definitions ------ */
+
+ private int
+ gsijs_parse_wxh (const char *val, int size, double *pw, double *ph)
+@@ -209,34 +554,6 @@
+ }
+
+ /**
+- * gsijs_set_generic_params_hpijs: Set generic IJS parameters.
+- *
+- * This version is specialized for hpijs 1.0 through 1.0.2, and
+- * accommodates a number of quirks.
+- **/
+-private int
+-gsijs_set_generic_params_hpijs(gx_device_ijs *ijsdev)
+-{
+- char buf[256];
+- int code = 0;
+-
+- /* IjsParams, Duplex, and Tumble get set at this point because
+- they may affect margins. */
+- if (ijsdev->IjsParams) {
+- code = gsijs_client_set_param(ijsdev, "IjsParams", ijsdev->IjsParams);
+- }
+-
+- if (code == 0 && ijsdev->Duplex_set) {
+- int duplex_val;
+-
+- duplex_val = ijsdev->Duplex ? (ijsdev->IjsTumble ? 1 : 2) : 0;
+- sprintf (buf, "%d", duplex_val);
+- code = gsijs_client_set_param(ijsdev, "Duplex", buf);
+- }
+- return code;
+-}
+-
+-/**
+ * gsijs_set_generic_params: Set generic IJS parameters.
+ **/
+ private int
+@@ -247,9 +564,6 @@
+ int i, j;
+ char *value;
+
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
+- return gsijs_set_generic_params_hpijs(ijsdev);
+-
+ /* Split IjsParams into separate parameters and send to ijs server */
+ value = NULL;
+ for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
+@@ -290,68 +604,6 @@
+ }
+
+ /**
+- * gsijs_set_margin_params_hpijs: Do margin negotiation with IJS server.
+- *
+- * This version is specialized for hpijs 1.0 through 1.0.2, and
+- * accommodates a number of quirks.
+- **/
+-private int
+-gsijs_set_margin_params_hpijs(gx_device_ijs *ijsdev)
+-{
+- char buf[256];
+- int code = 0;
+-
+- if (code == 0) {
+- sprintf(buf, "%d", ijsdev->width);
+- code = gsijs_client_set_param(ijsdev, "Width", buf);
+- }
+- if (code == 0) {
+- sprintf(buf, "%d", ijsdev->height);
+- code = gsijs_client_set_param(ijsdev, "Height", buf);
+- }
+-
+- if (code == 0) {
+- double printable_width, printable_height;
+- double printable_left, printable_top;
+- float m[4];
+-
+- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableArea",
+- buf, sizeof(buf));
+- if (code == IJS_EUNKPARAM)
+- /* IJS server doesn't support margin negotiations.
+- That's ok. */
+- return 0;
+- else if (code >= 0) {
+- code = gsijs_parse_wxh(buf, code,
+- &printable_width, &printable_height);
+- }
+-
+- if (code == 0) {
+- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableTopLeft",
+- buf, sizeof(buf));
+- if (code == IJS_EUNKPARAM)
+- return 0;
+- else if (code >= 0) {
+- code = gsijs_parse_wxh(buf, code,
+- &printable_left, &printable_top);
+- }
+- }
+-
+- if (code == 0) {
+- m[0] = printable_left;
+- m[1] = ijsdev->MediaSize[1] * (1.0 / 72) -
+- printable_top - printable_height;
+- m[2] = ijsdev->MediaSize[0] * (1.0 / 72) -
+- printable_left - printable_width;
+- m[3] = printable_top;
+- gx_device_set_margins((gx_device *)ijsdev, m, true);
+- }
+- }
+-
+- return code;
+-}
+-
+-/**
+ * gsijs_set_margin_params: Do margin negotiation with IJS server.
+ **/
+ private int
+@@ -362,9 +614,6 @@
+ int i, j;
+ char *value;
+
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
+- return gsijs_set_margin_params_hpijs(ijsdev);
+-
+ /* Split IjsParams into separate parameters and send to ijs server */
+ value = NULL;
+ for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
+@@ -531,12 +780,18 @@
+ char buf[256];
+ bool use_outputfd;
+ int fd = -1;
++ long max_bitmap = ijsdev->space_params.MaxBitmap;
+
+ if (strlen(ijsdev->IjsServer) == 0) {
+ eprintf("ijs server not specified\n");
+ return gs_note_error(gs_error_ioerror);
+ }
+
++ ijsdev->space_params.MaxBitmap = 0; /* force banding */
++
++ /* Set create_buf_device in printer device, so that we can hook the banding playback procedures. */
++ ijsdev->printer_procs.buf_procs.create_buf_device = gsijs_create_buf_device;
++
+ /* Decide whether to use OutputFile or OutputFD. Note: how to
+ determine this is a tricky question, so we just allow the
+ user to set it.
+@@ -551,6 +806,8 @@
+ if (code < 0)
+ return code;
+
++ ijsdev->space_params.MaxBitmap = max_bitmap;
++
+ if (use_outputfd) {
+ /* Note: dup() may not be portable to all interesting IJS
+ platforms. In that case, this branch should be #ifdef'ed out.
+@@ -610,6 +867,9 @@
+ if (code >= 0)
+ code = gsijs_set_margin_params(ijsdev);
+
++ if (code >= 0)
++ code = gsijs_set_krgb_mode(ijsdev);
++
+ return code;
+ }
+
+@@ -690,21 +950,6 @@
+ return min(width, end);
+ }
+
+-private int ijs_all_white(unsigned char *data, int size)
+-{
+- int clean = 1;
+- int i;
+- for (i = 0; i < size; i++)
+- {
+- if (data[i] != 0xFF)
+- {
+- clean = 0;
+- break;
+- }
+- }
+- return clean;
+-}
+-
+ /* Print a page. Don't use normal printer gdev_prn_output_page
+ * because it opens the output file.
+ */
+@@ -715,8 +960,10 @@
+ gx_device_printer *pdev = (gx_device_printer *)dev;
+ int raster = gdev_prn_raster(pdev);
+ int ijs_width, ijs_height;
+- int row_bytes;
++ int row_bytes, k_row_bytes=0;
+ int n_chan = pdev->color_info.num_components;
++ int krgb_mode = ijsdev->krgb_mode;
++ int k_bits = ijsdev->k_bits;
+ unsigned char *data;
+ char buf[256];
+ double xres = pdev->HWResolution[0];
+@@ -732,13 +979,23 @@
+
+ /* Determine bitmap width and height */
+ ijs_height = gdev_prn_print_scan_lines(dev);
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) {
+- ijs_width = pdev->width;
+- } else {
+ ijs_width = gsijs_raster_width(dev);
+- }
++
+ row_bytes = (ijs_width * pdev->color_info.depth + 7) >> 3;
+
++ if (krgb_mode)
++ {
++ gx_device_clist_common *cdev = (gx_device_clist_common *)dev;
++ int band_height = cdev->page_info.band_params.BandHeight;
++ k_row_bytes = (ijs_width + 7) >> 3;
++
++ /* Create banding buffer for k plane. */
++ ijsdev->k_width = ijs_width;
++ ijsdev->k_band_size = band_height * k_row_bytes;
++ if ((ijsdev->k_band = gs_malloc(pdev->memory, ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL)
++ return gs_note_error(gs_error_VMerror);
++ }
++
+ /* Required page parameters */
+ sprintf(buf, "%d", n_chan);
+ gsijs_client_set_param(ijsdev, "NumChan", buf);
+@@ -747,44 +1004,71 @@
+
+ /* This needs to become more sophisticated for DeviceN. */
+ strcpy(buf, (n_chan == 4) ? "DeviceCMYK" :
+- ((n_chan == 3) ? "DeviceRGB" : "DeviceGray"));
++ ((n_chan == 3) ? (krgb_mode ? ((k_bits == 1) ? "KRGB" : "KxRGB") : "DeviceRGB") : "DeviceGray"));
+ gsijs_client_set_param(ijsdev, "ColorSpace", buf);
+
+- /* If hpijs 1.0, don't set width and height here, because it
+- expects them to be the paper size. */
+- if (ijsdev->ijs_version != HPIJS_1_0_VERSION) {
+- sprintf(buf, "%d", ijs_width);
+- gsijs_client_set_param(ijsdev, "Width", buf);
+- sprintf(buf, "%d", ijs_height);
+- gsijs_client_set_param(ijsdev, "Height", buf);
+- }
++ sprintf(buf, "%d", ijs_width);
++ gsijs_client_set_param(ijsdev, "Width", buf);
++ sprintf(buf, "%d", ijs_height);
++ gsijs_client_set_param(ijsdev, "Height", buf);
+
+ sprintf(buf, "%gx%g", xres, yres);
+ gsijs_client_set_param(ijsdev, "Dpi", buf);
+
++#ifdef KRGB_DEBUG
++ int kfd, rgbfd;
++ char sz[128];
++ kfd = open("/tmp/k.pbm", O_CREAT | O_TRUNC | O_RDWR, 0644);
++ rgbfd = open("/tmp/rgb.ppm", O_CREAT | O_TRUNC | O_RDWR, 0644);
++ snprintf(sz, sizeof(sz), "P4\n#gdevijs test\n%d\n%d\n", ijs_width, ijs_height);
++ write(kfd, sz, strlen(sz));
++ snprintf(sz, sizeof(sz), "P6\n#gdevijs test\n%d\n%d\n255\n", ijs_width, ijs_height);
++ write(rgbfd, sz, strlen(sz));
++#endif
++
+ for (i=0; i<num_copies; i++) {
+ unsigned char *actual_data;
+ ijs_client_begin_cmd (ijsdev->ctx, IJS_CMD_BEGIN_PAGE);
+ status = ijs_client_send_cmd_wait(ijsdev->ctx);
+
+ for (y = 0; y < ijs_height; y++) {
+- code = gdev_prn_get_bits(pdev, y, data, &actual_data);
+- if (code < 0)
+- break;
++ if (krgb_mode)
++ code = gsijs_get_bits(pdev, y, data, &actual_data);
++ else
++ code = gdev_prn_get_bits(pdev, y, data, &actual_data);
++ if (code < 0)
++ break;
++#ifdef KRGB_DEBUG
++ write(rgbfd, actual_data, row_bytes);
++#endif
++ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, row_bytes);
++ if (status)
++ break;
+
+- if (ijsdev->ijs_version == HPIJS_1_0_VERSION &&
+- ijs_all_white(actual_data, row_bytes))
+- status = ijs_client_send_data_wait(ijsdev->ctx, 0, NULL, 0);
+- else
+- status = ijs_client_send_data_wait(ijsdev->ctx, 0,
+- (char *)actual_data, row_bytes);
+- if (status)
+- break;
++ if (krgb_mode) {
++ code = gsijs_k_get_bits(pdev, y, &actual_data);
++ if (code < 0)
++ break;
++#ifdef KRGB_DEBUG
++ write(kfd, actual_data, k_row_bytes);
++#endif
++ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, k_row_bytes);
++ if (status)
++ break;
++ }
+ }
+ ijs_client_begin_cmd(ijsdev->ctx, IJS_CMD_END_PAGE);
+ status = ijs_client_send_cmd_wait(ijsdev->ctx);
+ }
+
++#ifdef KRGB_DEBUG
++ close(kfd);
++ close(rgbfd);
++#endif
++
++ if(krgb_mode)
++ gs_free(pdev->memory, ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page");
++
+ gs_free_object(pdev->memory, data, "gsijs_output_page");
+
+ endcode = (pdev->buffer_space && !pdev->is_async_renderer ?
+@@ -1090,7 +1374,6 @@
+ dprintf2("ijs: Can't set parameter %s=%s\n", key, value);
+ return code;
+ }
+-
+
+ private int
+ gsijs_set_color_format(gx_device_ijs *ijsdev)
diff --git a/app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch b/app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch
new file mode 100644
index 000000000000..8cd701c3b2e5
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/ghostscript-8.60-multilib.patch
@@ -0,0 +1,25 @@
+--- ghostscript-8.60-r8112/ijs/ijs-config.in.multilib 2002-01-31 19:09:46.000000000 +0000
++++ ghostscript-8.60-r8112/ijs/ijs-config.in 2007-07-10 17:46:44.000000000 +0100
+@@ -43,8 +43,7 @@
+ echo $includes
+ ;;
+ --libs)
+- libdirs=-L@libdir@
+- echo $libdirs -lijs
++ echo -lijs
+ ;;
+ *)
+ echo "${usage}" 1>&2
+--- ghostscript-8.60-r8112/ijs/Makefile.am.multilib 2007-07-10 18:00:36.000000000 +0100
++++ ghostscript-8.60-r8112/ijs/Makefile.am 2007-07-10 18:00:39.000000000 +0100
+@@ -34,7 +34,7 @@
+
+ pkgincludedir=$(includedir)/ijs
+ m4datadir = $(datadir)/aclocal
+-pkgconfigdatadir = $(prefix)/lib/pkgconfig
++pkgconfigdatadir = $(libdir)/pkgconfig
+
+ lib_LTLIBRARIES = libijs.la
+
+
+
diff --git a/app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch b/app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch
new file mode 100644
index 000000000000..3a93580e0346
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/ghostscript-8.60-noopt.patch
@@ -0,0 +1,11 @@
+--- ghostscript-7.07/src/int.mak.noopt 2005-03-10 17:22:53.000000000 +0000
++++ ghostscript-7.07/src/int.mak 2005-03-10 17:24:10.000000000 +0000
+@@ -105,7 +105,7 @@
+ $(PSOBJ)igcref.$(OBJ) : $(PSSRC)igcref.c $(GH) $(memory__h)\
+ $(gsexit_h) $(gsstruct_h)\
+ $(iastate_h) $(idebug_h) $(igc_h) $(iname_h) $(ipacked_h) $(store_h)
+- $(PSCC) $(PSO_)igcref.$(OBJ) $(C_) $(PSSRC)igcref.c
++ $(PSCC) -O0 $(PSO_)igcref.$(OBJ) $(C_) $(PSSRC)igcref.c
+
+ $(PSOBJ)igcstr.$(OBJ) : $(PSSRC)igcstr.c $(GH) $(memory__h)\
+ $(gsmdebug_h) $(gsstruct_h) $(iastate_h) $(igcstr_h)
diff --git a/app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch b/app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch
new file mode 100644
index 000000000000..9a495f3dbf52
--- /dev/null
+++ b/app-text/ghostscript-gpl/files/ghostscript-8.60-scripts.patch
@@ -0,0 +1,29 @@
+--- ghostscript-8.60-r8112/lib/pv.sh.scripts 2007-07-05 11:41:52.000000000 +0100
++++ ghostscript-8.60-r8112/lib/pv.sh 2007-07-10 16:08:47.000000000 +0100
+@@ -31,7 +31,7 @@
+ GS_EXECUTABLE=gs
+
+ TEMPDIR=.
+-PAGE=$1
++PAGE="$1"
+ shift
+ FILE="$1"
+ shift
+@@ -44,7 +44,7 @@
+ tmpfile="$TEMPDIR/$FILE.$$.pv"
+ fi
+ trap "rm -rf $tmpfile" 0 1 2 15
+-#dvips -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
+-dvips -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
++#dvips -R -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
++dvips -R -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
+ $GS_EXECUTABLE $tmpfile
+ exit 0
+--- ghostscript-8.60-r8112/lib/dvipdf.scripts 2007-07-10 16:08:57.000000000 +0100
++++ ghostscript-8.60-r8112/lib/dvipdf 2007-07-10 16:09:17.000000000 +0100
+@@ -44,4 +44,4 @@
+
+ # We have to include the options twice because -I only takes effect if it
+ # appears before other options.
+-exec dvips $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
++exec dvips -R $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
diff --git a/app-text/ghostscript-gpl/ghostscript-gpl-8.60.ebuild b/app-text/ghostscript-gpl/ghostscript-gpl-8.60.ebuild
new file mode 100644
index 000000000000..7e27ee277099
--- /dev/null
+++ b/app-text/ghostscript-gpl/ghostscript-gpl-8.60.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ghostscript-gpl-8.60.ebuild,v 1.1 2007/10/17 22:00:44 tgurr Exp $
+
+inherit autotools elisp-common eutils versionator flag-o-matic
+
+DESCRIPTION="GPL Ghostscript - the most current Ghostscript, AFPL, relicensed"
+HOMEPAGE="http://ghostscript.com"
+
+MY_P=${P/-gpl}
+GSDJVU_PV=1.2
+PVM=$(get_version_component_range 1-2)
+SRC_URI="cjk? ( ftp://ftp.gyve.org/pub/gs-cjk/adobe-cmaps-200406.tar.gz
+ ftp://ftp.gyve.org/pub/gs-cjk/acro5-cmaps-2001.tar.gz )
+ !bindist? ( djvu? ( mirror://sourceforge/djvu/gsdjvu-${GSDJVU_PV}.tar.gz ) )
+ mirror://sourceforge/ghostscript/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2 CPL-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="bindist cjk cups djvu gtk jpeg2k X"
+
+COMMON_DEPEND="virtual/libc
+ >=media-libs/jpeg-6b
+ >=sys-libs/zlib-1.1.4
+ >=media-libs/tiff-3.7
+ X? ( x11-libs/libXt x11-libs/libXext )
+ !bindist? ( djvu? ( app-text/djvu ) )
+ gtk? ( >=x11-libs/gtk+-2.0 )
+ cups? ( >=net-print/cups-1.1.20 )
+ jpeg2k? ( media-libs/jasper )
+ !app-text/ghostscript-esp
+ !app-text/ghostscript-gnu"
+
+DEPEND="${COMMON_DEPEND}
+ dev-util/pkgconfig"
+
+RDEPEND="${COMMON_DEPEND}
+ cjk? ( media-fonts/arphicfonts
+ media-fonts/kochi-substitute
+ media-fonts/baekmuk-fonts )
+ media-fonts/gnu-gs-fonts-std"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${A/adobe-cmaps-200406.tar.gz acro5-cmaps-2001.tar.gz}
+ if use cjk ; then
+ cat "${FILESDIR}/ghostscript-esp-8.15.2-cidfmap.cjk" >> "${S}/lib/cidfmap"
+ cat "${FILESDIR}/ghostscript-esp-8.15.2-FAPIcidfmap.cjk" >> "${S}/lib/FAPIcidfmap"
+ cd "${S}/Resource"
+ unpack adobe-cmaps-200406.tar.gz
+ unpack acro5-cmaps-2001.tar.gz
+ cd "${WORKDIR}"
+ fi
+
+ cd "${S}"
+
+ # Fedora patches
+ # upstream bug http://bugs.ghostscript.com/show_bug.cgi?id=689393
+ epatch "${FILESDIR}/ghostscript-8.60-ijs-krgb.patch"
+ epatch "${FILESDIR}/ghostscript-8.60-fPIC.patch"
+ epatch "${FILESDIR}/ghostscript-8.60-multilib.patch"
+ epatch "${FILESDIR}/ghostscript-8.60-noopt.patch"
+ epatch "${FILESDIR}/ghostscript-8.60-scripts.patch"
+
+ # additional Gentoo patches
+ epatch "${FILESDIR}/ghostscript-afpl-8.54-rinkj.patch"
+
+ if use bindist && use djvu ; then
+ ewarn "You have bindist in your USE, djvu support will NOT be compiled!"
+ ewarn "See http://djvu.sourceforge.net/gsdjvu/COPYING for details on licensing issues."
+ fi
+
+ if ! use bindist && use djvu ; then
+ unpack gsdjvu-${GSDJVU_PV}.tar.gz
+ cp gsdjvu-${GSDJVU_PV}/gsdjvu "${S}"
+ cp gsdjvu-${GSDJVU_PV}/gdevdjvu.c "${S}/src"
+ epatch "${FILESDIR}/djvu-gs-gpl-8.60.patch"
+ cp gsdjvu-${GSDJVU_PV}/ps2utf8.ps "${S}/lib"
+ cp "${S}/src/contrib.mak" "${S}/src/contrib.mak.gsdjvu"
+ grep -q djvusep "${S}/src/contrib.mak" || \
+ cat gsdjvu-${GSDJVU_PV}/gsdjvu.mak >> "${S}/src/contrib.mak"
+ fi
+
+ sed -i -e "s:#if 1:#if 0:" "${S}/contrib/gdevhl12.c" || die "sed failed"
+
+ if ! use gtk ; then
+ sed -i "s:\$(GSSOX)::" src/*.mak || die "gsx sed failed"
+ sed -i "s:.*\$(GSSOX_XENAME)$::" src/*.mak || die "gsxso sed failed"
+ fi
+
+ # search path fix
+ sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/${PVM}/$(get_libdir):" \
+ -e 's:$(gsdir)/fonts:/usr/share/fonts/default/ghostscript/:' \
+ -e "s:exdir=.*:exdir=/usr/share/doc/${PF}/examples:" \
+ -e "s:docdir=.*:docdir=/usr/share/doc/${PF}/html:" \
+ -e "s:GS_DOCDIR=.*:GS_DOCDIR=/usr/share/doc/${PF}/html:" \
+ src/Makefile.in src/*.mak || die "sed failed"
+}
+
+src_compile() {
+ econf \
+ $(use_with X x) \
+ $(use_with jpeg2k jasper) \
+ $(use_enable cups) \
+ $(use_enable gtk) \
+ --enable-dynamic \
+ --with-ijs \
+ --with-drivers=ALL,rinkj \
+ --with-jbig2dec \
+ || die "econf failed"
+
+ if ! use bindist && use djvu ; then
+ sed -i -e 's!$(DD)bbox.dev!& $(DD)djvumask.dev $(DD)djvusep.dev!g' Makefile
+ sed -i -e 's:(/\(Resource/[a-zA-Z/]*\)):(\1) findlibfile {pop} {pop &}
+ ifelse:' lib/gs_res.ps
+ fi
+
+ emake -j1 so all || die "emake failed"
+
+ cd "${S}/ijs"
+ econf || die "ijs econf failed"
+ emake || die "ijs emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ if ! use bindist && use djvu ; then
+ dobin gsdjvu || die "dobin gsdjvu install failed"
+ fi
+
+ rm -fr "${D}/usr/share/doc/${PF}/html/"{README,PUBLIC}
+ dodoc doc/README || die "dodoc install failed"
+
+ cd "${S}/ijs"
+ emake DESTDIR="${D}" install || die "emake ijs install failed"
+}