summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2011-09-17 11:10:27 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2011-09-17 11:10:27 +0000
commit5bb48f975f34395f4240edc10fe080d5121843c6 (patch)
tree67adbf6ff0e0183b6e384a7c5eeb6510183ab227 /x11-misc
parent[This is a placeholder. Please ignore.] (diff)
downloadgentoo-2-5bb48f975f34395f4240edc10fe080d5121843c6.tar.gz
gentoo-2-5bb48f975f34395f4240edc10fe080d5121843c6.tar.bz2
gentoo-2-5bb48f975f34395f4240edc10fe080d5121843c6.zip
Fix building with libpng15 wrt #383211 by Diego Elio Pettenò
(Portage version: 2.2.0_alpha55/cvs/Linux x86_64)
Diffstat (limited to 'x11-misc')
-rw-r--r--x11-misc/xaos/ChangeLog6
-rw-r--r--x11-misc/xaos/files/xaos-3.5-libpng15.patch131
-rw-r--r--x11-misc/xaos/xaos-3.5-r1.ebuild5
3 files changed, 139 insertions, 3 deletions
diff --git a/x11-misc/xaos/ChangeLog b/x11-misc/xaos/ChangeLog
index 6ec03a651d52..b6564858ea88 100644
--- a/x11-misc/xaos/ChangeLog
+++ b/x11-misc/xaos/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for x11-misc/xaos
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/xaos/ChangeLog,v 1.40 2011/09/17 11:04:26 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/xaos/ChangeLog,v 1.41 2011/09/17 11:10:27 ssuominen Exp $
+
+ 17 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> xaos-3.5-r1.ebuild,
+ +files/xaos-3.5-libpng15.patch:
+ Fix building with libpng15 wrt #383211 by Diego Elio Pettenò
17 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> -xaos-3.2.ebuild,
-xaos-3.4-r1.ebuild, -files/xaos-3.4-makefile.patch,
diff --git a/x11-misc/xaos/files/xaos-3.5-libpng15.patch b/x11-misc/xaos/files/xaos-3.5-libpng15.patch
new file mode 100644
index 000000000000..beece8339e31
--- /dev/null
+++ b/x11-misc/xaos/files/xaos-3.5-libpng15.patch
@@ -0,0 +1,131 @@
+http://code.google.com/p/gnuxaos/issues/detail?id=55
+
+--- src/util/png.c
++++ src/util/png.c
+@@ -3,6 +3,7 @@
+ #include <aconfig.h>
+ #ifdef USE_PNG
+ #include <png.h>
++#include <zlib.h>
+ #endif
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -31,6 +32,9 @@
+ png_structp png_ptr;
+ png_infop info_ptr;
+ png_color palette[256];
++ png_color_8 sig_bit;
++ int color_type;
++ int bit_depth;
+ volatile unsigned short a = 255;
+ volatile unsigned char *b = (volatile unsigned char *) &a;
+ #ifdef _undefined_
+@@ -59,7 +63,7 @@
+ png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
+ return "No memory to create png info structure";
+ }
+- if (setjmp(png_ptr->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ fclose(file);
+ return strerror(errno);
+@@ -78,57 +82,70 @@
+ png_set_compression_window_bits(png_ptr, 15);
+ png_set_compression_method(png_ptr, 8);
+
+- info_ptr->width = image->width;
+- info_ptr->height = image->height;
+- /*info_ptr->gamma=1.0; */
+- info_ptr->gamma = 0.5;
+- info_ptr->valid |= PNG_INFO_gAMA | PNG_INFO_pHYs;
+- info_ptr->x_pixels_per_unit = (png_uint_32) (100 / image->pixelwidth);
+- info_ptr->y_pixels_per_unit = (png_uint_32) (100 / image->pixelheight);
++ switch (image->palette->type)
++ {
++ case C256:
++ color_type = PNG_COLOR_TYPE_PALETTE;
++ bit_depth = image->bytesperpixel * 8;
++ break;
++ case SMALLITER:
++ case LARGEITER:
++ case GRAYSCALE:
++ color_type = PNG_COLOR_TYPE_GRAY;
++ bit_depth = image->bytesperpixel * 8;
++ break;
++ case TRUECOLOR:
++ case TRUECOLOR24:
++ case TRUECOLOR16:
++ color_type = PNG_COLOR_TYPE_RGB;
++ bit_depth = 8;
++ break;
++ }
+
++ png_set_IHDR (png_ptr, info_ptr, image->width, image->height, bit_depth,
++ color_type, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE,
++ PNG_FILTER_TYPE_BASE);
+
+ switch (image->palette->type) {
+ case C256:
+ {
+ int i;
+- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
+- info_ptr->bit_depth = image->bytesperpixel * 8;
+- info_ptr->palette = palette;
+- info_ptr->valid |= PNG_INFO_PLTE;
++ png_color png_palette[257];
++ int png_num_palette;
+ for (i = 0; i < image->palette->end; i++)
+- info_ptr->palette[i].red = image->palette->rgb[i][0],
+- info_ptr->palette[i].green = image->palette->rgb[i][1],
+- info_ptr->palette[i].blue = image->palette->rgb[i][2],
+- info_ptr->num_palette = image->palette->end;
++ png_palette[i].red = image->palette->rgb[i][0],
++ png_palette[i].green = image->palette->rgb[i][1],
++ png_palette[i].blue = image->palette->rgb[i][2],
++ png_num_palette = image->palette->end;
++ png_set_PLTE(png_ptr, info_ptr, png_palette, png_num_palette);
+ }
+ break;
+- case SMALLITER:
+- case LARGEITER:
+- case GRAYSCALE:
+- info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
+- info_ptr->bit_depth = image->bytesperpixel * 8;
+- break;
+ case TRUECOLOR:
+ case TRUECOLOR24:
+ case TRUECOLOR16:
+- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+- info_ptr->bit_depth = 8;
+- info_ptr->sig_bit.red = 8 - image->palette->info.truec.rprec;
+- info_ptr->sig_bit.green = 8 - image->palette->info.truec.gprec;
+- info_ptr->sig_bit.blue = 8 - image->palette->info.truec.bprec;
++ sig_bit.red = 8 - image->palette->info.truec.rprec;
++ sig_bit.green = 8 - image->palette->info.truec.gprec;
++ sig_bit.blue = 8 - image->palette->info.truec.bprec;
++ png_set_sBIT(png_ptr, info_ptr, &sig_bit);
+ break;
+ }
+- info_ptr->interlace_type = 0;
++
++ png_write_info (png_ptr, info_ptr);
++
+ #ifdef _undefined_
+ png_set_text(png_ptr, info_ptr, comments,
+ sizeof(comments) / sizeof(png_text));
+ #endif
+
+- png_write_info(png_ptr, info_ptr);
++ png_set_gAMA(png_ptr, info_ptr, 0.5 /* 1.0 */);
++ png_set_pHYs(png_ptr, info_ptr, (png_uint_32) (100 / image->pixelwidth),
++ (png_uint_32) (100 / image->pixelheight),
++ PNG_RESOLUTION_UNKNOWN);
++
+ /*png_set_filler(png_ptr,0,PNG_FILLER_AFTER); */
+ png_set_packing(png_ptr);
+ if (image->palette->type & (TRUECOLOR | TRUECOLOR24 | TRUECOLOR16))
+- png_set_shift(png_ptr, &(info_ptr->sig_bit));
++ png_set_shift (png_ptr, &sig_bit);
+ if (*b == 255)
+ png_set_swap(png_ptr);
+ png_set_bgr(png_ptr);
diff --git a/x11-misc/xaos/xaos-3.5-r1.ebuild b/x11-misc/xaos/xaos-3.5-r1.ebuild
index ad71ed551ef3..8d104562aa64 100644
--- a/x11-misc/xaos/xaos-3.5-r1.ebuild
+++ b/x11-misc/xaos/xaos-3.5-r1.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/x11-misc/xaos/xaos-3.5-r1.ebuild,v 1.7 2011/06/28 20:04:39 ranger Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/xaos/xaos-3.5-r1.ebuild,v 1.8 2011/09/17 11:10:27 ssuominen Exp $
EAPI=4
@@ -40,7 +40,8 @@ DEPEND="${RDEPEND}
src_prepare() {
epatch \
"${FILESDIR}"/${PN}-3.4-png.patch \
- "${FILESDIR}"/${PN}-3.4-include.patch
+ "${FILESDIR}"/${PN}-3.4-include.patch \
+ "${FILESDIR}"/${PN}-3.5-libpng15.patch
sed -i -e 's/-s//' Makefile.in
eautoreconf
}