[packages/corona] - fix build with giflib 5.x

baggins baggins at pld-linux.org
Mon Jun 22 20:59:55 CEST 2015


commit b173f2593d96b5207f14169075213d19bbbc9388
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Jun 22 20:59:40 2015 +0200

    - fix build with giflib 5.x

 corona.spec   |  2 ++
 giflib5.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)
---
diff --git a/corona.spec b/corona.spec
index a742d42..e1eff57 100644
--- a/corona.spec
+++ b/corona.spec
@@ -11,6 +11,7 @@ Patch0:		%{name}-system-gif.patch
 Patch1:		%{name}-config.patch
 Patch2:		%{name}-gcc43.patch
 Patch3:		%{name}-libpng15.patch
+Patch4:		giflib5.patch
 URL:		http://corona.sourceforge.net/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -74,6 +75,7 @@ Statyczna biblioteka corona.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %{__libtoolize}
diff --git a/giflib5.patch b/giflib5.patch
new file mode 100644
index 0000000..d478556
--- /dev/null
+++ b/giflib5.patch
@@ -0,0 +1,50 @@
+--- corona-1.0.2/src/OpenGIF.cpp.orig	2015-06-22 20:57:06.941970178 +0200
++++ corona-1.0.2/src/OpenGIF.cpp	2015-06-22 20:58:51.143707746 +0200
+@@ -20,7 +20,11 @@
+     COR_GUARD("OpenGIF");
+ 
+     // open GIF file
++#if GIFLIB_MAJOR >= 5
++    GifFileType* gif = DGifOpen(file, InputFunc, NULL);
++#else
+     GifFileType* gif = DGifOpen(file, InputFunc);
++#endif
+     if (!gif) {
+       COR_LOG("DGifOpen failed");
+       return 0;
+@@ -29,7 +33,11 @@
+     // read GIF image
+     if (DGifSlurp(gif) != GIF_OK) {
+       COR_LOG("DGifSlurp failed");
++#if GIFLIB_MAJOR >= 5
++      DGifCloseFile(gif, NULL);
++#else
+       DGifCloseFile(gif);
++#endif
+       return 0;
+     }
+     ColorMapObject* cmap = gif->SColorMap;
+@@ -50,7 +58,11 @@
+         COR_LOG(str);
+       }
+       
++#if GIFLIB_MAJOR >= 5
++      DGifCloseFile(gif, NULL);
++#else
+       DGifCloseFile(gif);
++#endif
+       return 0;
+     }
+ 
+@@ -117,7 +129,11 @@
+       memcpy(out, in, width * height);
+     }
+ 
++#if GIFLIB_MAJOR >= 5
++    DGifCloseFile(gif, NULL);
++#else
+     DGifCloseFile(gif);
++#endif
+     return new SimpleImage(width, height, PF_I8, image.release(),
+                            (byte*)palette.release(), 256, PF_R8G8B8A8);
+   }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/corona.git/commitdiff/b173f2593d96b5207f14169075213d19bbbc9388



More information about the pld-cvs-commit mailing list