Fix building with libpng15 wrt #380159 by Diego Elio Pettenò
authorSamuli Suominen <ssuominen@gentoo.org>
Tue, 13 Sep 2011 13:02:03 +0000 (13:02 +0000)
committerSamuli Suominen <ssuominen@gentoo.org>
Tue, 13 Sep 2011 13:02:03 +0000 (13:02 +0000)
Package-Manager: portage-2.2.0_alpha55/cvs/Linux x86_64

x11-misc/fbdesk/ChangeLog
x11-misc/fbdesk/Manifest
x11-misc/fbdesk/fbdesk-1.4.1.ebuild
x11-misc/fbdesk/files/fbdesk-1.4.1-libpng15.patch [new file with mode: 0644]

index b1362ab4f6b8b4ae821defbdf3965d980541e444..5f1fdd11a26e53bc5e964cc727e075dfada7a7a9 100644 (file)
@@ -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ò.
index 82fe694fe727a110dfb3a91b01fa0d120a8d5e63..392e28ee5f3723ff433cb86a62f51f06a0027511 100644 (file)
@@ -1,6 +1,17 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
 AUX fbdesk-1.4.1-gcc-4.3.patch 3506 RMD160 b095682cb6df9ea625eb452df3bf3fbcc3d7e5af SHA1 c676ea7b2d89d5a8e0c842a91b08e4e5e92271b1 SHA256 25f296b0079afd84a9e9fe4e5b057638ee79b5baaa869b70920008d1057a54e0
 AUX fbdesk-1.4.1-libpng14.patch 260 RMD160 82978129d509f8d3b70a139cbe28912905e69ea8 SHA1 10b94c2f279abba97382ed3e64798fd3ef67fd8f SHA256 d73f722d414c5024377df767f24b2ce5c33f10816cd30710b04b09f011e4bec3
+AUX fbdesk-1.4.1-libpng15.patch 5823 RMD160 eb94e40c5cd440a78b5d12ce838dda5d59d0d0b7 SHA1 63eb314c88b55b8e4445d51b7a115e04fb162e2e SHA256 c6951dc8443293c9a036388ef76c89611a250223ab17157e6142c2a81792e5cc
 DIST fbdesk-1.4.1.tar.gz 426550 RMD160 ce22936b73acd8273e9816f4c2a5458cc98cf45a SHA1 b5a2f446fa27406d9adb9a9608f1dc3c638d37ff SHA256 ca5620468ca8743c6bf536099ac6ddc2a0546e5d658bb88f27db8e429ff51c4c
-EBUILD fbdesk-1.4.1.ebuild 951 RMD160 ad021267376f26ae65a5d5701ea36b580110c639 SHA1 479eec7c19b174037aef848337a5541f51f87ae4 SHA256 614832ee4c53bcdceecce501a94d175fc33050ce8df7ac8a1362627d00e52478
-MISC ChangeLog 4700 RMD160 0f6b774436389e7c669e58b55e6419f7b4aacf0c SHA1 f9763d1a3599dce1010caeb584d2ce250e469ce5 SHA256 f7956739182690354dc0178a2ca5c4d9901a058207273d1da260090c2bfd33ad
+EBUILD fbdesk-1.4.1.ebuild 940 RMD160 baee69dea3f8331b4f7ebe63f5c71e3f2c64741e SHA1 3b8dfd51c66542b4d34a57ed0268993d62b16fea SHA256 6502e4765ffd4d669e2b39e677705425d0bd9c3c074b503ca65a016837f4f02e
+MISC ChangeLog 4878 RMD160 94dae26b19b99f7539159887f28bdbc65c00981b SHA1 2f47573fe204d00a34023093c0c0e39f3f8930f3 SHA256 e3cf3f8859022dda0c5aabf3e056a3710a221cfec509016fb839bf7f79ed9766
 MISC metadata.xml 165 RMD160 b8020f1f8aabec4b8cd485910dc5df54338df9ff SHA1 08100b521b6fe603fc93ce48c1d7a892f2ee01a9 SHA256 5c2ed5ccdbc5064106e1f0227a30ec58377fa5299087516c9ebf9701619596ac
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.18 (GNU/Linux)
+
+iF4EAREIAAYFAk5vVIAACgkQXkR9YqOcLPHXNQD8CeqlN4rMgN52Kqoqc8LH81Xm
+14qHMMD0v7lBhK8frVgA/jf7WGjW56/IwYGlC5lLdpnTIesh9OVDgPFIIaX+uhzI
+=Y/kP
+-----END PGP SIGNATURE-----
index 49ec566291331f5a302f182ae3aaabf505f72b63..82913dc6a36d93f4c387b3454a576519f9974b29 100644 (file)
@@ -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 (file)
index 0000000..fbfd9cb
--- /dev/null
@@ -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);