From afbd840d2448cf5d5f83b24141edd11d746ad65a Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Fri, 9 Mar 2018 20:28:28 +0200 Subject: [PATCH] libgdiplus: fix segfaults by patches from master and dropping libungif Configure script complains, that unable to build gif loading support, but it's a lie -- it builds against libgif 5, which have DGifOpenFile as well. Cherry-picked by @obadz from https://github.com/NixOS/nixpkgs/pull/36711/commits/8439304ebca3abcbd989131f77d644ab1e61ff90 (libungif was already dropped by commit b41ede5e3a3) --- .../libraries/libgdiplus/default.nix | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix index 10e6dd568c84..70353d68ca77 100644 --- a/pkgs/development/libraries/libgdiplus/default.nix +++ b/pkgs/development/libraries/libgdiplus/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchFromGitHub, pkgconfig, glib, cairo, Carbon, fontconfig , libtiff, giflib, libjpeg, libpng -, libXrender, libexif, autoreconfHook }: +, libXrender, libexif, autoreconfHook, fetchpatch }: stdenv.mkDerivation rec { name = "libgdiplus-5.6"; @@ -14,9 +14,20 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = "-lgif"; - patches = [ ]; - - patchFlags = "-p0"; + patches = [ # Series of patches cherry-picked from master, all fixes various sigsegv (or required by other patch) + (fetchpatch { + url = "https://github.com/mono/libgdiplus/commit/d33a2580a94701ff33abe28c22881d6173be57d0.patch"; + sha256 = "0rr54jylscn4icqjprqhwrncyr92r0d7kmfrrq3myskplpqv1c11"; + }) + (fetchpatch { + url ="https://github.com/mono/libgdiplus/commit/aa6aa53906935572f52f519fe4ab9ebedc051d08.patch"; + sha256 = "1wg0avm8qv5cb4vk80baflfzszm6q7ydhn89c3h6kq68hg6zsf1f"; + }) + (fetchpatch { + url = "https://github.com/mono/libgdiplus/commit/81e45a1d5a3ac3cf035bcc3fabb2859818b6cc04.patch"; + sha256 = "07wmc88cd1lqifs5x6npryni65jyy9gi8lgr2i1lb7v0fhvlyswg"; + }) + ]; hardeningDisable = [ "format" ]; @@ -32,6 +43,10 @@ stdenv.mkDerivation rec { ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so ''; + checkPhase = '' + make check -w + ''; + meta = with stdenv.lib; { description = "Mono library that provides a GDI+-compatible API on non-Windows operating systems"; homepage = https://www.mono-project.com/docs/gui/libgdiplus/;