From b6cdff1cab3dcf383d43a21c2ddd168657fabdc5 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Tue, 4 Aug 2015 15:26:47 +0100 Subject: graphics/exact-image: Updated for version 0.9.1. Patched to fix build failure with giflib-5.1 & libpng16 (-current). Signed-off-by: David Spencer --- graphics/exact-image/exact-image-giflib.patch | 139 ++++++++++++++++++++++++ graphics/exact-image/exact-image-libpng15.patch | 109 +++++++++++++++++++ graphics/exact-image/exact-image.SlackBuild | 9 +- graphics/exact-image/exact-image.info | 6 +- graphics/exact-image/png.cc-libpng14.diff | 62 ----------- 5 files changed, 257 insertions(+), 68 deletions(-) create mode 100644 graphics/exact-image/exact-image-giflib.patch create mode 100644 graphics/exact-image/exact-image-libpng15.patch delete mode 100644 graphics/exact-image/png.cc-libpng14.diff (limited to 'graphics') diff --git a/graphics/exact-image/exact-image-giflib.patch b/graphics/exact-image/exact-image-giflib.patch new file mode 100644 index 000000000000..f15c7ad71768 --- /dev/null +++ b/graphics/exact-image/exact-image-giflib.patch @@ -0,0 +1,139 @@ +--- exact-image-0.8.9/codecs/gif.cc.orig 2010-03-03 22:04:44.000000000 +0100 ++++ exact-image-0.8.9/codecs/gif.cc 2014-10-20 16:45:48.021255431 +0200 +@@ -17,6 +17,12 @@ + + #include + ++#if (GIFLIB_MAJOR > 5) || (GIFLIB_MINOR >= 1) ++#define Internal_EGifCloseFile(f) EGifCloseFile(f, NULL) ++#else ++#define Internal_EGifCloseFile(f) EGifCloseFile(f) ++#endif ++ + #include "gif.hh" + #include "Colorspace.hh" + +@@ -58,11 +64,11 @@ + GifRecordType RecordType; + GifByteType* Extension; + ColorMapObject *ColorMap = NULL; +- int ExtCode; ++ int ExtCode, GifError; + +- if ((GifFile = DGifOpen (stream, &GIFInputFunc)) == NULL) ++ if ((GifFile = DGifOpen (stream, &GIFInputFunc, &GifError)) == NULL) + { +- PrintGifError(); ++ std::cerr << "Error: " << GifErrorString(GifError) << std::endl; + return false; + } + +@@ -74,7 +80,7 @@ + /* Scan the content of the GIF file and load the image(s) in: */ + do { + if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) { +- PrintGifError(); ++ std::cerr << "DGifGetRecordType error: " << GifErrorString(GifFile->Error) << std::endl; + return false; + } + +@@ -83,7 +89,7 @@ + switch (RecordType) { + case IMAGE_DESC_RECORD_TYPE: + if (DGifGetImageDesc(GifFile) == GIF_ERROR) { +- PrintGifError(); ++ std::cerr << "DGifGetImageDesc error: " << GifErrorString(GifFile->Error) << std::endl; + return false; + } + +@@ -104,7 +110,7 @@ + j += InterlacedJumps[i]) { + if (DGifGetLine(GifFile, &image.getRawData()[j*image.stride()+Col], + Width) == GIF_ERROR) { +- PrintGifError(); ++ std::cerr << "DGifGetLine error: " << GifErrorString(GifFile->Error) << std::endl; + return false; + } + } +@@ -113,7 +119,7 @@ + for (int i = 0; i < Height; ++i) { + if (DGifGetLine(GifFile, &image.getRawData()[Row++ * image.stride()+Col], + Width) == GIF_ERROR) { +- PrintGifError(); ++ std::cerr << "DGifGetLine error: " << GifErrorString(GifFile->Error) << std::endl; + return false; + } + } +@@ -122,12 +128,12 @@ + case EXTENSION_RECORD_TYPE: + /* Skip any extension blocks in file: */ + if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) { +- PrintGifError(); ++ std::cerr << "DGifGetExtension error: " << GifErrorString(GifFile->Error) << std::endl; + return false; + } + while (Extension != NULL) { + if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) { +- PrintGifError(); ++ std::cerr << "DGifGetExtensionNext error: " << GifErrorString(GifFile->Error) << std::endl; + return false; + } + } +@@ -155,7 +161,7 @@ + // convert colormap to our 16bit "TIFF"format + colorspace_de_palette (image, ColorMap->ColorCount, rmap, gmap, bmap); + +- EGifCloseFile(GifFile); ++ Internal_EGifCloseFile(GifFile); + + return true; + } +@@ -165,17 +171,18 @@ + { + GifFileType* GifFile; + GifByteType* Ptr; ++ int GifError; + +- if ((GifFile = EGifOpen (stream, &GIFOutputFunc)) == NULL) ++ if ((GifFile = EGifOpen (stream, &GIFOutputFunc, &GifError)) == NULL) + { +- std::cerr << "Error preparing GIF file for writing." << std::endl; ++ std::cerr << "Error preparing GIF file for writing: " << GifErrorString(GifError) << std::endl; + return false; + } + + int ColorMapSize = 256; + + // later use our own colormap generation +- ColorMapObject* OutputColorMap = MakeMapObject(ColorMapSize, NULL); ++ ColorMapObject* OutputColorMap = GifMakeMapObject(ColorMapSize, NULL); + if (!OutputColorMap) + return false; + +@@ -203,7 +210,7 @@ + } + + +- if (QuantizeBuffer(image.w, image.h, &ColorMapSize, ++ if (GifQuantizeBuffer(image.w, image.h, &ColorMapSize, + RedBuffer, GreenBuffer, BlueBuffer, + OutputBuffer, OutputColorMap->Colors) == GIF_ERROR) { + return false; +@@ -215,7 +222,7 @@ + if (EGifPutScreenDesc(GifFile, image.w, image.h, + ColorMapSize, 0, OutputColorMap) == GIF_ERROR || + EGifPutImageDesc(GifFile, 0, 0, image.w, image.h, +- FALSE, NULL) == GIF_ERROR) ++ false, NULL) == GIF_ERROR) + { + std::cerr << "Error writing GIF header." << std::endl; + return false; +@@ -234,7 +241,7 @@ + + delete (RedBuffer); delete (GreenBuffer); delete (BlueBuffer); + +- EGifCloseFile(GifFile); ++ Internal_EGifCloseFile(GifFile); + return true; + } + diff --git a/graphics/exact-image/exact-image-libpng15.patch b/graphics/exact-image/exact-image-libpng15.patch new file mode 100644 index 000000000000..ba9df19e81c4 --- /dev/null +++ b/graphics/exact-image/exact-image-libpng15.patch @@ -0,0 +1,109 @@ +Description: Fix FTBFS with libpng 1.5 +Author: Nobuhiro Iwamatsu +Approved: Ralf Treinen +Bug-Debian: #635745 + +--- exactimage-0.8.5.orig/codecs/png.cc ++++ exactimage-0.8.5/codecs/png.cc +@@ -17,6 +17,7 @@ + + #include + #include ++#include + + #include + +@@ -58,7 +59,7 @@ int PNGCodec::readImage (std::istream* s + png_structp png_ptr; + png_infop info_ptr; + png_uint_32 width, height; +- int bit_depth, color_type, interlace_type; ++ int bit_depth, color_type, interlace_type, num_trans; + + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + NULL /*user_error_ptr*/, +@@ -71,7 +72,7 @@ int PNGCodec::readImage (std::istream* s + /* Allocate/initialize the memory for image information. REQUIRED. */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { +- png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); ++ png_destroy_read_struct(&png_ptr, NULL, NULL); + return 0; + } + +@@ -82,7 +83,7 @@ int PNGCodec::readImage (std::istream* s + + 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); ++ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + /* If we get here, we had a problem reading the file */ + return 0; + } +@@ -99,13 +100,13 @@ int PNGCodec::readImage (std::istream* s + png_read_info (png_ptr, info_ptr); + + png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, +- &interlace_type, int_p_NULL, int_p_NULL); ++ &interlace_type, NULL, NULL); + + image.w = width; + image.h = height; + image.bps = bit_depth; +- image.spp = info_ptr->channels; +- ++ image.spp = png_get_channels(png_ptr, info_ptr); ++ + png_uint_32 res_x, res_y; + res_x = png_get_x_pixels_per_meter(png_ptr, info_ptr); + res_y = png_get_y_pixels_per_meter(png_ptr, info_ptr); +@@ -119,11 +120,13 @@ int PNGCodec::readImage (std::istream* s + * (not useful if you are using png_set_packing). */ + // png_set_packswap(png_ptr); + ++ png_get_tRNS(png_ptr, info_ptr, NULL, &num_trans, NULL); ++ + /* Expand paletted colors into true RGB triplets */ + if (color_type == PNG_COLOR_TYPE_PALETTE) { + png_set_palette_to_rgb(png_ptr); + image.bps = 8; +- if (info_ptr->num_trans) ++ if (num_trans) + image.spp = 4; + else + image.spp = 3; +@@ -196,11 +199,11 @@ int PNGCodec::readImage (std::istream* s + for (int pass = 0; pass < number_passes; ++pass) + for (unsigned int y = 0; y < height; ++y) { + row_pointers[0] = image.getRawData() + y * stride; +- png_read_rows(png_ptr, row_pointers, png_bytepp_NULL, 1); ++ png_read_rows(png_ptr, row_pointers, NULL, 1); + } + + /* clean up after the read, and free any memory allocated - REQUIRED */ +- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); ++ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + + /* that's it */ + return true; +@@ -224,7 +227,7 @@ bool PNGCodec::writeImage (std::ostream* + /* Allocate/initialize the memory for image information. REQUIRED. */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { +- png_destroy_write_struct(&png_ptr, png_infopp_NULL); ++ png_destroy_write_struct(&png_ptr, NULL); + return false; + } + +@@ -244,8 +247,10 @@ bool PNGCodec::writeImage (std::ostream* + else if (quality > Z_BEST_COMPRESSION) quality = Z_BEST_COMPRESSION; + png_set_compression_level(png_ptr, quality); + ++ /* Need? + png_info_init (info_ptr); +- ++ */ ++ + /* Set up our STL stream output control */ + png_set_write_fn (png_ptr, stream, &stdstream_write_data, &stdstream_flush_data); + diff --git a/graphics/exact-image/exact-image.SlackBuild b/graphics/exact-image/exact-image.SlackBuild index 6c437bc8cf93..d51b1d600c1d 100644 --- a/graphics/exact-image/exact-image.SlackBuild +++ b/graphics/exact-image/exact-image.SlackBuild @@ -3,7 +3,7 @@ # Written by Benjamin Trigona-Harany PRGNAM=exact-image -VERSION=${VERSION:-0.8.9} +VERSION=${VERSION:-0.9.1} BUILD=${BUILD:-3} TAG=${TAG:-_SBo} @@ -49,8 +49,11 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Patch to fix libpng linkage -patch -p1 --verbose < $CWD/png.cc-libpng14.diff +# Patch to fix build with libpng16 (-current) (thanks to Debian) +patch -p1 --verbose < $CWD/exact-image-libpng15.patch + +# Patch to fix build with giflib-5.1 (-current) (thanks to PLD Linux) +patch -p1 --verbose < $CWD/exact-image-giflib.patch # Patch to fix perl path eval $(perl -V:vendorlib) diff --git a/graphics/exact-image/exact-image.info b/graphics/exact-image/exact-image.info index 013d67ec9859..0a6098651e7b 100644 --- a/graphics/exact-image/exact-image.info +++ b/graphics/exact-image/exact-image.info @@ -1,8 +1,8 @@ PRGNAM="exact-image" -VERSION="0.8.9" +VERSION="0.9.1" HOMEPAGE="http://www.exactcode.de/site/open_source/exactimage/" -DOWNLOAD="http://dl.exactcode.de/oss/exact-image/exact-image-0.8.9.tar.bz2" -MD5SUM="a8694722cd7cc9aa9407950a8440f0cd" +DOWNLOAD="http://dl.exactcode.de/oss/exact-image/exact-image-0.9.1.tar.bz2" +MD5SUM="864eddf488c309a02262f4e07b0fe319" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="agg" diff --git a/graphics/exact-image/png.cc-libpng14.diff b/graphics/exact-image/png.cc-libpng14.diff deleted file mode 100644 index ca738dbcf5b5..000000000000 --- a/graphics/exact-image/png.cc-libpng14.diff +++ /dev/null @@ -1,62 +0,0 @@ -diff -Naur exact-image-0.8.7-old/codecs/png.cc exact-image-0.8.7/codecs/png.cc ---- exact-image-0.8.7-old/codecs/png.cc -+++ exact-image-0.8.7/codecs/png.cc -@@ -71,7 +71,7 @@ - /* Allocate/initialize the memory for image information. REQUIRED. */ - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { -- png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); -+ png_destroy_read_struct(&png_ptr, NULL, NULL); - return 0; - } - -@@ -82,7 +82,7 @@ - - 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); -+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - /* If we get here, we had a problem reading the file */ - return 0; - } -@@ -99,7 +99,7 @@ - png_read_info (png_ptr, info_ptr); - - png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, -- &interlace_type, int_p_NULL, int_p_NULL); -+ &interlace_type, NULL, NULL); - - image.w = width; - image.h = height; -@@ -196,11 +196,11 @@ - for (int pass = 0; pass < number_passes; ++pass) - for (unsigned int y = 0; y < height; ++y) { - row_pointers[0] = image.getRawData() + y * stride; -- png_read_rows(png_ptr, row_pointers, png_bytepp_NULL, 1); -+ png_read_rows(png_ptr, row_pointers, NULL, 1); - } - - /* clean up after the read, and free any memory allocated - REQUIRED */ -- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); -+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - - /* that's it */ - return true; -@@ -224,7 +224,7 @@ - /* Allocate/initialize the memory for image information. REQUIRED. */ - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { -- png_destroy_write_struct(&png_ptr, png_infopp_NULL); -+ png_destroy_write_struct(&png_ptr, NULL); - return false; - } - -@@ -244,8 +244,6 @@ - else if (quality > Z_BEST_COMPRESSION) quality = Z_BEST_COMPRESSION; - png_set_compression_level(png_ptr, quality); - -- png_info_init (info_ptr); -- - /* Set up our STL stream output control */ - png_set_write_fn (png_ptr, stream, &stdstream_write_data, &stdstream_flush_data); - -- cgit v1.2.3