summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2011-09-13 13:02:03 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2011-09-13 13:02:03 +0000
commit7ae1c0043cf0f27edfc0293bac1010648bc9b1ac (patch)
tree4194ef3e74ca0794f6d15ec9944d3536341aa712 /x11-misc
parentVersion bump. (diff)
downloadgentoo-2-7ae1c0043cf0f27edfc0293bac1010648bc9b1ac.tar.gz
gentoo-2-7ae1c0043cf0f27edfc0293bac1010648bc9b1ac.tar.bz2
gentoo-2-7ae1c0043cf0f27edfc0293bac1010648bc9b1ac.zip
Fix building with libpng15 wrt #380159 by Diego Elio Pettenò
(Portage version: 2.2.0_alpha55/cvs/Linux x86_64)
Diffstat (limited to 'x11-misc')
-rw-r--r--x11-misc/fbdesk/ChangeLog8
-rw-r--r--x11-misc/fbdesk/fbdesk-1.4.1.ebuild19
-rw-r--r--x11-misc/fbdesk/files/fbdesk-1.4.1-libpng15.patch145
3 files changed, 160 insertions, 12 deletions
diff --git a/x11-misc/fbdesk/ChangeLog b/x11-misc/fbdesk/ChangeLog
index b1362ab4f6b8..5f1fdd11a26e 100644
--- a/x11-misc/fbdesk/ChangeLog
+++ b/x11-misc/fbdesk/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for x11-misc/fbdesk
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/fbdesk/ChangeLog,v 1.35 2010/06/13 11:45:49 ssuominen Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/fbdesk/ChangeLog,v 1.36 2011/09/13 13:02:03 ssuominen Exp $
+
+ 13 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> fbdesk-1.4.1.ebuild,
+ +files/fbdesk-1.4.1-libpng15.patch:
+ Fix building with libpng15 wrt #380159 by Diego Elio Pettenò
13 Jun 2010; Samuli Suominen <ssuominen@gentoo.org> fbdesk-1.4.1.ebuild:
Missing media-libs/imlib2 USE depend "X" wrt #248560 by Diego E. Pettenò.
diff --git a/x11-misc/fbdesk/fbdesk-1.4.1.ebuild b/x11-misc/fbdesk/fbdesk-1.4.1.ebuild
index 49ec56629133..82913dc6a36d 100644
--- a/x11-misc/fbdesk/fbdesk-1.4.1.ebuild
+++ b/x11-misc/fbdesk/fbdesk-1.4.1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/fbdesk/fbdesk-1.4.1.ebuild,v 1.11 2010/06/13 11:45:49 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/fbdesk/fbdesk-1.4.1.ebuild,v 1.12 2011/09/13 13:02:03 ssuominen Exp $
-EAPI=2
+EAPI=4
inherit eutils
DESCRIPTION="fluxbox-util application that creates and manage icons on your Fluxbox desktop"
@@ -24,9 +24,13 @@ RDEPEND="x11-libs/libX11
DEPEND="${RDEPEND}
x11-proto/xproto"
+DOCS=( AUTHORS ChangeLog README )
+
src_prepare() {
- epatch "${FILESDIR}"/${P}-gcc-4.3.patch \
- "${FILESDIR}"/${P}-libpng14.patch
+ epatch \
+ "${FILESDIR}"/${P}-gcc-4.3.patch \
+ "${FILESDIR}"/${P}-libpng14.patch \
+ "${FILESDIR}"/${P}-libpng15.patch
}
src_configure() {
@@ -34,8 +38,3 @@ src_configure() {
$(use_enable debug) \
$(use_enable png)
}
-
-src_install() {
- emake DESTDIR="${D}" install || die
- dodoc AUTHORS ChangeLog README
-}
diff --git a/x11-misc/fbdesk/files/fbdesk-1.4.1-libpng15.patch b/x11-misc/fbdesk/files/fbdesk-1.4.1-libpng15.patch
new file mode 100644
index 000000000000..fbfd9cb09628
--- /dev/null
+++ b/x11-misc/fbdesk/files/fbdesk-1.4.1-libpng15.patch
@@ -0,0 +1,145 @@
+This patch is from netbsd pkgsrc
+
+ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/x11/fbdesk/patches
+
+--- src/FbTk/ImagePNG.cc
++++ src/FbTk/ImagePNG.cc
+@@ -76,6 +76,8 @@ ImagePNG::~ImagePNG() {
+ }
+
+ PixmapWithMask *ImagePNG::load(const std::string &filename, int screen_num) const {
++ int pixel_depth;
++ int rowbytes;
+ if (filename.empty())
+ return 0;
+ #ifdef DEBUG
+@@ -102,7 +104,7 @@ PixmapWithMask *ImagePNG::load(const std
+ return 0;
+ }
+
+- if (setjmp(png.png()->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png.png()))) {
+ fclose(fp);
+ return 0;
+ }
+@@ -115,12 +117,14 @@ PixmapWithMask *ImagePNG::load(const std
+ png_get_IHDR(png.png(), png.info(), &w, &h,
+ &bit_depth, &color_type,
+ &interlace_type, 0, 0);
++ pixel_depth = bit_depth * png_get_channels(png.png(), png.info());
++ rowbytes = png_get_rowbytes(png.png(), png.info());
+ #ifdef DEBUG
+- cerr<<png.info()->width<<", "<<png.info()->height<<endl;
+- cerr<<"bit_depth = "<<(int)png.info()->bit_depth<<endl;
+- cerr<<"bytes per pixel = "<<((int)png.info()->bit_depth>>3)<<endl;
+- cerr<<"pixel depth = "<<(int)png.info()->pixel_depth<<endl;
+- cerr<<"rowbytes = "<<png.info()->rowbytes<<endl;
++ cerr<<png_get_image_width(png.png(), png.info())<<", "<<png_get_image_height(png.png(), png.info())<<endl;
++ cerr<<"bit_depth = "<<(int)png_get_bit_depth(png.png(),png.info())<<endl;
++ cerr<<"bytes per pixel = "<<((int)png_get_bit_depth(png.png(), png.info())>>3)<<endl;
++ cerr<<"pixel depth = "<<pixel_depth<<endl;
++ cerr<<"rowbytes = "<<rowbytes<<endl;
+ cerr<<"Color type = ";
+ switch (color_type) {
+ case PNG_COLOR_TYPE_GRAY:
+@@ -146,7 +150,7 @@ PixmapWithMask *ImagePNG::load(const std
+ // convert to rgb
+ if (color_type == PNG_COLOR_TYPE_PALETTE && bit_depth <= 8) {
+ png_set_expand(png.png());
+- png.info()->pixel_depth = 8;
++ pixel_depth = 8;
+ }
+ // convert to rgb
+ if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
+@@ -158,7 +162,7 @@ PixmapWithMask *ImagePNG::load(const std
+ if (color_type == PNG_COLOR_TYPE_GRAY ||
+ color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+ png_set_gray_to_rgb(png.png());
+- png.info()->pixel_depth = 8;
++ pixel_depth = 8;
+ color_type = PNG_COLOR_TYPE_RGB;
+ }
+
+@@ -170,23 +174,23 @@ PixmapWithMask *ImagePNG::load(const std
+ // expand to 4 bytes
+ if (bit_depth == 8 && color_type == PNG_COLOR_TYPE_RGB) {
+ png_set_filler(png.png(), 0, PNG_FILLER_AFTER);
+- png.info()->rowbytes = png.info()->width * 4;
+- png.info()->pixel_depth = 32;
++ rowbytes = png_get_image_width(png.png(), png.info()) * 4;
++ pixel_depth = 32;
+ }
+
+- if (png.info()->pixel_depth == 4 ||
+- png.info()->pixel_depth == 8)
++ if (pixel_depth == 4 ||
++ pixel_depth == 8)
+ return 0;
+
+ // create memory to hold rows
+- png_bytep *row_pointers = new (nothrow) png_bytep[png.info()->height];
++ png_bytep *row_pointers = new (nothrow) png_bytep[png_get_image_height(png.png(), png.info())];
+ if (row_pointers == 0) {
+ fclose(fp);
+ return 0;
+ }
+
+- for (unsigned int row = 0; row < png.info()->height; ++row) {
+- row_pointers[row] = new png_byte[png.info()->rowbytes];
++ for (unsigned int row = 0; row < png_get_image_height(png.png(), png.info()); ++row) {
++ row_pointers[row] = new png_byte[rowbytes];
+ }
+
+ // get transparent pixel
+@@ -214,31 +218,31 @@ PixmapWithMask *ImagePNG::load(const std
+ fclose(fp);
+
+ // clear linear memory
+- char *data = new char[png.info()->rowbytes * png.info()->height];
+- for (int offset=0, y = 0; y < png.info()->height; y++) {
+- for (int x = 0; x < png.info()->rowbytes; x++, offset++) {
++ char *data = new char[rowbytes * png_get_image_height(png.png(), png.info())];
++ for (int offset=0, y = 0; y < png_get_image_height(png.png(), png.info()); y++) {
++ for (int x = 0; x < rowbytes; x++, offset++) {
+ data[offset] = row_pointers[y][x];
+ }
+ }
+
+- FbTk::Surface *srf = new (nothrow) FbTk::Surface(png.info()->width, png.info()->height,
+- png.info()->pixel_depth);
++ FbTk::Surface *srf = new (nothrow) FbTk::Surface(png_get_image_width(png.png(), png.info()), png_get_image_height(png.png(), png.info()),
++ pixel_depth);
+
+ if (srf == 0)
+ return 0;
+
+
+ // finaly copy data to surface
+- switch (png.info()->pixel_depth) {
++ switch (pixel_depth) {
+ case 16:
+ convert16to32(data, *srf);
+ break;
+ case 24:
+ case 32:
+- memcpy(srf->data(), data, png.info()->height * png.info()->rowbytes);
++ memcpy(srf->data(), data, png_get_image_height(png.png(), png.info()) * rowbytes);
+ break;
+ default:
+- cerr<<"ImagePNG: Can't convert from "<<(int)png.info()->pixel_depth<<" to 32bpp."<<endl;
++ cerr<<"ImagePNG: Can't convert from "<<pixel_depth<<" to 32bpp."<<endl;
+ break;
+ }
+
+@@ -264,9 +268,9 @@ PixmapWithMask *ImagePNG::load(const std
+ long i = 0x44332211;
+ unsigned char* a = (unsigned char*) &i;
+ bool big_endian = (*a != 0x11);
+- int alphacolor = ((png.info()->channels != 4) ? 0xFF000000 : 0);
++ int alphacolor = ((png_get_channels(png.png(), png.info()) != 4) ? 0xFF000000 : 0);
+ if (big_endian) {
+- int shift = ((png.info()->channels == 4) ? 0 : 8);
++ int shift = ((png_get_channels(png.png(), png.info()) == 4) ? 0 : 8);
+ alphacolor = (0xFF >> shift);
+ }
+ screen_surf.setColorKey(alphacolor, true);