summaryrefslogtreecommitdiff
path: root/print/web2c
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2011-01-16 15:07:16 +0000
committerwiz <wiz@pkgsrc.org>2011-01-16 15:07:16 +0000
commit6ad869d29d5cf5afed6ae7af1f654bfe479561f4 (patch)
tree131ff9f5016c7721cd3f67f0924316980f651f98 /print/web2c
parentcb3c4d302357356a2861281ae469d18e6222511b (diff)
downloadpkgsrc-6ad869d29d5cf5afed6ae7af1f654bfe479561f4.tar.gz
Partial fix for building with png-1.5. (Need to find out how to
handle png->transformations.)
Diffstat (limited to 'print/web2c')
-rw-r--r--print/web2c/distinfo4
-rw-r--r--print/web2c/patches/patch-aa24
-rw-r--r--print/web2c/patches/patch-ab98
3 files changed, 125 insertions, 1 deletions
diff --git a/print/web2c/distinfo b/print/web2c/distinfo
index 880c148837e..0af26ff3b31 100644
--- a/print/web2c/distinfo
+++ b/print/web2c/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.8 2010/09/24 21:54:56 minskim Exp $
+$NetBSD: distinfo,v 1.9 2011/01/16 15:07:16 wiz Exp $
SHA1 (texlive-20100720-source.tar.xz) = 713b861123e3d9e073e2c93d7ed3e13262d82c34
RMD160 (texlive-20100720-source.tar.xz) = b1120f3377ca45b4d86911b99a95c2e6e45927b5
Size (texlive-20100720-source.tar.xz) = 33484212 bytes
+SHA1 (patch-aa) = f28a82082bbec5385480fc4b7b6a61904536b287
+SHA1 (patch-ab) = 14ca4c8610415f29975fcdda131b183ab08639f1
SHA1 (patch-am) = c6c08e8c1bace8e93eb737f64f2d2f5128db0bfd
diff --git a/print/web2c/patches/patch-aa b/print/web2c/patches/patch-aa
new file mode 100644
index 00000000000..35386f38ed5
--- /dev/null
+++ b/print/web2c/patches/patch-aa
@@ -0,0 +1,24 @@
+$NetBSD: patch-aa,v 1.3 2011/01/16 15:07:16 wiz Exp $
+
+Fix to build with png-1.5.
+
+--- pdftexdir/writeimg.c.orig 2010-05-02 13:21:48.000000000 +0000
++++ pdftexdir/writeimg.c
+@@ -137,7 +137,7 @@ integer imagecolordepth(integer img)
+ {
+ switch (img_type(img)) {
+ case IMAGE_TYPE_PNG:
+- return png_info(img)->bit_depth;
++ return png_get_bit_depth(png_ptr(img), png_info(img));
+ case IMAGE_TYPE_JPG:
+ return jpg_ptr(img)->bits_per_component;
+ case IMAGE_TYPE_JBIG2:
+@@ -389,7 +389,7 @@ void deleteimage(integer img)
+ epdf_delete();
+ break;
+ case IMAGE_TYPE_PNG:
+- xfclose((FILE *) png_ptr(img)->io_ptr, cur_file_name);
++ xfclose((FILE *) png_get_io_ptr(png_ptr(img)), cur_file_name);
+ png_destroy_read_struct(&(png_ptr(img)), &(png_info(img)), NULL);
+ break;
+ case IMAGE_TYPE_JPG:
diff --git a/print/web2c/patches/patch-ab b/print/web2c/patches/patch-ab
new file mode 100644
index 00000000000..bf786af1cb3
--- /dev/null
+++ b/print/web2c/patches/patch-ab
@@ -0,0 +1,98 @@
+$NetBSD: patch-ab,v 1.3 2011/01/16 15:07:16 wiz Exp $
+
+Incomplete fix to build with png-1.5.
+
+--- pdftexdir/writepng.c.orig 2010-06-22 15:35:42.000000000 +0000
++++ pdftexdir/writepng.c
+@@ -33,7 +33,6 @@ Franklin Street, Fifth Floor, Boston, MA
+ #define png_height(N) png_get_image_height(png_ptr(N), png_info(N))
+ #define png_interlace_type(N) png_get_interlace_type(png_ptr(N), png_info(N))
+ #define png_io_ptr(N) png_get_io_ptr(png_ptr(N))
+-#define png_num_palette(N) png_info(N)->num_palette
+ #define png_palette(N) png_info(N)->palette
+ #define png_rowbytes(N) png_get_rowbytes(png_ptr(N), png_info(N))
+ #define png_transformations(N) png_ptr(N)->transformations
+@@ -50,7 +49,6 @@ Franklin Street, Fifth Floor, Boston, MA
+ #define png_height(N) png_info(N)->height
+ #define png_interlace_type(N) png_info(N)->interlace_type
+ #define png_io_ptr(N) png_ptr(N)->io_ptr
+-#define png_num_palette(N) png_info(N)->num_palette
+ #define png_palette(N) png_info(N)->palette
+ #define png_rowbytes(N) png_info(N)->rowbytes
+ #define png_transformations(N) png_ptr(N)->transformations
+@@ -201,14 +199,18 @@ static void write_png_palette(integer im
+ int i, j, k, l;
+ png_bytep row, r, *rows;
+ integer palette_objnum = 0;
++ png_colorp palette;
++ int num_palette;
++
++ png_get_PLTE(png_ptr(img), png_info(img), &palette, &num_palette);
++
+ pdfcreateobj(0, 0);
+ palette_objnum = objptr;
+ if (img_colorspace_ref(img) != 0) {
+ pdf_printf("%i 0 R\n", (int) img_colorspace_ref(img));
+ } else {
+ pdf_printf("[/Indexed /DeviceRGB %i %i 0 R]\n",
+- (int) (png_num_palette(img) - 1),
+- (int) palette_objnum);
++ num_palette -1, (int) palette_objnum);
+ }
+ pdfbeginstream();
+ if (png_interlace_type(img) == PNG_INTERLACE_NONE) {
+@@ -230,11 +232,11 @@ static void write_png_palette(integer im
+ if (palette_objnum > 0) {
+ pdfbegindict(palette_objnum, 0);
+ pdfbeginstream();
+- for (i = 0; (unsigned) i < png_num_palette(img); i++) {
++ for (i = 0; (unsigned) i < num_palette; i++) {
+ pdfroom(3);
+- pdfbuf[pdfptr++] = png_palette(img)[i].red;
+- pdfbuf[pdfptr++] = png_palette(img)[i].green;
+- pdfbuf[pdfptr++] = png_palette(img)[i].blue;
++ pdfbuf[pdfptr++] = palette[i].red;
++ pdfbuf[pdfptr++] = palette[i].green;
++ pdfbuf[pdfptr++] = palette[i].blue;
+ }
+ pdfendstream();
+ }
+@@ -553,7 +555,12 @@ void write_png(integer img)
+ double gamma, checked_gamma;
+ int i;
+ integer palette_objnum = 0;
++ png_colorp palette;
++ int num_palette;
+ last_png_needs_page_group = false;
++
++ png_get_PLTE(png_ptr(img), png_info(img), &palette, &num_palette);
++
+ if (fixedpdfminorversion < 5)
+ fixedimagehicolor = 0;
+
+@@ -590,8 +597,7 @@ void write_png(integer img)
+ pdfcreateobj(0, 0);
+ palette_objnum = objptr;
+ pdf_printf("[/Indexed /DeviceRGB %i %i 0 R]\n",
+- (int) (png_num_palette(img) - 1),
+- (int) palette_objnum);
++ num_palette - 1, (int) palette_objnum);
+ break;
+ case PNG_COLOR_TYPE_GRAY:
+ pdf_puts("/DeviceGray\n");
+@@ -605,11 +611,11 @@ void write_png(integer img)
+ if (palette_objnum > 0) {
+ pdfbegindict(palette_objnum, 0);
+ pdfbeginstream();
+- for (i = 0; i < png_num_palette(img); i++) {
++ for (i = 0; i < num_palette; i++) {
+ pdfroom(3);
+- pdfbuf[pdfptr++] = png_palette(img)[i].red;
+- pdfbuf[pdfptr++] = png_palette(img)[i].green;
+- pdfbuf[pdfptr++] = png_palette(img)[i].blue;
++ pdfbuf[pdfptr++] = palette[i].red;
++ pdfbuf[pdfptr++] = palette[i].green;
++ pdfbuf[pdfptr++] = palette[i].blue;
+ }
+ pdfendstream();
+ }