[packages/emacs] - rel 6; fix build with giflib 5
arekm
arekm at pld-linux.org
Tue Jun 10 23:51:18 CEST 2014
commit 8bbdeb220cc5b5f370ec846b43eb674b293da8a7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Jun 10 23:51:15 2014 +0200
- rel 6; fix build with giflib 5
emacs-giflib.patch | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
emacs.spec | 4 +++-
2 files changed, 70 insertions(+), 1 deletion(-)
---
diff --git a/emacs.spec b/emacs.spec
index 3a46e3e..20be1ce 100644
--- a/emacs.spec
+++ b/emacs.spec
@@ -20,7 +20,7 @@ Summary(tr.UTF-8): GNU Emacs
Name: emacs
%define ver 24.3
Version: %{ver}
-Release: 5
+Release: 6
License: GPL v3+
Group: Applications/Editors/Emacs
Source0: ftp://ftp.gnu.org/pub/gnu/emacs/%{name}-%{version}.tar.xz
@@ -35,6 +35,7 @@ Source7: %{name}-gtk.desktop
Source8: %{name}-motif.desktop
Source9: %{name}-nox.desktop
Patch0: %{name}-fontconfig.patch
+Patch1: %{name}-giflib.patch
URL: http://www.gnu.org/software/emacs/
BuildRequires: autoconf
BuildRequires: automake
@@ -370,6 +371,7 @@ exit 1
%setup -q -n %{name}-%{ver}
%patch0 -p1
+%patch1 -p1
%build
cp -f /usr/share/automake/config.* .
diff --git a/emacs-giflib.patch b/emacs-giflib.patch
new file mode 100644
index 0000000..9b9b206
--- /dev/null
+++ b/emacs-giflib.patch
@@ -0,0 +1,67 @@
+diff --git a/configure.ac b/configure.ac
+index 53426b6..0f05d8e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3109,8 +3109,9 @@ elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
+ || test "${HAVE_W32}" = "yes"; then
+ AC_CHECK_HEADER(gif_lib.h,
+ # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
+-# Earlier versions can crash Emacs.
+- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])
++# Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
++ [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes,
++ [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])])
+
+ if test "$HAVE_GIF" = yes; then
+ LIBGIF=-lgif
+diff --git a/src/image.c b/src/image.c
+index e429830..c414f5b 100644
+--- a/src/image.c
++++ b/src/image.c
+@@ -7219,14 +7219,22 @@ gif_image_p (Lisp_Object object)
+
+ #endif /* HAVE_NTGUI */
+
++#ifndef GIFLIB_MAJOR
++#define GIFLIB_MAJOR 0
++#endif
+
+ #ifdef WINDOWSNT
+
+ /* GIF library details. */
+ DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
+ DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *));
++#if GIFLIB_MAJOR < 5
+ DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc));
+ DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *));
++#else
++DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *));
++DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *, int *));
++#endif
+
+ static bool
+ init_gif_functions (void)
+@@ -7316,7 +7324,11 @@ gif_load (struct frame *f, struct image *img)
+ }
+
+ /* Open the GIF file. */
++#if GIFLIB_MAJOR < 5
+ gif = fn_DGifOpenFileName (SSDATA (file));
++#else
++ gif = fn_DGifOpenFileName (SSDATA (file), NULL);
++#endif
+ if (gif == NULL)
+ {
+ image_error ("Cannot open `%s'", file, Qnil);
+@@ -7337,7 +7349,11 @@ gif_load (struct frame *f, struct image *img)
+ memsrc.len = SBYTES (specified_data);
+ memsrc.index = 0;
+
++#if GIFLIB_MAJOR < 5
+ gif = fn_DGifOpen (&memsrc, gif_read_from_memory);
++#else
++ gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL);
++#endif
+ if (!gif)
+ {
+ image_error ("Cannot open memory source `%s'", img->spec, Qnil);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/emacs.git/commitdiff/8bbdeb220cc5b5f370ec846b43eb674b293da8a7
More information about the pld-cvs-commit
mailing list