[slashem] fix build against libpng 1.5

Iain Arnell iarnell at fedoraproject.org
Sun Jan 15 00:42:55 UTC 2012


commit a5c9180a9733329f3b82b9b53bda5b876e964ad1
Author: Iain Arnell <iarnell at gmail.com>
Date:   Sun Jan 15 01:41:40 2012 +0100

    fix build against libpng 1.5

 slashem-libpng-1.5.patch |   32 ++++++++++++++++++++++++++++++++
 slashem.spec             |   10 ++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)
---
diff --git a/slashem-libpng-1.5.patch b/slashem-libpng-1.5.patch
new file mode 100644
index 0000000..b09511c
--- /dev/null
+++ b/slashem-libpng-1.5.patch
@@ -0,0 +1,32 @@
+diff -up slashem-0.0.8E0F1/win/gl/gl_image.c.libpng slashem-0.0.8E0F1/win/gl/gl_image.c
+--- slashem-0.0.8E0F1/win/gl/gl_image.c.libpng	2006-12-30 14:04:53.000000000 +0100
++++ slashem-0.0.8E0F1/win/gl/gl_image.c	2012-01-15 01:13:55.000000000 +0100
+@@ -495,7 +495,7 @@ unsigned char *sdlgl_load_png_file(const
+   /* set error handling since we are using the setjmp/longjmp method
+    * (this is the normal method of doing things with libpng).
+    */
+-  if (setjmp(png_ptr->jmpbuf))
++  if (setjmp(png_jmpbuf(png_ptr)))
+   {
+     sdlgl_warning("Problem within LibPNG (unknown)\n");
+     goto failed;
+diff -up slashem-0.0.8E0F1/win/share/tile2png.c.libpng slashem-0.0.8E0F1/win/share/tile2png.c
+--- slashem-0.0.8E0F1/win/share/tile2png.c.libpng	2012-01-15 01:14:08.000000000 +0100
++++ slashem-0.0.8E0F1/win/share/tile2png.c	2012-01-15 01:25:02.000000000 +0100
+@@ -26,6 +26,7 @@
+ #undef blue
+ 
+ #include <png.h>
++#include <zlib.h>
+ #include <assert.h>
+ 
+ 
+@@ -104,7 +105,7 @@ void save_png(const char *filename, int
+   /* set error handling since we are using the setjmp/longjmp method
+    * (this is the normal method of doing things with libpng).
+    */
+-  if (setjmp(png_ptr->jmpbuf))
++  if (setjmp(png_jmpbuf(png_ptr)))
+   {
+     fprintf(stderr, "tile2png: Unknown problem while writing PNG.\n");
+     goto failed;
diff --git a/slashem.spec b/slashem.spec
index 10dbe0e..fb1068a 100644
--- a/slashem.spec
+++ b/slashem.spec
@@ -1,6 +1,6 @@
 Name:           slashem
 Version:        0.0.8
-Release:        0.7.E0F1%{?dist}
+Release:        0.8.E0F1%{?dist}
 Summary:        Super Lotsa Added Stuff Hack - Extended Magic
 
 Group:          Amusements/Games
@@ -9,13 +9,15 @@ URL:            http://slashem.sourceforge.net/
 Source0:        http://downloads.sourceforge.net/slashem/se008e0f1.tar.gz
 Source1:        %{name}.desktop
 Patch0:         slashem-config.patch
+# fix building with libpng 1.5
+Patch1:         slashem-libpng-1.5.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  ncurses-devel
 BuildRequires:  bison, flex, desktop-file-utils
 BuildRequires:  bdftopcf, libX11-devel, libXaw-devel, libXext-devel
 BuildRequires:  libXmu-devel, libXpm-devel, libXt-devel
-BuildRequires:  SDL-devel  libGL-devel libpng-devel
+BuildRequires:  SDL-devel  libGL-devel libpng-devel zlib-devel
 # to compress save files
 Requires:       bzip2
 # for X11 core fonts
@@ -50,6 +52,7 @@ SLASH'EM is the (continuing) saga of one such variant...
 %prep
 %setup -q -n %{name}-%{version}E0F1
 %patch0 -p 1 -b .config
+%patch1 -p 1 -b .libpng
 
 sed -i \
     -e 's:^\(#define FILE_AREA_VAR\).*:\1 "%{fa_var}/":' \
@@ -150,6 +153,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Sun Jan 15 2012 Iain Arnell <iarnell at gmail.com> 0.0.8-0.8.E0F1
+- fix build against libpng 1.5
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.0.8-0.7.E0F1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list