packages: XmHTML/XmHTML.spec, XmHTML/XmHTML-libpng.patch (NEW)=?UTF-8?Q?=20?=- added libp...
qboosh
qboosh at pld-linux.org
Sun Feb 12 17:40:24 CET 2012
Author: qboosh Date: Sun Feb 12 16:40:24 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- added libpng patch (fixes build with libpng 1.5.x)
---- Files affected:
packages/XmHTML:
XmHTML.spec (1.41 -> 1.42) , XmHTML-libpng.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/XmHTML/XmHTML.spec
diff -u packages/XmHTML/XmHTML.spec:1.41 packages/XmHTML/XmHTML.spec:1.42
--- packages/XmHTML/XmHTML.spec:1.41 Sat Feb 11 00:53:07 2012
+++ packages/XmHTML/XmHTML.spec Sun Feb 12 17:40:19 2012
@@ -10,6 +10,7 @@
# Source0-md5: 6d079435fb954bb7878f4dd0d3f7b8d8
Patch0: %{name}-am.patch
Patch1: %{name}-macro.patch
+Patch2: %{name}-libpng.patch
URL: http://www.xs4all.nl/~ripley/XmHTML/
BuildRequires: autoconf
BuildRequires: automake
@@ -60,6 +61,7 @@
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
# Argh! automake stuff outdated, imake stuff outdated even more,
# makefiles not outdated but don't support shared libraries :/
# Use automake with some patches/workarounds/etc
@@ -125,6 +127,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.42 2012/02/12 16:40:19 qboosh
+- added libpng patch (fixes build with libpng 1.5.x)
+
Revision 1.41 2012/02/10 23:53:07 adamg
- move files in %prep, not in %build (breaks short-circuit builds)
================================================================
Index: packages/XmHTML/XmHTML-libpng.patch
diff -u /dev/null packages/XmHTML/XmHTML-libpng.patch:1.1
--- /dev/null Sun Feb 12 17:40:24 2012
+++ packages/XmHTML/XmHTML-libpng.patch Sun Feb 12 17:40:19 2012
@@ -0,0 +1,166 @@
+--- XmHTML-1.1.7/lib/common/readPNG.c.orig 1998-11-16 23:56:19.000000000 +0100
++++ XmHTML-1.1.7/lib/common/readPNG.c 2012-02-12 17:27:36.741501024 +0100
+@@ -132,7 +132,7 @@
+
+ _XmHTMLWarning(__WFUNC__(NULL, "png_error"), XMHTML_MSG_121, "png",
+ ib->file, msg);
+- longjmp(png_ptr->jmpbuf, 1);
++ longjmp(png_jmpbuf(png_ptr), 1);
+ }
+
+ /*****
+@@ -184,9 +184,11 @@
+ int i, idx, npass;
+ int width, height, color_type;
+ int ncolors, max_colors;
+- float gamma, fg_gamma;
++ float gamma;
++ double fg_gamma;
+ Boolean has_alpha = False, has_cmap = False, do_gamma = True;
+ png_bytep *row_ptrs;
++ png_colorp palette;
+ char msg[128];
+ static XmHTMLRawImageData *img_data;
+
+@@ -232,7 +234,7 @@
+ return((XmHTMLRawImageData*)NULL);
+ }
+ /* now set error handler */
+- if(setjmp(png_ptr->jmpbuf))
++ if(setjmp(png_jmpbuf(png_ptr)))
+ {
+ /*
+ * PNG signalled an error. Destroy image data, free any allocated
+@@ -265,17 +267,18 @@
+ ResetRawImage(img_data);
+
+ /* save width & height */
+- width = img_data->width = info_ptr->width;
+- height = img_data->height = info_ptr->height;
++ width = img_data->width = png_get_image_width(png_ptr, info_ptr);
++ height = img_data->height = png_get_image_height(png_ptr, info_ptr);
+
+ /* image depth */
+- ib->depth = info_ptr->bit_depth;
++ ib->depth = png_get_bit_depth(png_ptr, info_ptr);
+
+ /* no of colors */
+- ncolors = img_data->cmapsize = info_ptr->num_palette;
++ png_get_PLTE(png_ptr, info_ptr, &palette, &ncolors);
++ img_data->cmapsize = ncolors;
+
+ /* type of image */
+- color_type = info_ptr->color_type;
++ color_type = png_get_color_type(png_ptr, info_ptr);
+
+ /*
+ * The fun stuff. This is based on readPNG by Greg Roelofs as found
+@@ -306,7 +309,7 @@
+ * Actual image creation is postponed until the image is
+ * needed.
+ */
+- if(info_ptr->valid & PNG_INFO_tRNS)
++ if(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
+ {
+ _XmHTMLDebug(15, ("readPNG.c: tRNS chunk present\n"));
+ png_set_expand(png_ptr);
+@@ -319,9 +322,9 @@
+ AllocRawImageCmap(img_data, ncolors);
+ for(i = 0; i < ncolors; i++)
+ {
+- GETR(img_data->cmap[i]) = info_ptr->palette[i].red;
+- GETG(img_data->cmap[i]) = info_ptr->palette[i].green;
+- GETB(img_data->cmap[i]) = info_ptr->palette[i].blue;
++ GETR(img_data->cmap[i]) = palette[i].red;
++ GETG(img_data->cmap[i]) = palette[i].green;
++ GETB(img_data->cmap[i]) = palette[i].blue;
+ }
+ has_cmap = True;
+ data = (Byte*)malloc(width*height*sizeof(Byte));
+@@ -355,7 +358,7 @@
+ * grayscale with transparency is expanded to RGB with alpha
+ * channel.
+ */
+- if(info_ptr->valid & PNG_INFO_tRNS)
++ if(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
+ {
+ _XmHTMLDebug(15, ("readPNG.c: tRNS chunk present\n"));
+ png_set_gray_to_rgb(png_ptr);
+@@ -434,7 +437,7 @@
+ break;
+ default:
+ sprintf(msg, "bad PNG image: unknown color type (%d)",
+- info_ptr->color_type);
++ png_get_color_type(png_ptr, info_ptr));
+ my_png_error(png_ptr, msg);
+ break;
+ }
+@@ -444,15 +447,17 @@
+ * Doing that for alpha channel images would change the colortype of the
+ * current image, leading to weird results.
+ */
+- if(!has_alpha && info_ptr->valid & PNG_INFO_bKGD)
++ if(!has_alpha && png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD))
+ {
+- png_set_background(png_ptr, &(info_ptr->background),
++ png_color_16p background;
++ png_get_bKGD(png_ptr, info_ptr, &background);
++ png_set_background(png_ptr, background,
+ PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
+- img_data->bg = info_ptr->background.index;
++ img_data->bg = background->index;
+ }
+
+ /* handle gamma correction */
+- if(info_ptr->valid & PNG_INFO_gAMA)
+- fg_gamma = info_ptr->gamma;
++ if(png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA))
++ png_get_gAMA(png_ptr, info_ptr, &fg_gamma);
+ else
+ fg_gamma = 0.45;
+@@ -464,20 +469,20 @@
+ /* dithering gets handled by caller */
+
+ /* one byte per pixel */
+- if(info_ptr->bit_depth < 8)
++ if(png_get_bit_depth(png_ptr, info_ptr) < 8)
+ png_set_packing(png_ptr);
+
+ /* no tRNS chunk handling, we've expanded it to an alpha channel. */
+
+ /* handle interlacing */
+- if(info_ptr->interlace_type)
++ if(png_get_interlace_type(png_ptr, info_ptr))
+ npass = png_set_interlace_handling(png_ptr);
+
+ /* and now update everything */
+ png_read_update_info(png_ptr, info_ptr);
+
+ /* has possibly changed if we have promoted GrayScale or tRNS chunks */
+- color_type = info_ptr->color_type;
++ color_type = png_get_color_type(png_ptr, info_ptr);
+
+ /* new color_type? */
+ if(color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+@@ -497,10 +502,10 @@
+ * will call doAlphaChannel to do the actual image creation.
+ */
+ row_ptrs = (png_bytep*)malloc(height*sizeof(png_bytep));
+- png_data = (png_bytep)malloc(height*info_ptr->rowbytes);
++ png_data = (png_bytep)malloc(height*png_get_rowbytes(png_ptr, info_ptr));
+
+ for(i = 0; i < height; i++)
+- row_ptrs[i] = (png_bytep)png_data + i*info_ptr->rowbytes;
++ row_ptrs[i] = (png_bytep)png_data + i*png_get_rowbytes(png_ptr, info_ptr);
+
+ /* read it */
+ png_read_image(png_ptr, row_ptrs);
+@@ -529,7 +534,7 @@
+ row_ptrs = (png_bytep*)malloc(height*sizeof(png_bytep));
+
+ for(i = 0; i < height; ++i)
+- row_ptrs[i] = (png_bytep)data + i*info_ptr->rowbytes;
++ row_ptrs[i] = (png_bytep)data + i*png_get_rowbytes(png_ptr, info_ptr);
+
+ /* read it */
+ png_read_image(png_ptr, row_ptrs);
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/XmHTML/XmHTML.spec?r1=1.41&r2=1.42&f=u
More information about the pld-cvs-commit
mailing list