From f678ef3d970fc9372a21ce8ddf5898899c7adbe1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 12 Nov 2012 20:03:04 +0200 Subject: [PATCH] libpng 1.5 fix from netbsd cvs --- amaya.spec | 6 ++++++ libpng-1.5.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 libpng-1.5.patch diff --git a/amaya.spec b/amaya.spec index ae66527..9cdeb09 100644 --- a/amaya.spec +++ b/amaya.spec @@ -8,10 +8,12 @@ Group: X11/Applications/Networking Source0: ftp://ftp.w3.org/pub/amaya/%{name}-sources-%{version}.tgz # Source0-md5: e8072c7b1d06b983951c56e9f51fbacf Patch0: %{name}-opt.patch +Patch1: libpng-1.5.patch URL: http://www.w3.org/Amaya/ BuildRequires: OpenGL-GLU-devel BuildRequires: autoconf >= 2.54 BuildRequires: automake +BuildRequires: dos2unix BuildRequires: expat-devel BuildRequires: libjpeg-devel >= 6b BuildRequires: libpng-devel >= 1.0 @@ -47,6 +49,10 @@ install -d sys-libs mv Mesa freetype libwww redland wxWidgets sys-libs cd Amaya %patch0 -p1 +%patch1 -p1 + +# AC_SUBST_FILE doesn't work with CR+LF +#dos2unix amaya/Makefile.in %build cd Amaya diff --git a/libpng-1.5.patch b/libpng-1.5.patch new file mode 100644 index 0000000..81e7fa3 --- /dev/null +++ b/libpng-1.5.patch @@ -0,0 +1,54 @@ +http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/www/amaya/patches/patch-ae?rev=1.12;content-type=text/plain + +$NetBSD: patch-ae,v 1.12 2011/07/02 22:19:30 dholland Exp $ + +- Don't use the png library to free twice. +- Fix build with recent libpng. + +--- Amaya/thotlib/image/pnghandler.c.orig 2009-09-09 09:54:50.000000000 +0000 ++++ Amaya/thotlib/image/pnghandler.c +@@ -128,7 +128,7 @@ static unsigned char *ReadPng (FILE *pfF + png_byte **ppbRowPointers; + unsigned char *pixels; + unsigned int i, j, passes; +- unsigned long lw, lh; ++ unsigned lw, lh; + int iBitDepth, iColorType; + double dGamma; + +@@ -149,7 +149,7 @@ static unsigned char *ReadPng (FILE *pfF + png_destroy_read_struct (&png_ptr, NULL, NULL); + return NULL; + } +- 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); +@@ -175,7 +175,7 @@ static unsigned char *ReadPng (FILE *pfF + png_set_palette_to_rgb (png_ptr); + /* 8 bits / channel is needed */ + if (iColorType == PNG_COLOR_TYPE_GRAY && iBitDepth < 8) +- png_set_gray_1_2_4_to_8(png_ptr); ++ png_set_expand_gray_1_2_4_to_8(png_ptr); + /* all transparency type : 1 color, indexed => alpha channel*/ + if (png_get_valid (png_ptr, info_ptr,PNG_INFO_tRNS)) + png_set_tRNS_to_alpha (png_ptr); +@@ -588,7 +588,7 @@ static unsigned char *ReadPng (FILE *inf + } + + /* clean up after the read, and free any memory allocated */ +- png_read_destroy (png_ptr, info_ptr, (png_info*) NULL); ++ //png_read_destroy (png_ptr, info_ptr, (png_info*) NULL); + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); + /* free the structures */ +@@ -858,7 +858,7 @@ ThotBool SavePng (const char *filename, + png_destroy_write_struct(&png, (png_infopp) NULL); + return FALSE; + } +- if (setjmp(png->jmpbuf)) ++ if (setjmp(png_jmpbuf(png))) + { + png_destroy_write_struct(&png, &pngInfo); + TtaWriteClose (pngFile); -- 2.44.0