]> git.pld-linux.org Git - packages/amaya.git/commitdiff
libpng 1.5 fix from netbsd cvs master
authorElan Ruusamäe <glen@delfi.ee>
Mon, 12 Nov 2012 18:03:04 +0000 (20:03 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 12 Nov 2012 18:03:04 +0000 (20:03 +0200)
amaya.spec
libpng-1.5.patch [new file with mode: 0644]

index ae665271d28fdca21b3188d57b3a5c1854e9b688..9cdeb099222081181419c3ffb0bb85ff6d08a5fa 100644 (file)
@@ -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 (file)
index 0000000..81e7fa3
--- /dev/null
@@ -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);
This page took 0.073877 seconds and 4 git commands to generate.