summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEvgeny Egorochkin <phreedom@yandex.ru>2013-12-07 13:12:31 +0200
committerEvgeny Egorochkin <phreedom@yandex.ru>2013-12-07 13:13:06 +0200
commit1f5d28001eca42c7d7f5705a57ddce99f4187b00 (patch)
tree4481f7ee0b3814538b661f6e94e4ffaeb4a3e2c6 /pkgs
parent2ce67ca947aa8621c4839a469db31c25286ac38a (diff)
downloadnixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.tar
nixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.tar.gz
nixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.tar.bz2
nixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.tar.lz
nixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.tar.xz
nixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.tar.zst
nixpkgs-1f5d28001eca42c7d7f5705a57ddce99f4187b00.zip
xplanet: fix build against giflib 5.*
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/science/astronomy/xplanet/default.nix2
-rw-r--r--pkgs/applications/science/astronomy/xplanet/giflib.patch130
2 files changed, 132 insertions, 0 deletions
diff --git a/pkgs/applications/science/astronomy/xplanet/default.nix b/pkgs/applications/science/astronomy/xplanet/default.nix
index 071942b5b0e..bdb93c99226 100644
--- a/pkgs/applications/science/astronomy/xplanet/default.nix
+++ b/pkgs/applications/science/astronomy/xplanet/default.nix
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig freetype pango libpng libtiff giflib libjpeg netpbm ];
 
+  patches = [ ./giflib.patch ];
+
   meta = {
     description = "Renders an image of the earth or other planets into the X root window";
     homepage = http://xplanet.sourceforge.net;
diff --git a/pkgs/applications/science/astronomy/xplanet/giflib.patch b/pkgs/applications/science/astronomy/xplanet/giflib.patch
new file mode 100644
index 00000000000..aaf024198fb
--- /dev/null
+++ b/pkgs/applications/science/astronomy/xplanet/giflib.patch
@@ -0,0 +1,130 @@
+diff -wbBur xplanet-1.3.0/src/libimage/gif.c /home/sergej/tmp/BUILD/staging-i686/sergej/build/xplanet/src/xplanet-1.3.0/src/libimage/gif.c
+--- xplanet-1.3.0/src/libimage/gif.c	2006-03-26 01:50:51.000000000 +0300
++++ /home/sergej/tmp/BUILD/staging-i686/sergej/build/xplanet/src/xplanet-1.3.0/src/libimage/gif.c	2013-07-30 18:21:17.412474692 +0400
+@@ -20,7 +20,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+-
++#define FALSE 0
+ #include <gif_lib.h>
+ 
+ /*
+@@ -42,11 +42,11 @@
+     int color_index;
+     unsigned char *ptr = NULL;
+ 
+-    infile = DGifOpenFileName(filename);
++    infile = DGifOpenFileName(filename, NULL);
+ 
+     if (infile == NULL)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+@@ -54,7 +54,7 @@
+     {
+         if (DGifGetRecordType(infile, &record_type) == GIF_ERROR) 
+         {
+-            PrintGifError();
++            printf("%s\n", GifErrorString(GIF_ERROR));
+             return(0);
+         }
+ 
+@@ -63,7 +63,7 @@
+         case IMAGE_DESC_RECORD_TYPE:
+             if (DGifGetImageDesc(infile) == GIF_ERROR)
+             {
+-                PrintGifError();
++                printf("%s\n", GifErrorString(GIF_ERROR));
+                 return(0);
+             }
+ 
+@@ -107,14 +107,14 @@
+             GifByteType *ext;
+             if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR) 
+             {
+-                PrintGifError();
++                printf("%s\n", GifErrorString(GIF_ERROR));
+                 return(0);
+             }
+             while (ext != NULL) 
+             {
+                 if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR) 
+                 {
+-                    PrintGifError();
++                    printf("%s\n", GifErrorString(GIF_ERROR));
+                     return(0);
+                 }
+             }
+@@ -178,7 +178,7 @@
+         return(0);
+     }
+ 
+-    colormap = MakeMapObject(colormap_size, NULL);
++    colormap = GifMakeMapObject(colormap_size, NULL);
+ 
+     for (i = 0; i < width * height; i++)
+     {
+@@ -187,10 +187,10 @@
+         blue[i]  = (GifByteType) rgb[3*i+2];
+     }
+   
+-    if (QuantizeBuffer(width, height, &colormap_size, red, green, blue,   
++    if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue,   
+                        buffer, colormap->Colors) == GIF_ERROR)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+@@ -198,24 +198,24 @@
+     free(green);
+     free(blue);
+ 
+-    outfile = EGifOpenFileName((char *) filename, FALSE);
++    outfile = EGifOpenFileName((char *) filename, FALSE, NULL);
+     if (outfile == NULL)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+     if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap)
+         == GIF_ERROR)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+     if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL)
+         == GIF_ERROR)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+@@ -224,7 +224,7 @@
+     {
+         if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
+         {
+-            PrintGifError();
++            printf("%s\n", GifErrorString(GIF_ERROR));
+             return(0);
+         }
+         ptr += width;
+@@ -233,7 +233,7 @@
+     EGifSpew(outfile);
+ 
+     if (EGifCloseFile(outfile) == GIF_ERROR) 
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+ 
+     free(buffer);
+