wok rev 22366

imlib: add patch for giflib >= 5 api
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 22 11:57:18 2019 +0100 (2019-11-22)
parents b753ca9ee288
children a4853170daf3
files imlib/receipt imlib/stuff/giflib5.u lxpanel-dev/receipt unison/receipt
line diff
     1.1 --- a/imlib/receipt	Fri Nov 22 10:49:44 2019 +0100
     1.2 +++ b/imlib/receipt	Fri Nov 22 11:57:18 2019 +0100
     1.3 @@ -17,9 +17,7 @@
     1.4  compile_rules()
     1.5  {
     1.6  	# Update for giflib >= 5 api
     1.7 -	sed -i 's|DGifOpenFileHandle(fd|&,NULL|' */*.c
     1.8 -	sed -i 's|DGifCloseFile(gif|&,NULL|' */*.c
     1.9 -	sed -i 's|PrintGifError()|fprintf(stderr, "GIF-LIB error\n")|' */*.c
    1.10 +	patch -p0 < $stuff/giflib5.u
    1.11  
    1.12  	./configure \
    1.13  		--prefix=/usr \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/imlib/stuff/giflib5.u	Fri Nov 22 11:57:18 2019 +0100
     2.3 @@ -0,0 +1,122 @@
     2.4 +--- gdk_imlib/io-gif.c
     2.5 ++++ gdk_imlib/io-gif.c
     2.6 +@@ -10,6 +10,15 @@
     2.7 + #else
     2.8 + #include <gif_lib.h>
     2.9 + 
    2.10 ++static int ErrorCode;
    2.11 ++static void PrintGifError(void)
    2.12 ++{
    2.13 ++	char *Err = GifErrorString(ErrorCode);
    2.14 ++	if (Err != NULL)
    2.15 ++		fprintf(stderr, "GIF-LIB error: %s.\n", Err);
    2.16 ++	else	fprintf(stderr, "GIF-LIB undefined error %d.\n", ErrorCode);
    2.17 ++}
    2.18 ++
    2.19 + unsigned char      *
    2.20 + loader_gif(FILE *f, int *w, int *h, int *t)
    2.21 + {
    2.22 +@@ -30,7 +39,7 @@
    2.23 +   fd = fileno(f);
    2.24 +   /* Apparently rewind(f) isn't sufficient */
    2.25 +   lseek(fd, (long) 0, 0);
    2.26 +-  gif = DGifOpenFileHandle(fd);
    2.27 ++  gif = DGifOpenFileHandle(fd, &ErrorCode);
    2.28 + 
    2.29 +   transp = -1;
    2.30 +   data = NULL;
    2.31 +@@ -62,13 +71,13 @@
    2.32 + 	  rows = malloc(*h * sizeof(GifRowType *));
    2.33 + 	  if (!rows)
    2.34 + 	    {
    2.35 +-	      DGifCloseFile(gif);
    2.36 ++	      DGifCloseFile(gif, NULL);
    2.37 + 	      return NULL;
    2.38 + 	    }
    2.39 + 	  data = _gdk_malloc_image(*w, *h);
    2.40 + 	  if (!data)
    2.41 + 	    {
    2.42 +-	      DGifCloseFile(gif);
    2.43 ++	      DGifCloseFile(gif, NULL);
    2.44 + 	      free(rows);
    2.45 + 	      return NULL;
    2.46 + 	    }
    2.47 +@@ -79,7 +88,7 @@
    2.48 + 	      rows[i] = malloc(*w * sizeof(GifPixelType));
    2.49 + 	      if (!rows[i])
    2.50 + 		{
    2.51 +-		  DGifCloseFile(gif);
    2.52 ++		  DGifCloseFile(gif, NULL);
    2.53 + 		  for (i = 0; i < *h; i++)
    2.54 + 		    if (rows[i])
    2.55 + 		      free(rows[i]);
    2.56 +@@ -168,7 +177,7 @@
    2.57 + 	    }
    2.58 + 	}
    2.59 +     }
    2.60 +-  DGifCloseFile(gif);
    2.61 ++  DGifCloseFile(gif, NULL);
    2.62 +   for (i = 0; i < *h; i++)
    2.63 +     free(rows[i]);
    2.64 +   free(rows);
    2.65 +--- Imlib/load.c
    2.66 ++++ Imlib/load.c
    2.67 +@@ -420,6 +420,15 @@
    2.68 + #endif /* HAVE_LIBTIFF */
    2.69 + 
    2.70 + #ifdef HAVE_LIBGIF
    2.71 ++static int ErrorCode;
    2.72 ++static void PrintGifError(void)
    2.73 ++{
    2.74 ++	char *Err = GifErrorString(ErrorCode);
    2.75 ++	if (Err != NULL)
    2.76 ++		fprintf(stderr, "GIF-LIB error: %s.\n", Err);
    2.77 ++	else	fprintf(stderr, "GIF-LIB undefined error %d.\n", ErrorCode);
    2.78 ++}
    2.79 ++
    2.80 + unsigned char      *
    2.81 + _LoadGIF(ImlibData * id, FILE *f, int *w, int *h, int *t)
    2.82 + {
    2.83 +@@ -443,7 +452,7 @@
    2.84 +   fd = fileno(f);
    2.85 +   /* Apparently rewind(f) isn't sufficient */
    2.86 +   lseek(fd, (long) 0, 0);
    2.87 +-  gif = DGifOpenFileHandle(fd);
    2.88 ++  gif = DGifOpenFileHandle(fd, &ErrorCode);
    2.89 + 
    2.90 +   if (!gif)
    2.91 +     return NULL;
    2.92 +@@ -470,13 +479,13 @@
    2.93 + 	  rows = malloc(*h * sizeof(GifRowType *));
    2.94 + 	  if (!rows)
    2.95 + 	    {
    2.96 +-	      DGifCloseFile(gif);
    2.97 ++	      DGifCloseFile(gif, NULL);
    2.98 + 	      return NULL;
    2.99 + 	    }
   2.100 + 	  data = _imlib_malloc_image(*w, *h);
   2.101 + 	  if (!data)
   2.102 + 	    {
   2.103 +-	      DGifCloseFile(gif);
   2.104 ++	      DGifCloseFile(gif, NULL);
   2.105 + 	      free(rows);
   2.106 + 	      return NULL;
   2.107 + 	    }
   2.108 +@@ -487,7 +496,7 @@
   2.109 + 	      rows[i] = malloc(*w * sizeof(GifPixelType));
   2.110 + 	      if (!rows[i])
   2.111 + 		{
   2.112 +-		  DGifCloseFile(gif);
   2.113 ++		  DGifCloseFile(gif, NULL);
   2.114 + 		  for (i = 0; i < *h; i++)
   2.115 + 		    if (rows[i])
   2.116 + 		      free(rows[i]);
   2.117 +@@ -576,7 +585,7 @@
   2.118 + 	    }
   2.119 + 	}
   2.120 +     }
   2.121 +-  DGifCloseFile(gif);
   2.122 ++  DGifCloseFile(gif, NULL);
   2.123 +   for (i = 0; i < *h; i++)
   2.124 +     free(rows[i]);
   2.125 +   free(rows);
     3.1 --- a/lxpanel-dev/receipt	Fri Nov 22 10:49:44 2019 +0100
     3.2 +++ b/lxpanel-dev/receipt	Fri Nov 22 11:57:18 2019 +0100
     3.3 @@ -11,7 +11,7 @@
     3.4  HOST_ARCH="i486 arm"
     3.5  
     3.6  WANTED="lxpanel"
     3.7 -DEPENDS="pkg-config"
     3.8 +DEPENDS="pkg-config libfm-dev lxpanel"
     3.9  
    3.10  # Rules to gen a SliTaz package suitable for Tazpkg.
    3.11  genpkg_rules()
     4.1 --- a/unison/receipt	Fri Nov 22 10:49:44 2019 +0100
     4.2 +++ b/unison/receipt	Fri Nov 22 11:57:18 2019 +0100
     4.3 @@ -15,7 +15,7 @@
     4.4  # Rules to configure and make the package.
     4.5  compile_rules()
     4.6  {
     4.7 -	CFLAGS="" make UISTYLE=text unison
     4.8 +	CFLAGS="" make -j 4 UISTYLE=text unison
     4.9  }
    4.10  
    4.11  # Rules to gen a SliTaz package suitable for Tazpkg.