summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2011-10-05 14:00:05 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2011-10-05 14:00:05 +0000
commit9896cb1a6027e147a16cf0aa981e3f112243fd43 (patch)
treeab27f15f54e0639cd6cd984b486137228fa1035d /app-text/htmldoc
parentremove old (diff)
downloadgentoo-2-9896cb1a6027e147a16cf0aa981e3f112243fd43.tar.gz
gentoo-2-9896cb1a6027e147a16cf0aa981e3f112243fd43.tar.bz2
gentoo-2-9896cb1a6027e147a16cf0aa981e3f112243fd43.zip
Fix building with libpng15 wrt #385521
(Portage version: 2.2.0_alpha60/cvs/Linux x86_64)
Diffstat (limited to 'app-text/htmldoc')
-rw-r--r--app-text/htmldoc/ChangeLog6
-rw-r--r--app-text/htmldoc/files/htmldoc-libpng15.patch116
-rw-r--r--app-text/htmldoc/htmldoc-1.8.27-r2.ebuild8
3 files changed, 126 insertions, 4 deletions
diff --git a/app-text/htmldoc/ChangeLog b/app-text/htmldoc/ChangeLog
index 13b6cd4cf60a..0fec292feeff 100644
--- a/app-text/htmldoc/ChangeLog
+++ b/app-text/htmldoc/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for app-text/htmldoc
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/htmldoc/ChangeLog,v 1.59 2011/07/20 15:44:40 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/htmldoc/ChangeLog,v 1.60 2011/10/05 14:00:05 ssuominen Exp $
+
+ 05 Oct 2011; Samuli Suominen <ssuominen@gentoo.org>
+ +files/htmldoc-libpng15.patch, htmldoc-1.8.27-r2.ebuild:
+ Fix building with libpng15 wrt #385521
20 Jul 2011; Pacho Ramos <pacho@gentoo.org> metadata.xml:
Drop maintainer due retirement, bug #47265
diff --git a/app-text/htmldoc/files/htmldoc-libpng15.patch b/app-text/htmldoc/files/htmldoc-libpng15.patch
new file mode 100644
index 000000000000..7b834c304d26
--- /dev/null
+++ b/app-text/htmldoc/files/htmldoc-libpng15.patch
@@ -0,0 +1,116 @@
+http://bugs.gentoo.org/385521
+http://www.htmldoc.org/str.php?L243+P0+S-2+C0+I0+E0+M10+Q
+
+--- htmldoc/image.cxx
++++ htmldoc/image.cxx
+@@ -1472,6 +1472,9 @@ image_load_png(image_t *img, /* I - Imag
+ png_bytep *rows; /* PNG row pointers */
+ uchar *inptr, /* Input pixels */
+ *outptr; /* Output pixels */
++ png_bytep trans_alpha;
++ int num_trans;
++ png_color_16p trans_color;
+
+
+ /*
+@@ -1499,7 +1502,7 @@ image_load_png(image_t *img, /* I - Imag
+
+ rows = NULL;
+
+- if (setjmp(pp->jmpbuf))
++ if (setjmp(png_jmpbuf(pp)))
+ {
+ progress_error(HD_ERROR_BAD_FORMAT, "PNG file contains errors!");
+
+@@ -1526,7 +1529,7 @@ image_load_png(image_t *img, /* I - Imag
+
+ png_read_info(pp, info);
+
+- if (info->color_type & PNG_COLOR_MASK_PALETTE)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE)
+ {
+ png_set_expand(pp);
+
+@@ -1535,15 +1538,15 @@ image_load_png(image_t *img, /* I - Imag
+ if (Encryption)
+ img->use ++;
+ }
+- else if (info->bit_depth < 8)
++ else if (png_get_bit_depth(pp, info) < 8)
+ {
+ png_set_packing(pp);
+ png_set_expand(pp);
+ }
+- else if (info->bit_depth == 16)
++ else if (png_get_bit_depth(pp, info) == 16)
+ png_set_strip_16(pp);
+
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ {
+ depth = 3;
+ img->depth = gray ? 1 : 3;
+@@ -1554,10 +1557,11 @@ image_load_png(image_t *img, /* I - Imag
+ img->depth = 1;
+ }
+
+- img->width = info->width;
+- img->height = info->height;
++ img->width = png_get_image_width(pp, info);
++ img->height = png_get_image_height(pp, info);
+
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ png_get_tRNS(pp, info, &trans_alpha, &num_trans, &trans_color);
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ {
+ if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3)
+ image_need_mask(img, 8);
+@@ -1571,14 +1575,14 @@ image_load_png(image_t *img, /* I - Imag
+
+ #ifdef DEBUG
+ printf("color_type=0x%04x, depth=%d, img->width=%d, img->height=%d, img->depth=%d\n",
+- info->color_type, depth, img->width, img->height, img->depth);
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
++ png_get_color_type(pp, info), depth, img->width, img->height, img->depth);
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ puts(" COLOR");
+ else
+ puts(" GRAYSCALE");
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ puts(" ALPHA");
+- if (info->color_type & PNG_COLOR_MASK_PALETTE)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE)
+ puts(" PALETTE");
+ #endif // DEBUG
+
+@@ -1594,9 +1598,9 @@ image_load_png(image_t *img, /* I - Imag
+ * Allocate pointers...
+ */
+
+- rows = (png_bytep *)calloc(info->height, sizeof(png_bytep));
++ rows = (png_bytep *)calloc(png_get_image_height(pp, info), sizeof(png_bytep));
+
+- for (i = 0; i < (int)info->height; i ++)
++ for (i = 0; i < (int)png_get_image_height(pp, info); i ++)
+ rows[i] = img->pixels + i * img->width * depth;
+
+ /*
+@@ -1610,7 +1614,7 @@ image_load_png(image_t *img, /* I - Imag
+ * Generate the alpha mask as necessary...
+ */
+
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ {
+ #ifdef DEBUG
+ for (inptr = img->pixels, i = 0; i < img->height; i ++)
+@@ -1639,7 +1643,7 @@ image_load_png(image_t *img, /* I - Imag
+ * Reformat the data as necessary for the reader...
+ */
+
+- if (gray && info->color_type & PNG_COLOR_MASK_COLOR)
++ if (gray && png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ {
+ /*
+ * Greyscale output needed...
diff --git a/app-text/htmldoc/htmldoc-1.8.27-r2.ebuild b/app-text/htmldoc/htmldoc-1.8.27-r2.ebuild
index defeb465f0a0..f0a02b5670e8 100644
--- a/app-text/htmldoc/htmldoc-1.8.27-r2.ebuild
+++ b/app-text/htmldoc/htmldoc-1.8.27-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/htmldoc/htmldoc-1.8.27-r2.ebuild,v 1.2 2011/03/20 20:19:53 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/htmldoc/htmldoc-1.8.27-r2.ebuild,v 1.3 2011/10/05 14:00:05 ssuominen Exp $
EAPI=1
@@ -35,8 +35,10 @@ src_unpack() {
# make sure not to use the libs htmldoc ships with
mkdir foo ; mv jpeg foo/ ; mv png foo/ ; mv zlib foo/
- epatch "${FILESDIR}"/${PN}-sscanf-overflows.patch \
- "${FILESDIR}"/${PN}-fortify-fail.patch
+ epatch \
+ "${FILESDIR}"/${PN}-sscanf-overflows.patch \
+ "${FILESDIR}"/${PN}-fortify-fail.patch \
+ "${FILESDIR}"/${PN}-libpng15.patch
sed -i "s:^#define DOCUMENTATION \"\$prefix/share/doc/htmldoc\":#define DOCUMENTATION \"\$prefix/share/doc/${PF}/html\":" \
configure