]> git.pld-linux.org Git - packages/fontforge.git/commitdiff
- fix building with giflib 5.x auto/th/fontforge-20120731-5
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 10 May 2015 12:14:00 +0000 (14:14 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 10 May 2015 12:14:00 +0000 (14:14 +0200)
- rel 5

fontforge.spec
giflib5.patch [new file with mode: 0644]

index f69aac706177931b509d55e71ced1ba5f67d1075..7ac4abb55c4a8d062b88af8104f48cbba9925c78 100644 (file)
@@ -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 (file)
index 0000000..47bae4d
--- /dev/null
@@ -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 );
+ }
This page took 0.105686 seconds and 4 git commands to generate.