wok rev 23056

xplanet: add giflib5 patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 07 16:37:51 2020 +0100 (14 months ago)
parents add4006354aa
children 37aaa01a6b70
files giflib/receipt giflib/stuff/restore-GifQuantizeBuffer.u libgnomeprint/receipt xplanet/stuff/xplanet-giflib5.patch
line diff
     1.1 --- a/giflib/receipt	Sat Mar 07 12:23:57 2020 +0100
     1.2 +++ b/giflib/receipt	Sat Mar 07 16:37:51 2020 +0100
     1.3 @@ -18,6 +18,7 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 +	patch -p0 < $stuff/restore-GifQuantizeBuffer.u
     1.8  	sed -i 's|/local||' Makefile
     1.9  	make && make DESTDIR=$DESTDIR install
    1.10  	case "$ARCH" in
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/giflib/stuff/restore-GifQuantizeBuffer.u	Sat Mar 07 16:37:51 2020 +0100
     2.3 @@ -0,0 +1,30 @@
     2.4 +--- Makefile	2019-03-28 14:57:23.000000000 -0400
     2.5 ++++ Makefile	2019-03-31 23:38:20.700603561 -0400
     2.6 +@@ -67,8 +67,8 @@ 
     2.7 + 
     2.8 + $(UTILS):: libgif.a libutil.a
     2.9 + 
    2.10 +-libgif.so: $(OBJECTS) $(HEADERS)
    2.11 +-	$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS)
    2.12 ++libgif.so: $(OBJECTS) $(HEADERS) $(UOBJECTS)
    2.13 ++	$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,libgif.so.$(LIBMAJOR) -o libgif.so $(OBJECTS) $(UOBJECTS)
    2.14 + 
    2.15 + libgif.a: $(OBJECTS) $(HEADERS)
    2.16 + 	$(AR) rcs libgif.a $(OBJECTS)
    2.17 +--- gif_lib.h	
    2.18 ++++ gif_lib.h	
    2.19 +@@ -295,6 +295,14 @@ extern void GifDrawBoxedText8x8(SavedIma
    2.20 +                           const char *legend,
    2.21 +                           const int border, const int bg, const int fg);
    2.22 + 
    2.23 ++/******************************************************************************
    2.24 ++ Color table quantization
    2.25 ++******************************************************************************/
    2.26 ++int GifQuantizeBuffer(unsigned int Width, unsigned int Height,
    2.27 ++                   int *ColorMapSize, GifByteType * RedInput,
    2.28 ++                   GifByteType * GreenInput, GifByteType * BlueInput,
    2.29 ++                   GifByteType * OutputBuffer,
    2.30 ++                   GifColorType * OutputColorMap);
    2.31 + #ifdef __cplusplus
    2.32 + }
    2.33 + #endif /* __cplusplus */
     3.1 --- a/libgnomeprint/receipt	Sat Mar 07 12:23:57 2020 +0100
     3.2 +++ b/libgnomeprint/receipt	Sat Mar 07 16:37:51 2020 +0100
     3.3 @@ -17,8 +17,8 @@
     3.4  # Rules to configure and make the package.
     3.5  compile_rules()
     3.6  {
     3.7 -	# YYPARSE_PARAM is no longer supported in Bison 3
     3.8 -	sed -e '/YYPARSE_PARAM/d' -e 's|yyerror (|yyerror (graph_t *g, |' \
     3.9 +	# Update for Bison 3
    3.10 +	sed -e '/YYPARSE_PARAM/d' -e 's|yyerror (|&graph_t *g, |' \
    3.11  		-e 's|%pure_parser|&\n%parse-param { graph_t *graph }|' \
    3.12  		-i libgnomeprint/grammar.y
    3.13  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/xplanet/stuff/xplanet-giflib5.patch	Sat Mar 07 16:37:51 2020 +0100
     4.3 @@ -0,0 +1,214 @@
     4.4 +--- xplanet-1.3.0.orig/src/libimage/gif.c	2006-03-25 14:50:51.000000000 -0800
     4.5 ++++ xplanet-1.3.0/src/libimage/gif.c	2015-01-30 21:01:52.000000000 -0800
     4.6 +@@ -28,6 +28,18 @@
     4.7 +   distribution. 
     4.8 + */
     4.9 + 
    4.10 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.11 ++void
    4.12 ++PrintGifError(int ErrorCode) {
    4.13 ++    const char *Err = GifErrorString(ErrorCode);
    4.14 ++    if (Err != NULL)
    4.15 ++        fprintf(stderr, "GIF-LIB error: %s.\n", Err);
    4.16 ++    else
    4.17 ++        fprintf(stderr, "GIF-LIB undefined error %d.\n", ErrorCode);
    4.18 ++}
    4.19 ++#endif
    4.20 ++
    4.21 ++
    4.22 + int
    4.23 + read_gif(const char *filename, int *width, int *height, unsigned char **rgb)
    4.24 + {
    4.25 +@@ -41,12 +53,23 @@
    4.26 +     int i, j;
    4.27 +     int color_index;
    4.28 +     unsigned char *ptr = NULL;
    4.29 +-
    4.30 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.31 ++    int err;
    4.32 ++#endif
    4.33 ++
    4.34 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.35 ++    infile = DGifOpenFileName(filename, NULL);
    4.36 ++#else
    4.37 +     infile = DGifOpenFileName(filename);
    4.38 ++#endif
    4.39 + 
    4.40 +     if (infile == NULL)
    4.41 +     {
    4.42 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.43 ++        PrintGifError(infile->Error);
    4.44 ++#else
    4.45 +         PrintGifError();
    4.46 ++#endif
    4.47 +         return(0);
    4.48 +     }
    4.49 + 
    4.50 +@@ -54,7 +77,11 @@
    4.51 +     {
    4.52 +         if (DGifGetRecordType(infile, &record_type) == GIF_ERROR) 
    4.53 +         {
    4.54 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.55 ++            PrintGifError(infile->Error);
    4.56 ++#else
    4.57 +             PrintGifError();
    4.58 ++#endif
    4.59 +             return(0);
    4.60 +         }
    4.61 + 
    4.62 +@@ -63,7 +90,11 @@
    4.63 +         case IMAGE_DESC_RECORD_TYPE:
    4.64 +             if (DGifGetImageDesc(infile) == GIF_ERROR)
    4.65 +             {
    4.66 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.67 ++                PrintGifError(infile->Error);
    4.68 ++#else
    4.69 +                 PrintGifError();
    4.70 ++#endif
    4.71 +                 return(0);
    4.72 +             }
    4.73 + 
    4.74 +@@ -107,14 +138,22 @@
    4.75 +             GifByteType *ext;
    4.76 +             if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR) 
    4.77 +             {
    4.78 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.79 ++                PrintGifError(infile->Error);
    4.80 ++#else
    4.81 +                 PrintGifError();
    4.82 ++#endif
    4.83 +                 return(0);
    4.84 +             }
    4.85 +             while (ext != NULL) 
    4.86 +             {
    4.87 +                 if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR) 
    4.88 +                 {
    4.89 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
    4.90 ++                    PrintGifError(infile->Error);
    4.91 ++#else
    4.92 +                     PrintGifError();
    4.93 ++#endif
    4.94 +                     return(0);
    4.95 +                 }
    4.96 +             }
    4.97 +@@ -154,7 +193,11 @@
    4.98 +     
    4.99 +     free(buffer);
   4.100 + 
   4.101 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
   4.102 ++    DGifCloseFile(infile, NULL);
   4.103 ++#else
   4.104 +     DGifCloseFile(infile);
   4.105 ++#endif
   4.106 +     return(1);
   4.107 + }
   4.108 + 
   4.109 +@@ -166,6 +209,9 @@
   4.110 +     GifByteType *red, *green, *blue, *buffer, *ptr;
   4.111 +     GifFileType *outfile;
   4.112 +     ColorMapObject *colormap;
   4.113 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.114 ++    int err;
   4.115 ++#endif
   4.116 + 
   4.117 +     red = malloc(width * height * sizeof(GifByteType));
   4.118 +     green = malloc(width * height * sizeof(GifByteType));
   4.119 +@@ -178,7 +224,11 @@
   4.120 +         return(0);
   4.121 +     }
   4.122 + 
   4.123 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.124 ++    colormap = GifMakeMapObject(colormap_size, NULL);
   4.125 ++#else
   4.126 +     colormap = MakeMapObject(colormap_size, NULL);
   4.127 ++#endif
   4.128 + 
   4.129 +     for (i = 0; i < width * height; i++)
   4.130 +     {
   4.131 +@@ -187,10 +237,17 @@
   4.132 +         blue[i]  = (GifByteType) rgb[3*i+2];
   4.133 +     }
   4.134 +   
   4.135 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.136 ++    if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue,   
   4.137 ++                          buffer, colormap->Colors) == GIF_ERROR)
   4.138 ++    {
   4.139 ++        PrintGifError(-1);
   4.140 ++#else
   4.141 +     if (QuantizeBuffer(width, height, &colormap_size, red, green, blue,   
   4.142 +                        buffer, colormap->Colors) == GIF_ERROR)
   4.143 +     {
   4.144 +         PrintGifError();
   4.145 ++#endif
   4.146 +         return(0);
   4.147 +     }
   4.148 + 
   4.149 +@@ -198,24 +255,41 @@
   4.150 +     free(green);
   4.151 +     free(blue);
   4.152 + 
   4.153 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.154 ++    outfile = EGifOpenFileName((char *) filename, 0, &err);
   4.155 ++    if (outfile == NULL)
   4.156 ++    {
   4.157 ++        PrintGifError(err);
   4.158 ++        return(0);
   4.159 ++    }
   4.160 ++#else
   4.161 +     outfile = EGifOpenFileName((char *) filename, FALSE);
   4.162 +     if (outfile == NULL)
   4.163 +     {
   4.164 +         PrintGifError();
   4.165 +         return(0);
   4.166 +     }
   4.167 ++#endif
   4.168 + 
   4.169 +     if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap)
   4.170 +         == GIF_ERROR)
   4.171 +     {
   4.172 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.173 ++        PrintGifError(outfile->Error);
   4.174 ++#else
   4.175 +         PrintGifError();
   4.176 ++#endif
   4.177 +         return(0);
   4.178 +     }
   4.179 + 
   4.180 +-    if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL)
   4.181 ++    if (EGifPutImageDesc(outfile, 0, 0, width, height, 0, NULL)
   4.182 +         == GIF_ERROR)
   4.183 +     {
   4.184 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.185 ++        PrintGifError(outfile->Error);
   4.186 ++#else
   4.187 +         PrintGifError();
   4.188 ++#endif
   4.189 +         return(0);
   4.190 +     }
   4.191 + 
   4.192 +@@ -224,7 +298,11 @@
   4.193 +     {
   4.194 +         if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
   4.195 +         {
   4.196 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
   4.197 ++            PrintGifError(outfile->Error);
   4.198 ++#else
   4.199 +             PrintGifError();
   4.200 ++#endif
   4.201 +             return(0);
   4.202 +         }
   4.203 +         ptr += width;
   4.204 +@@ -232,8 +310,13 @@
   4.205 + 
   4.206 +     EGifSpew(outfile);
   4.207 + 
   4.208 ++#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
   4.209 ++    if (EGifCloseFile(outfile, &err) == GIF_ERROR) 
   4.210 ++        PrintGifError(err);
   4.211 ++#else
   4.212 +     if (EGifCloseFile(outfile) == GIF_ERROR) 
   4.213 +         PrintGifError();
   4.214 ++#endif
   4.215 + 
   4.216 +     free(buffer);
   4.217 +