[packages/imlib2] - fix building with giflib 5
baggins
baggins at pld-linux.org
Thu Jan 1 12:55:46 CET 2015
commit 580854e076c21a5209130572d62d19cc121f3fca
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Thu Jan 1 11:55:35 2015 +0000
- fix building with giflib 5
giflib5.patch | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
imlib2.spec | 2 ++
2 files changed, 86 insertions(+)
---
diff --git a/imlib2.spec b/imlib2.spec
index 176d73a..475a5e5 100644
--- a/imlib2.spec
+++ b/imlib2.spec
@@ -8,6 +8,7 @@ Group: X11/Libraries
Source0: http://downloads.sourceforge.net/enlightenment/%{name}-%{version}.tar.bz2
# Source0-md5: b6de51879502e857d5b1f7622267a030
Patch0: %{name}-1.4.4-libpng-1.5.patch
+Patch1: giflib5.patch
URL: http://enlightenment.org/p.php?p=about/libs/imlib2
BuildRequires: autoconf >= 2.52
BuildRequires: automake >= 1.6
@@ -76,6 +77,7 @@ Biblioteka statyczna imlib2.
%prep
%setup -q
%patch0 -p0
+%patch1 -p1
%build
%{__libtoolize}
diff --git a/giflib5.patch b/giflib5.patch
new file mode 100644
index 0000000..7f48cd5
--- /dev/null
+++ b/giflib5.patch
@@ -0,0 +1,84 @@
+--- imlib2-1.4.4/src/modules/loaders/loader_gif.c~ 2015-01-01 11:50:17.000000000 +0000
++++ imlib2-1.4.4/src/modules/loaders/loader_gif.c 2015-01-01 11:53:22.771650740 +0000
+@@ -36,7 +37,11 @@
+ #endif
+ if (fd < 0)
+ return 0;
++#if GIFLIB_MAJOR >= 5
++ gif = DGifOpenFileHandle(fd, NULL);
++#else
+ gif = DGifOpenFileHandle(fd);
++#endif
+ if (!gif)
+ {
+ close(fd);
+@@ -65,13 +65,21 @@
+ h = gif->Image.Height;
+ if (!IMAGE_DIMENSIONS_OK(w, h))
+ {
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ return 0;
+ }
+ rows = malloc(h * sizeof(GifRowType *));
+ if (!rows)
+ {
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ return 0;
+ }
+ for (i = 0; i < h; i++)
+@@ -83,7 +91,11 @@
+ rows[i] = malloc(w * sizeof(GifPixelType));
+ if (!rows[i])
+ {
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ for (i = 0; i < h; i++)
+ {
+ if (rows[i])
+@@ -154,7 +166,11 @@
+ im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h);
+ if (!im->data)
+ {
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ free(rows);
+ return 0;
+ }
+@@ -185,7 +201,11 @@
+ last_per = (int)per;
+ if (!(progress(im, (int)per, 0, last_y, w, i)))
+ {
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ for (i = 0; i < h; i++)
+ {
+ free(rows[i]);
+@@ -202,7 +222,11 @@
+ {
+ progress(im, 100, 0, last_y, w, h);
+ }
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ for (i = 0; i < h; i++)
+ {
+ free(rows[i]);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/imlib2.git/commitdiff/580854e076c21a5209130572d62d19cc121f3fca
More information about the pld-cvs-commit
mailing list