diff options
author | wiz <wiz@pkgsrc.org> | 2011-04-05 11:49:51 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2011-04-05 11:49:51 +0000 |
commit | 85370609e3fc1497d7160c362186d5789de6bbcc (patch) | |
tree | 3895e52af23b0c665089e97196648142f1269e56 /lang/kaffe | |
parent | 1bdfcbb4f9b21a66a0cdf2e21d84d8edc3bc1a57 (diff) | |
download | pkgsrc-85370609e3fc1497d7160c362186d5789de6bbcc.tar.gz |
Fix build with png-1.5.
Diffstat (limited to 'lang/kaffe')
-rw-r--r-- | lang/kaffe/distinfo | 3 | ||||
-rw-r--r-- | lang/kaffe/patches/patch-libraries_clib_awt_X_imgpng.c | 101 |
2 files changed, 103 insertions, 1 deletions
diff --git a/lang/kaffe/distinfo b/lang/kaffe/distinfo index 6f8b3d372a3..0e35f08e0e1 100644 --- a/lang/kaffe/distinfo +++ b/lang/kaffe/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.29 2010/12/15 16:06:26 abs Exp $ +$NetBSD: distinfo,v 1.30 2011/04/05 11:49:51 wiz Exp $ SHA1 (kaffe-1.1.7.tar.gz) = 5951d16a4a7b11689932583d134520ca6de00817 RMD160 (kaffe-1.1.7.tar.gz) = 7523a3470cd06cf60dbade8ea2f464dc9d85277b @@ -17,3 +17,4 @@ SHA1 (patch-bc) = f00d541613db81540bcd21ddc68f7b27232024b6 SHA1 (patch-ca) = 0dc783a8e78016ef5e5e2f3392644690e3a2de9a SHA1 (patch-cb) = c698b0a2e078cc035dfd7401617fc8d4c2ef5fbe SHA1 (patch-cc) = df48315c9470d433e33fd80136d7bf7f60f83e1d +SHA1 (patch-libraries_clib_awt_X_imgpng.c) = 0cb5d6ef9349c1f6e1ac1d5885f574f4e2a0aac9 diff --git a/lang/kaffe/patches/patch-libraries_clib_awt_X_imgpng.c b/lang/kaffe/patches/patch-libraries_clib_awt_X_imgpng.c new file mode 100644 index 00000000000..2ebef1a5f96 --- /dev/null +++ b/lang/kaffe/patches/patch-libraries_clib_awt_X_imgpng.c @@ -0,0 +1,101 @@ +$NetBSD: patch-libraries_clib_awt_X_imgpng.c,v 1.1 2011/04/05 11:49:51 wiz Exp $ + +Fix build with png-1.5. + +--- libraries/clib/awt/X/imgpng.c.orig 2005-07-22 11:42:55.000000000 +0000 ++++ libraries/clib/awt/X/imgpng.c +@@ -33,10 +33,10 @@ void reduceAlpha ( Toolkit* tk, Image* i + */ + + static inline int +-hasAlpha ( png_structp png_ptr ) ++hasAlpha ( png_structp png_ptr, png_infop info_ptr ) + { +- return (png_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA || +- png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA); ++ return (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA || ++ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA); + + } + +@@ -78,13 +78,13 @@ readRowData ( png_structp png_ptr, png_i + jint argb; + unsigned char *p; + +- for ( i = 0; i < info_ptr->height; i++ ) { ++ for ( i = 0; i < png_get_image_height(png_ptr, info_ptr); i++ ) { + png_read_row( png_ptr, row, 0); + +- for ( j=0, p=(unsigned char*)row; j<info_ptr->width; j++ ) { ++ for ( j=0, p=(unsigned char*)row; j<png_get_image_width(png_ptr, info_ptr); j++ ) { + argb = readARGB( &p, + (img->alpha != 0) +- || (info_ptr->channels == 4)); ++ || (png_get_channels(png_ptr, info_ptr) == 4)); + setPixel( img, argb, i, j); + } + } +@@ -99,8 +99,8 @@ readImageData ( png_structp png_ptr, png + + png_read_image( png_ptr, rows); + +- for ( i=0; i<info_ptr->height; i++ ) { +- for ( j=0, p=(unsigned char*)rows[i]; j<info_ptr->width; j++ ) { ++ for ( i=0; i<png_get_image_height(png_ptr, info_ptr); i++ ) { ++ for ( j=0, p=(unsigned char*)rows[i]; j<png_get_image_width(png_ptr, info_ptr); j++ ) { + argb = readARGB( &p, (img->alpha != 0)); + setPixel( img, argb, i, j); + } +@@ -145,13 +145,13 @@ readInterlacedData ( png_structp png_ptr + + + for ( pass=0; pass<7; pass++ ) { +- for ( i = 0; i < info_ptr->height; i++ ) { ++ for ( i = 0; i < png_get_image_height(png_ptr, info_ptr); i++ ) { + if ( pass ) { + readbackRow( img, row, i); + } + png_read_row( png_ptr, row, 0); + +- for ( j=0, p=(unsigned char*)row; j<info_ptr->width; j++ ) { ++ for ( j=0, p=(unsigned char*)row; j<png_get_image_width(png_ptr, info_ptr); j++ ) { + argb = readARGB( &p, (img->alpha != 0)); + setPixel( img, argb, i, j); + } +@@ -171,7 +171,7 @@ readPng ( png_structp png_ptr, png_infop + png_bytepp volatile rows = 0; + png_bytep volatile data = 0; + +- if ( setjmp(png_ptr->jmpbuf) ) { ++ if ( setjmp(png_jmpbuf(png_ptr)) ) { + if ( img ) + imgFreeImage(img); + if ( rows ) +@@ -212,21 +212,21 @@ readPng ( png_structp png_ptr, png_infop + row_bytes = png_get_rowbytes( png_ptr, info_ptr); + + /* time to create the image */ +- img = createImage( info_ptr->width, info_ptr->height); +- if ( hasAlpha( png_ptr) ) ++ img = createImage( png_get_image_width(png_ptr, info_ptr), png_get_image_height(png_ptr, info_ptr)); ++ if ( hasAlpha( png_ptr, info_ptr ) ) + createAlphaImage( X, img); + createXImage( X, img); + +- if ( info_ptr->interlace_type != 0 ) { ++ if ( png_get_interlace_type(png_ptr, info_ptr) != 0 ) { + #ifndef OPTIMIZE_SPACE + /* + * This is bad: to read an interlaced image, we need enough space to (temporarily) + * store the whole transformed data (passes need prev. results). Unfortunately, + * interlacing is used for large images, and this might require a LOT of memory. + */ +- rows = AWT_MALLOC( sizeof(png_bytep) * info_ptr->height); +- data = AWT_MALLOC( row_bytes * info_ptr->height); +- for ( i=0; i<info_ptr->height; i++ ) ++ rows = AWT_MALLOC( sizeof(png_bytep) * png_get_image_height(png_ptr, info_ptr)); ++ data = AWT_MALLOC( row_bytes * png_get_image_height(png_ptr, info_ptr)); ++ for ( i=0; i<png_get_image_height(png_ptr, info_ptr); i++ ) + rows[i] = (data + i*row_bytes); + + readImageData( png_ptr, info_ptr, rows, img); |