[packages/fontforge] - fix building with giflib 5.x - rel 5
baggins
baggins at pld-linux.org
Sun May 10 14:14:17 CEST 2015
commit 98e5ffd1c6cfb57ce5b66336cfa452c34d31811c
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun May 10 14:14:00 2015 +0200
- fix building with giflib 5.x
- rel 5
fontforge.spec | 4 ++-
giflib5.patch | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 105 insertions(+), 1 deletion(-)
---
diff --git a/fontforge.spec b/fontforge.spec
index f69aac7..7ac4abb 100644
--- a/fontforge.spec
+++ b/fontforge.spec
@@ -2,13 +2,14 @@ Summary: An outline font editor
Summary(pl.UTF-8): Edytor fontów rysowanych
Name: fontforge
Version: 20120731
-Release: 4
+Release: 5
License: BSD
Group: X11/Applications/Publishing
Source0: http://downloads.sourceforge.net/fontforge/%{name}_full-%{version}-b.tar.bz2
# Source0-md5: a8a90473a97da87e45f66d11007b6e7c
Patch0: %{name}-link.patch
Patch1: %{name}-20090224-pythondl.patch
+Patch2: giflib5.patch
URL: http://fontforge.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
@@ -83,6 +84,7 @@ Pliki nagłówkowe bibliotek FontForge.
%setup -q -n %{name}-%{version}-b
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
%{__libtoolize}
diff --git a/giflib5.patch b/giflib5.patch
new file mode 100644
index 0000000..47bae4d
--- /dev/null
+++ b/giflib5.patch
@@ -0,0 +1,102 @@
+--- fontforge-20120731-b/gutils/gimagereadgif.c~ 2012-08-02 17:09:09.000000000 +0200
++++ fontforge-20120731-b/gutils/gimagereadgif.c 2015-05-10 14:11:16.818633712 +0200
+@@ -42,9 +42,14 @@
+ #include <gif_lib.h>
+
+ static DL_CONST void *libgif=NULL;
++#if GIFLIB_MAJOR >= 5
++static GifFileType *(*_DGifOpenFileName)(char *, int *);
++static int (*_DGifCloseFile)(GifFileType *, int *);
++#else
+ static GifFileType *(*_DGifOpenFileName)(char *);
+-static int (*_DGifSlurp)(GifFileType *);
+ static int (*_DGifCloseFile)(GifFileType *);
++#endif
++static int (*_DGifSlurp)(GifFileType *);
+
+ static int loadgif() {
+ char *err;
+@@ -56,9 +61,14 @@
+ fprintf(stderr,"%s\n", dlerror());
+ return( 0 );
+ }
++#if GIFLIB_MAJOR >= 5
++ _DGifOpenFileName = (GifFileType *(*)(char *, int *)) dlsym(libgif,"DGifOpenFileName");
++ _DGifCloseFile = (int (*)(GifFileType *, int *)) dlsym(libgif,"DGifCloseFile");
++#else
+ _DGifOpenFileName = (GifFileType *(*)(char *)) dlsym(libgif,"DGifOpenFileName");
+- _DGifSlurp = (int (*)(GifFileType *)) dlsym(libgif,"DGifSlurp");
+ _DGifCloseFile = (int (*)(GifFileType *)) dlsym(libgif,"DGifCloseFile");
++#endif
++ _DGifSlurp = (int (*)(GifFileType *)) dlsym(libgif,"DGifSlurp");
+ if ( _DGifOpenFileName && _DGifSlurp && _DGifCloseFile )
+ return( 1 );
+ dlclose(libgif);
+@@ -132,13 +142,21 @@
+ if ( !loadgif())
+ return( NULL );
+
++#if GIFLIB_MAJOR >= 5
++ if ((gif = _DGifOpenFileName(filename, NULL)) == NULL) {
++#else
+ if ((gif = _DGifOpenFileName(filename)) == NULL) {
++#endif
+ fprintf( stderr, "can't open %s\n", filename);
+ return( NULL );
+ }
+
+ if ( _DGifSlurp(gif)==GIF_ERROR ) {
++#if GIFLIB_MAJOR >= 5
++ _DGifCloseFile(gif, NULL);
++#else
+ _DGifCloseFile(gif);
++#endif
+ fprintf( stderr, "Bad gif file %s\n", filename );
+ return( NULL );
+ }
+@@ -150,7 +168,11 @@
+ ret = images[0];
+ else
+ ret = GImageCreateAnimation(images,gif->ImageCount);
++#if GIFLIB_MAJOR >= 5
++ _DGifCloseFile(gif, NULL);
++#else
+ _DGifCloseFile(gif);
++#endif
+ free(images);
+ return( ret );
+ }
+@@ -220,13 +242,21 @@
+ GifFileType *gif;
+ int i;
+
++#if GIFLIB_MAJOR >= 5
++ if ((gif = DGifOpenFileName(filename, NULL)) == NULL) {
++#else
+ if ((gif = DGifOpenFileName(filename)) == NULL) {
++#endif
+ fprintf( stderr, "can't open %s\n", filename);
+ return( NULL );
+ }
+
+ if ( DGifSlurp(gif)==GIF_ERROR ) {
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ fprintf(stderr,"Bad gif file %s\n", filename );
+ return( NULL );
+ }
+@@ -238,7 +268,11 @@
+ ret = images[0];
+ else
+ ret = GImageCreateAnimation(images,gif->ImageCount);
++#if GIFLIB_MAJOR >= 5
++ DGifCloseFile(gif, NULL);
++#else
+ DGifCloseFile(gif);
++#endif
+ free(images);
+ return( ret );
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/fontforge.git/commitdiff/98e5ffd1c6cfb57ce5b66336cfa452c34d31811c
More information about the pld-cvs-commit
mailing list