diff options
author | wiz <wiz@pkgsrc.org> | 2011-04-05 12:27:05 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2011-04-05 12:27:05 +0000 |
commit | 42f2f897f34f2feed1807b6f70a9c5ceb559d90f (patch) | |
tree | d7ec00c6fb12a92b02f8266f00db07e98fafc1af /www | |
parent | 348f90ccb32cd2047671ab86cb92e84f16010ada (diff) | |
download | pkgsrc-42f2f897f34f2feed1807b6f70a9c5ceb559d90f.tar.gz |
Fix build with png-1.5 and avoid conflict with getline() on NetBSD.
Diffstat (limited to 'www')
-rw-r--r-- | www/mMosaic/distinfo | 5 | ||||
-rw-r--r-- | www/mMosaic/patches/patch-ai | 184 | ||||
-rw-r--r-- | www/mMosaic/patches/patch-src_MIME.c | 24 |
3 files changed, 206 insertions, 7 deletions
diff --git a/www/mMosaic/distinfo b/www/mMosaic/distinfo index ba233d81c81..7e77b257fd2 100644 --- a/www/mMosaic/distinfo +++ b/www/mMosaic/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.10 2007/08/08 20:20:07 joerg Exp $ +$NetBSD: distinfo,v 1.11 2011/04/05 12:27:05 wiz Exp $ SHA1 (mMosaic-3.7.2.tar.gz) = f26d4fd115a0fb7fc09947506b59e1a3790b6ac7 RMD160 (mMosaic-3.7.2.tar.gz) = 9c7f2e2f00beaef474e53e25a91aeb604584dd06 @@ -11,10 +11,11 @@ SHA1 (patch-ae) = 41eb6cccefb77f720bba0885993c453bc25dc14e SHA1 (patch-af) = 0cba2c49579f6631d7e7d4f1068c00c22401d879 SHA1 (patch-ag) = 51a1021eda3d92bc8bea7dacda510b24ee8ae7ef SHA1 (patch-ah) = db079473aee7b0ad4b674128d5debeb6e777640b -SHA1 (patch-ai) = 990bfbd0181fa93a53de7aaa9a98e5e954e72813 +SHA1 (patch-ai) = 48f4098b1ea36d7669fa620bb153c66a1516b1d4 SHA1 (patch-aj) = 7f4c86ec65d664dbeacd36ca0f3ae37f31fdd9cf SHA1 (patch-ak) = 2c698bbee79beb0b907c24361b501a71d319c839 SHA1 (patch-al) = 659a831be28c22835a4ba2fbb1f39b92d43bd5e7 SHA1 (patch-am) = c309f09e1e2ccf70c1ae3d1cc46d329af2c97209 SHA1 (patch-an) = 3e03f847457166662da82162144a417d316a6508 SHA1 (patch-ao) = afd25d932c5306c8dbee92715478235a76c3c69d +SHA1 (patch-src_MIME.c) = 02299b133fa3d2fe180ca6db49c9bc2b7c629aaa diff --git a/www/mMosaic/patches/patch-ai b/www/mMosaic/patches/patch-ai index 516e970e07d..155a539b91b 100644 --- a/www/mMosaic/patches/patch-ai +++ b/www/mMosaic/patches/patch-ai @@ -1,6 +1,8 @@ -$NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ +$NetBSD: patch-ai,v 1.2 2011/04/05 12:27:06 wiz Exp $ ---- src/readPNG.c.orig 2000-12-08 19:00:45.000000000 +0100 +Fix build with png-1.5. + +--- src/readPNG.c.orig 2000-12-08 18:00:45.000000000 +0000 +++ src/readPNG.c @@ -35,8 +35,8 @@ unsigned char * ReadPNG(FILE *infile,int unsigned char *pixmap; @@ -13,7 +15,7 @@ $NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ double screen_gamma; png_byte *png_pixels=NULL, **row_pointers=NULL; int i, j; -@@ -60,14 +60,16 @@ unsigned char * ReadPNG(FILE *infile,int +@@ -60,40 +60,36 @@ unsigned char * ReadPNG(FILE *infile,int rewind(infile); /* allocate the structures */ @@ -38,7 +40,9 @@ $NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ } /* Establish the setjmp return context for png_error to use. */ -@@ -76,24 +78,18 @@ unsigned char * ReadPNG(FILE *infile,int +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + if (mMosaicSrcTrace) { fprintf(stderr, "\n!!!libpng read error!!!\n"); } @@ -64,7 +68,177 @@ $NetBSD: patch-ai,v 1.1 2006/04/19 19:21:28 wiz Exp $ /* set up the input control */ png_init_io(png_ptr, infile); -@@ -283,10 +279,7 @@ pixmap, since I don't do anything with i +@@ -102,19 +98,19 @@ unsigned char * ReadPNG(FILE *infile,int + + /* setup other stuff using the fields of png_info. */ + +- *width = (int)png_ptr->width; +- *height = (int)png_ptr->height; ++ *width = (int)png_get_image_width(png_ptr, info_ptr); ++ *height = (int)png_get_image_height(png_ptr, info_ptr); + + #ifdef DEBUG_PNG +- fprintf(stderr,"\n\nBEFORE\nheight = %d\n", (int)png_ptr->width); +- fprintf(stderr,"width = %d\n", (int)png_ptr->height); +- fprintf(stderr,"bit depth = %d\n", info_ptr->bit_depth); +- fprintf(stderr,"color type = %d\n", info_ptr->color_type); ++ fprintf(stderr,"\n\nBEFORE\nheight = %d\n", (int)png_get_image_width(png_ptr, info_ptr)); ++ fprintf(stderr,"width = %d\n", (int)png_get_image_height(png_ptr, info_ptr)); ++ fprintf(stderr,"bit depth = %d\n", png_get_bit_depth(png_ptr, info_ptr)); ++ fprintf(stderr,"color type = %d\n", png_get_color_type(png_ptr, info_ptr)); + fprintf(stderr,"compression type = %d\n", info_ptr->compression_type); + fprintf(stderr,"filter type = %d\n", info_ptr->filter_type); + fprintf(stderr,"interlace type = %d\n", info_ptr->interlace_type); + fprintf(stderr,"num colors = %d\n",info_ptr->num_palette); +- fprintf(stderr,"rowbytes = %d\n", info_ptr->rowbytes); ++ fprintf(stderr,"rowbytes = %d\n", png_get_rowbytes(png_ptr, info_ptr)); + #endif + #if 0 + /* This handles alpha and transparency by replacing it with +@@ -133,15 +129,15 @@ unsigned char * ReadPNG(FILE *infile,int + #endif + + /* strip pixels in 16-bit images down to 8 bits */ +- if (info_ptr->bit_depth == 16) ++ if (png_get_bit_depth(png_ptr, info_ptr) == 16) + png_set_strip_16(png_ptr); + + /* If it is a color image then check if it has a palette. If not + then dither the image to 256 colors, and make up a palette */ +- if (info_ptr->color_type==PNG_COLOR_TYPE_RGB || +- info_ptr->color_type==PNG_COLOR_TYPE_RGB_ALPHA) { ++ if (png_get_color_type(png_ptr, info_ptr)==PNG_COLOR_TYPE_RGB || ++ png_get_color_type(png_ptr, info_ptr)==PNG_COLOR_TYPE_RGB_ALPHA) { + +- if(! (info_ptr->valid & PNG_INFO_PLTE)) { ++ if(! (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE))) { + #ifdef DEBUG_PNG + fprintf(stderr,"dithering (RGB->palette)...\n"); + #endif +@@ -155,38 +151,45 @@ then dither the image to 256 colors, and + + /* this should probably be dithering to + Rdata.colors_per_inlined_image colors */ +- png_set_dither(png_ptr, std_color_cube, 216, 216, NULL, 1); ++ png_set_quantize(png_ptr, std_color_cube, 216, 216, NULL, 1); + } else { ++ png_colorp palette; ++ int num_palette; ++ png_uint_16p hist; ++ png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); ++ png_get_hIST(png_ptr, info_ptr, &hist); + #ifdef DEBUG_PNG + fprintf(stderr,"dithering (RGB->file supplied palette)...\n"); + #endif +- png_set_dither(png_ptr, info_ptr->palette, +- info_ptr->num_palette, ++ png_set_quantize(png_ptr, palette, ++ num_palette, + mMosaicAppData.colors_per_inlined_image, +- info_ptr->hist, 1); ++ hist, 1); + } + } + /* PNG files pack pixels of bit depths 1, 2, and 4 into bytes as + small as they can. This expands pixels to 1 pixel per byte, and + if a transparency value is supplied, an alpha channel is + built.*/ +- if (info_ptr->bit_depth < 8) ++ if (png_get_bit_depth(png_ptr, info_ptr) < 8) + png_set_packing(png_ptr); + + /* have libpng handle the gamma conversion */ + + if (mMosaicAppData.use_screen_gamma) { /*SWP*/ +- if (info_ptr->bit_depth != 16) { /* temporary .. glennrp */ ++ if (png_get_bit_depth(png_ptr, info_ptr) != 16) { /* temporary .. glennrp */ + screen_gamma=(double)(mMosaicAppData.screen_gamma); + + #ifdef DEBUG_PNG + fprintf(stderr,"screen gamma=%f\n",screen_gamma); + #endif +- if (info_ptr->valid & PNG_INFO_gAMA) { ++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) { ++ double gamma; ++ png_get_gAMA(png_ptr, info_ptr, &gamma); + #ifdef DEBUG_PNG +- printf("setting gamma=%f\n",info_ptr->gamma); ++ printf("setting gamma=%f\n",gamma); + #endif +- png_set_gamma(png_ptr, screen_gamma, (double)info_ptr->gamma); ++ png_set_gamma(png_ptr, screen_gamma, (double)gamma); + } else { + #ifdef DEBUG_PNG + fprintf(stderr,"setting gamma=%f\n",0.45); +@@ -196,41 +199,44 @@ then dither the image to 256 colors, and + } + } + +- if (info_ptr->interlace_type) ++ if (png_get_interlace_type(png_ptr, info_ptr)) + png_set_interlace_handling(png_ptr); + + png_read_update_info(png_ptr, info_ptr); + + #ifdef DEBUG_PNG +- fprintf(stderr,"\n\nAFTER\nheight = %d\n", (int)png_ptr->width); +- fprintf(stderr,"width = %d\n", (int)png_ptr->height); +- fprintf(stderr,"bit depth = %d\n", info_ptr->bit_depth); +- fprintf(stderr,"color type = %d\n", info_ptr->color_type); ++ fprintf(stderr,"\n\nAFTER\nheight = %d\n", (int)png_get_image_width(png_ptr, info_ptr)); ++ fprintf(stderr,"width = %d\n", (int)png_get_image_height(png_ptr, info_ptr)); ++ fprintf(stderr,"bit depth = %d\n", png_get_bit_depth(png_ptr, info_ptr)); ++ fprintf(stderr,"color type = %d\n", png_get_color_type(png_ptr, info_ptr)); + fprintf(stderr,"compression type = %d\n", info_ptr->compression_type); + fprintf(stderr,"filter type = %d\n", info_ptr->filter_type); + fprintf(stderr,"interlace type = %d\n", info_ptr->interlace_type); + fprintf(stderr,"num colors = %d\n",info_ptr->num_palette); +- fprintf(stderr,"rowbytes = %d\n", info_ptr->rowbytes); ++ fprintf(stderr,"rowbytes = %d\n", png_get_rowbytes(png_ptr, info_ptr)); + #endif + /* allocate the pixel grid which we will need to send to png_read_image(). */ +- png_pixels = (png_byte *)malloc(info_ptr->rowbytes * ++ png_pixels = (png_byte *)malloc(png_get_rowbytes(png_ptr, info_ptr) * + (*height) * sizeof(png_byte)); + + row_pointers = (png_byte **) calloc((*height) , sizeof(png_byte *)); + for (i=0; i < *height; i++) +- row_pointers[i]=png_pixels+(info_ptr->rowbytes*i); ++ row_pointers[i]=png_pixels+(png_get_rowbytes(png_ptr, info_ptr)*i); + + /* FINALLY - read the darn thing. */ + png_read_image(png_ptr, row_pointers); + + /* now that we have the (transformed to 8-bit RGB) image, we have + to copy the resulting palette to our colormap. */ +- if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) { +- if (info_ptr->valid & PNG_INFO_PLTE) { +- for (i=0; i < info_ptr->num_palette; i++) { +- colrs[i].red = info_ptr->palette[i].red << 8; +- colrs[i].green = info_ptr->palette[i].green << 8; +- colrs[i].blue = info_ptr->palette[i].blue << 8; ++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_COLOR) { ++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) { ++ png_colorp palette; ++ int num_palette; ++ png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); ++ for (i=0; i < num_palette; i++) { ++ colrs[i].red = palette[i].red << 8; ++ colrs[i].green = palette[i].green << 8; ++ colrs[i].blue = palette[i].blue << 8; + colrs[i].pixel = i; + colrs[i].flags = DoRed|DoGreen|DoBlue; + } +@@ -257,7 +263,7 @@ to copy the resulting palette to our col + p = pixmap; q = png_pixels; + /* if there is an alpha channel, we have to get rid of it in the + pixmap, since I don't do anything with it yet */ +- if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) { ++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) { + #ifdef DEBUG_PNG + fprintf(stderr,"Getting rid of alpha channel\n"); + #endif +@@ -283,10 +289,7 @@ pixmap, since I don't do anything with i } free((png_byte **)row_pointers); /* clean up after the read, and free any memory allocated */ diff --git a/www/mMosaic/patches/patch-src_MIME.c b/www/mMosaic/patches/patch-src_MIME.c new file mode 100644 index 00000000000..f12d7aaa0a5 --- /dev/null +++ b/www/mMosaic/patches/patch-src_MIME.c @@ -0,0 +1,24 @@ +$NetBSD: patch-src_MIME.c,v 1.1 2011/04/05 12:27:06 wiz Exp $ + +Fix conflict in prototypes with NetBSD native getline(). + +--- src/MIME.c.orig 2000-10-12 12:30:15.000000000 +0000 ++++ src/MIME.c +@@ -311,7 +311,7 @@ static void HTSetSuffix ( const char *su + + #define MAX_STRING_LEN 256 + +-static int getline(char *s, int n, FILE *f) ++static int mm_getline(char *s, int n, FILE *f) + { + register int i=0; + +@@ -353,7 +353,7 @@ static void HTLoadExtensionsConfigFile ( + return ; + } + +- while(!(getline(l,MAX_STRING_LEN,f))) { ++ while(!(mm_getline(l,MAX_STRING_LEN,f))) { + /* always get rid of leading white space for "line" -- SWP */ + for (ptr=l; *ptr && isspace(*ptr); ptr++) + ; |