summary refs log tree commit diff
path: root/pkgs/development/libraries/libgdiplus
diff options
context:
space:
mode:
authorAlexander V. Nikolaev <avn@avnik.info>2018-03-05 15:39:01 +0200
committerobadz <obadz-git@obadz.com>2018-12-23 00:46:09 +0000
commitf382eb7d6179bc49d6fdf97a897a0353e7969eaa (patch)
treed3fd70af8b7ba307db67f4551a58173d7062d481 /pkgs/development/libraries/libgdiplus
parent26e8258c41e46bcb22c9bf039d9d3fbd4581d0e4 (diff)
downloadnixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.tar
nixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.tar.gz
nixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.tar.bz2
nixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.tar.lz
nixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.tar.xz
nixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.tar.zst
nixpkgs-f382eb7d6179bc49d6fdf97a897a0353e7969eaa.zip
libgdiplus: 2.10.9 -> 5.6
A lot of updates from mono-project' folks. Patches dropped, because both
merged upstream.

Cherry-picked by @obadz from
https://github.com/NixOS/nixpkgs/pull/36711/commits/e022209def9016a8f53a3898d4a624a784c08c4a
Diffstat (limited to 'pkgs/development/libraries/libgdiplus')
-rw-r--r--pkgs/development/libraries/libgdiplus/default.nix26
-rw-r--r--pkgs/development/libraries/libgdiplus/giflib.patch143
2 files changed, 12 insertions, 157 deletions
diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix
index d54f9203d23..10e6dd568c8 100644
--- a/pkgs/development/libraries/libgdiplus/default.nix
+++ b/pkgs/development/libraries/libgdiplus/default.nix
@@ -1,31 +1,29 @@
-{ stdenv, fetchurl, pkgconfig, glib, cairo, Carbon, fontconfig
+{ stdenv, fetchFromGitHub, pkgconfig, glib, cairo, Carbon, fontconfig
 , libtiff, giflib, libjpeg, libpng
-, libXrender, libexif }:
+, libXrender, libexif, autoreconfHook }:
 
 stdenv.mkDerivation rec {
-  name = "libgdiplus-2.10.9";
+  name = "libgdiplus-5.6";
 
-  src = fetchurl {
-    url = "https://download.mono-project.com/sources/libgdiplus/${name}.tar.bz2";
-    sha256 = "0klnbly2q0yx5p0l5z8da9lhqsjj9xqj06kdw2v7rnms4z1vdpkd";
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "libgdiplus";
+    rev = "5.6";
+    sha256 = "11xr84kng74j3pd8sx74q80a71k6dw0a502qgibcxlyqh666lfb7";
   };
 
   NIX_LDFLAGS = "-lgif";
 
-  patches =
-    [ (fetchurl {
-        url = "https://raw.github.com/MagicGroup/MagicSpecLib/master/libgdiplus/libgdiplus-2.10.1-libpng15.patch";
-        sha256 = "130r0jm065pjvbz5dkx96w37vj1wqc8fakmi2znribs14g0bl65f";
-      })
-      ./giflib.patch
-    ];
+  patches = [ ];
 
   patchFlags = "-p0";
 
   hardeningDisable = [ "format" ];
 
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
   buildInputs =
-    [ pkgconfig glib cairo fontconfig libtiff giflib
+    [ glib cairo fontconfig libtiff giflib
       libjpeg libpng libXrender libexif
     ]
     ++ stdenv.lib.optional stdenv.isDarwin Carbon;
diff --git a/pkgs/development/libraries/libgdiplus/giflib.patch b/pkgs/development/libraries/libgdiplus/giflib.patch
deleted file mode 100644
index 7b90d9863fd..00000000000
--- a/pkgs/development/libraries/libgdiplus/giflib.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-diff -Naur libgdiplus-2.10.9-orig/src/gifcodec.c libgdiplus-2.10.9/src/gifcodec.c
---- src/gifcodec.c
-+++ src/gifcodec.c
-@@ -39,8 +39,10 @@
- 
- #include "gifcodec.h"
- 
-+#if GIFLIB_MAJOR < 5
- /* giflib declares this incorrectly as EgifOpen */
- extern GifFileType *EGifOpen(void *userData, OutputFunc writeFunc);
-+#endif
- 
- /* Data structure used for callback */
- typedef struct
-@@ -105,7 +107,7 @@
- */
- 
- static int
--AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
-+AddExtensionBlockMono(SavedImage *New, int Len, int func, BYTE ExtData[])
- {
- 	ExtensionBlock	*ep;
- 
-@@ -129,7 +131,7 @@
- 
- 	if (ExtData) {
- 		memcpy(ep->Bytes, ExtData, Len);
--		ep->Function = New->Function;
-+		ep->Function = func;
- 	}
- 
- 	return (GIF_OK);
-@@ -232,20 +234,20 @@
- 			}
- 
- 			case EXTENSION_RECORD_TYPE: {
--				if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
-+				int func;
-+				if (DGifGetExtension(GifFile, &func, &ExtData) == GIF_ERROR) {
- 					return (GIF_ERROR);
- 				}
- 
- 				while (ExtData != NULL) {
- 					/* Create an extension block with our data */
--					if (AddExtensionBlockMono(&temp_save, ExtData[0], &ExtData[1]) == GIF_ERROR) {
-+					if (AddExtensionBlockMono(&temp_save, func, ExtData[0], &ExtData[1]) == GIF_ERROR) {
- 						return (GIF_ERROR);
- 					}
- 
- 					if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
- 						return (GIF_ERROR);
- 					}
--					temp_save.Function = 0;
- 				}
- 				break;
- 			}
-@@ -303,12 +305,19 @@
- 	result = NULL;
- 	loop_counter = FALSE;
- 
-+#if GIFLIB_MAJOR < 5
- 	if (from_file) {
- 		gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
- 	} else {
- 		gif = DGifOpen (stream, &gdip_gif_inputfunc);
- 	}
--	
-+#else
-+	if (from_file)
-+		gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
-+	else
-+		gif = DGifOpen(stream, &gdip_gif_inputfunc, NULL);
-+#endif
-+
- 	if (gif == NULL) {
- 		goto error;
- 	}
-@@ -581,7 +590,7 @@
- 	}
- 
- 	FreeExtensionMono(&global_extensions);
--	DGifCloseFile (gif);
-+	DGifCloseFile (gif, NULL);
- 
- 	*image = result;
- 	return Ok;
-@@ -597,7 +606,7 @@
- 
- 	if (gif != NULL) {
- 		FreeExtensionMono (&global_extensions);
--		DGifCloseFile (gif);
-+		DGifCloseFile (gif, NULL);
- 	}
- 
- 	*image = NULL;
-@@ -660,11 +669,22 @@
- 		return InvalidParameter;
- 	}
- 
-+#if GIFLIB_MAJOR < 5
- 	if (from_file) {
- 		fp = EGifOpenFileName (stream, 0);
- 	} else {
- 		fp = EGifOpen (stream, gdip_gif_outputfunc);
- 	}
-+#else
-+	if (from_file)
-+		fp = EGifOpenFileName (stream, 0, NULL);
-+	else
-+		fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
-+#define MakeMapObject  GifMakeMapObject
-+#define FreeMapObject  GifFreeMapObject
-+#define QuantizeBuffer GifQuantizeBuffer
-+#define BitSize        GifBitSize
-+#endif
- 		
- 	if (!fp) {
- 		return FileNotFound;
-@@ -848,8 +868,15 @@
- 						Buffer[0] = 1;
- 						Buffer[1] = ptr[0];
- 						Buffer[2] = ptr[1];
-+#if GIFLIB_MAJOR < 5
- 						EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
- 						EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
-+#else
-+						EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
-+						EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
-+						EGifPutExtensionBlock(fp, 3, Buffer);
-+						EGifPutExtensionTrailer(fp);
-+#endif
- 					}
- 				}
- 
-@@ -923,7 +950,7 @@
- 		}
- 	}
- 
--	EGifCloseFile (fp);	
-+	EGifCloseFile (fp, NULL);	
- 	
- 	return Ok;
-