[fenix] 116/127: Fix FTBFS against libpng 1.5
Peter Pentchev
roam at ringlet.net
Thu Dec 17 14:39:41 UTC 2015
This is an automated email from the git hooks/post-receive script.
roam-guest pushed a commit to branch master
in repository fenix.
commit 7633de8c3cc54292b966d6c1653c17fc8a5a7cbb
Author: Vincent Cheng <vcheng at debian.org>
Date: Mon Mar 31 07:08:54 2014 +0000
Fix FTBFS against libpng 1.5
---
debian/changelog | 2 +
debian/patches/fix_ftbfs_libpng1.5.patch | 113 +++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 116 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 6dda733..08d099b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ fenix (0.92a.dfsg1-10) unstable; urgency=low
* Fix FTBFS by linking against libgif. (Closes: #732787, #738073)
(LP: #1277593)
* Build-depend on libpng-dev instead of libpng12-dev. (Closes: #662322)
+ * Add debian/patches/fix_ftbfs_libpng1.5.patch to fix FTBFS against
+ libpng 1.5. (Closes: #649548)
-- Vincent Cheng <vcheng at debian.org> Sun, 30 Mar 2014 23:49:50 -0700
diff --git a/debian/patches/fix_ftbfs_libpng1.5.patch b/debian/patches/fix_ftbfs_libpng1.5.patch
new file mode 100644
index 0000000..c4ab47c
--- /dev/null
+++ b/debian/patches/fix_ftbfs_libpng1.5.patch
@@ -0,0 +1,113 @@
+--- fenix-0.92a.dfsg1.orig/fxi/src/img_png.c
++++ fenix-0.92a.dfsg1/fxi/src/img_png.c
+@@ -101,7 +101,11 @@ GRAPH * gr_read_png (const char * filena
+
+ /* Rutina de error */
+
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(png_ptr)))
++#else
+ if (setjmp (png_ptr->jmpbuf))
++#endif
+ {
+ png_destroy_read_struct (&png_ptr, &info_ptr, &end_info) ;
+ file_close (png) ;
+@@ -296,8 +300,11 @@ GRAPH * gr_read_png (const char * filena
+ }
+
+ /* Fin */
+-
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (!setjmp(png_jmpbuf(png_ptr))) png_read_end (png_ptr, 0);
++#else
+ if (!setjmp (png_ptr->jmpbuf)) png_read_end (png_ptr, 0) ;
++#endif
+ file_close (png) ;
+ bitmap->modified = 1 ;
+
+@@ -354,7 +361,11 @@ int gr_save_png (GRAPH * gr, const char
+
+ /* Error handling... */
+
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(png_ptr))) {
++#else
+ if (setjmp(png_ptr->jmpbuf)) {
++#endif
+ fclose (file) ;
+ png_destroy_write_struct (&png_ptr, NULL) ;
+ free ( rowpointers ) ;
+@@ -398,7 +409,6 @@ int gr_save_png (GRAPH * gr, const char
+
+ /* Free allocated palette... */
+ png_free (png_ptr, (png_voidp) pal) ;
+- info_ptr->palette = NULL ;
+ } else {
+ png_set_IHDR (png_ptr, info_ptr, gr->width,
+ gr->height, 8, PNG_COLOR_TYPE_RGB_ALPHA,
+--- fenix-0.92a.dfsg1.orig/map/map.c
++++ fenix-0.92a.dfsg1/map/map.c
+@@ -443,8 +443,11 @@ void save_png (const char * filename, MA
+ free ( rowpointers ) ;
+ fatal_error (_("Out of memory")) ;
+ }
+-
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(png_ptr)))
++#else
+ if (setjmp(png_ptr->jmpbuf))
++#endif
+ {
+ free ( rowpointers ) ;
+ fclose (file) ;
+@@ -478,8 +481,14 @@ void save_png (const char * filename, MA
+ for (k = 0 ; k < map->header.height ; k++)
+ rowpointers[k] = (Uint8 *)map->data + map->header.width*k ;
+ png_write_image (png_ptr, rowpointers) ;
+- free (info_ptr->palette) ;
++
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ png_free(png_ptr, palette);
++ palette = NULL;
++#else
++ freee(info_ptr->palette) ;
+ info_ptr->palette = NULL ;
++#endif
+ }
+ else
+ {
+@@ -564,7 +573,11 @@ MAP * load_png (const char * filename)
+
+ /* Rutina de error */
+
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(png_ptr)))
++#else
+ if (setjmp (png_ptr->jmpbuf))
++#endif
+ {
+ png_destroy_read_struct (&png_ptr, &info_ptr, &end_info) ;
+ fclose (png) ;
+--- fenix-0.92a.dfsg1.orig/fpg/fpg.c
++++ fenix-0.92a.dfsg1/fpg/fpg.c
+@@ -33,6 +33,7 @@
+ #define _(String) String
+ #endif
+
++#include <zlib.h>
+ #include <png.h>
+
+ #define MAXPATH 1024
+@@ -187,8 +188,11 @@ MAP * png_load (const char * filename)
+ if (!info_ptr || !end_info) fatal_error (_("Error loading PNG file")) ;
+
+ /* Rutina de error */
+-
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++ if (setjmp(png_jmpbuf(png_ptr)))
++#else
+ if (setjmp (png_ptr->jmpbuf))
++#endif
+ {
+ png_destroy_read_struct (&png_ptr, &info_ptr, &end_info) ;
+ fclose (png) ;
diff --git a/debian/patches/series b/debian/patches/series
index 3ae0666..71996f1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -27,3 +27,4 @@ headers.patch
kfreebsd.patch
no_--as-needed_in_fxi-src-Makefile.patch
libgif.patch
+fix_ftbfs_libpng1.5.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/fenix.git
More information about the Pkg-games-commits
mailing list