diff options
author | wiz <wiz@pkgsrc.org> | 2011-01-29 11:24:43 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2011-01-29 11:24:43 +0000 |
commit | 38efaa29921732d93629e15b5089c044922cc6ca (patch) | |
tree | a5311772fed186d51d1dbe64a4993b1d8caa11ff /x11 | |
parent | d075ab53b08b33b9290bbca2911212409a23ec87 (diff) | |
download | pkgsrc-38efaa29921732d93629e15b5089c044922cc6ca.tar.gz |
Fix build with png-1.5.
Diffstat (limited to 'x11')
-rw-r--r-- | x11/fbdesk/distinfo | 3 | ||||
-rw-r--r-- | x11/fbdesk/patches/patch-ac | 145 | ||||
-rw-r--r-- | x11/fox/distinfo | 3 | ||||
-rw-r--r-- | x11/fox/patches/patch-ab | 36 |
4 files changed, 185 insertions, 2 deletions
diff --git a/x11/fbdesk/distinfo b/x11/fbdesk/distinfo index ffa20017cbd..c0c77ce109c 100644 --- a/x11/fbdesk/distinfo +++ b/x11/fbdesk/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.6 2008/05/10 16:19:16 obache Exp $ +$NetBSD: distinfo,v 1.7 2011/01/29 11:24:43 wiz Exp $ SHA1 (fbdesk-1.4.1.tar.gz) = b5a2f446fa27406d9adb9a9608f1dc3c638d37ff RMD160 (fbdesk-1.4.1.tar.gz) = ce22936b73acd8273e9816f4c2a5458cc98cf45a Size (fbdesk-1.4.1.tar.gz) = 426550 bytes SHA1 (patch-aa) = 4412dfd20e31814ee674213ca798864dab25399f SHA1 (patch-ab) = 4245733d9ec038f0c2bc3bd53e9a026e97e43d1e +SHA1 (patch-ac) = 7771adb86237b0c143baafc993cbd67998a1a17f diff --git a/x11/fbdesk/patches/patch-ac b/x11/fbdesk/patches/patch-ac new file mode 100644 index 00000000000..470b7ec0858 --- /dev/null +++ b/x11/fbdesk/patches/patch-ac @@ -0,0 +1,145 @@ +$NetBSD: patch-ac,v 1.1 2011/01/29 11:24:43 wiz Exp $ + +Fix build with png-1.5. + +--- src/FbTk/ImagePNG.cc.orig 2004-09-20 14:04:11.000000000 +0000 ++++ 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); diff --git a/x11/fox/distinfo b/x11/fox/distinfo index 981279fc5fc..28f4c22eecb 100644 --- a/x11/fox/distinfo +++ b/x11/fox/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.18 2008/05/22 22:56:19 wiz Exp $ +$NetBSD: distinfo,v 1.19 2011/01/29 11:32:19 wiz Exp $ SHA1 (fox-1.6.33.tar.gz) = 3100a829bd121d7620b13aadda5b7087933e2057 RMD160 (fox-1.6.33.tar.gz) = ddd515868c83b758f5fb36e81e9175d2963de905 Size (fox-1.6.33.tar.gz) = 4339500 bytes SHA1 (patch-aa) = 3e0fa9f47b1e1464121b1c9b97b6391eb047a2d1 +SHA1 (patch-ab) = 7da560823b8dc062aedb76a3b59aa6afea05dfa6 diff --git a/x11/fox/patches/patch-ab b/x11/fox/patches/patch-ab new file mode 100644 index 00000000000..16f80c5305a --- /dev/null +++ b/x11/fox/patches/patch-ab @@ -0,0 +1,36 @@ +$NetBSD: patch-ab,v 1.6 2011/01/29 11:32:19 wiz Exp $ + +Fix build with png-1.5. + +--- src/fxpngio.cpp.orig 2006-01-22 17:58:54.000000000 +0000 ++++ src/fxpngio.cpp +@@ -75,7 +75,11 @@ static void user_flush_fn(png_structp ){ + static void user_error_fn(png_structp png_ptr,png_const_charp){ + FXStream* store=(FXStream*)png_get_error_ptr(png_ptr); + store->setError(FXStreamFormat); // Flag this as a format error in FXStream ++#if (PNG_LIBPNG_VER < 10500) + longjmp(png_ptr->jmpbuf,1); // Bail out ++#else ++ png_longjmp(png_ptr,1); // Bail out ++#endif + } + + +@@ -118,7 +122,7 @@ bool fxloadPNG(FXStream& store,FXColor*& + } + + // Set error handling +- if(setjmp(png_ptr->jmpbuf)){ ++ if(setjmp(png_jmpbuf(png_ptr))){ + + // Free all of the memory associated with the png_ptr and info_ptr + png_destroy_read_struct(&png_ptr,&info_ptr,(png_infopp)NULL); +@@ -231,7 +235,7 @@ bool fxsavePNG(FXStream& store,const FXC + } + + // Set error handling. +- if(setjmp(png_ptr->jmpbuf)){ ++ if(setjmp(png_jmpbuf(png_ptr))){ + png_destroy_write_struct(&png_ptr,&info_ptr); + return false; + } |