From 55af73e1565a3502d15ab9c95baf762f8e1cced4 Mon Sep 17 00:00:00 2001 From: obadz Date: Sat, 22 Dec 2018 23:38:37 +0000 Subject: [PATCH 1/7] mono: only maintain major versions (mono4 & mono5) --- pkgs/development/compilers/mono/4.6.nix | 9 ---- .../compilers/mono/{4.8.nix => 4.nix} | 0 pkgs/development/compilers/mono/5.0.nix | 8 ---- pkgs/development/compilers/mono/5.4.nix | 8 ---- pkgs/development/compilers/mono/5.8.nix | 8 ---- .../compilers/mono/{5.14.nix => 5.nix} | 0 .../libraries/dbus-sharp/default.nix | 4 +- .../libraries/mono-addins/default.nix | 4 +- pkgs/servers/foundationdb/default.nix | 4 +- pkgs/top-level/all-packages.nix | 42 ++++--------------- pkgs/top-level/python-packages.nix | 2 +- 11 files changed, 14 insertions(+), 75 deletions(-) delete mode 100644 pkgs/development/compilers/mono/4.6.nix rename pkgs/development/compilers/mono/{4.8.nix => 4.nix} (100%) delete mode 100644 pkgs/development/compilers/mono/5.0.nix delete mode 100644 pkgs/development/compilers/mono/5.4.nix delete mode 100644 pkgs/development/compilers/mono/5.8.nix rename pkgs/development/compilers/mono/{5.14.nix => 5.nix} (100%) diff --git a/pkgs/development/compilers/mono/4.6.nix b/pkgs/development/compilers/mono/4.6.nix deleted file mode 100644 index 5ccdadc2878..00000000000 --- a/pkgs/development/compilers/mono/4.6.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ callPackage, Foundation, libobjc }: - -callPackage ./generic.nix (rec { - inherit Foundation libobjc; - version = "4.6.2.16"; - sha256 = "190f7kcrm1y5x61s1xwdmjnwc3czsg50s3mml4xmix7byh3x2rc9"; - enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65617511 - meta.knownVulnerabilities = [ "CVE-2018-1002208" ]; -}) diff --git a/pkgs/development/compilers/mono/4.8.nix b/pkgs/development/compilers/mono/4.nix similarity index 100% rename from pkgs/development/compilers/mono/4.8.nix rename to pkgs/development/compilers/mono/4.nix diff --git a/pkgs/development/compilers/mono/5.0.nix b/pkgs/development/compilers/mono/5.0.nix deleted file mode 100644 index 53820c97b1b..00000000000 --- a/pkgs/development/compilers/mono/5.0.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ callPackage, Foundation, libobjc }: - -callPackage ./generic-cmake.nix (rec { - inherit Foundation libobjc; - version = "5.0.1.1"; - sha256 = "064pgsmanpybpbhpam9jv9n8aicx6mlyb7a91yzh3kcksmqsxmj8"; - enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65820147 -}) diff --git a/pkgs/development/compilers/mono/5.4.nix b/pkgs/development/compilers/mono/5.4.nix deleted file mode 100644 index acebb4beef6..00000000000 --- a/pkgs/development/compilers/mono/5.4.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ callPackage, Foundation, libobjc }: - -callPackage ./generic-cmake.nix (rec { - inherit Foundation libobjc; - version = "5.4.1.6"; - sha256 = "1pv5lmyxjr8z9s17jx19850k43ylzqlbzsgr5jxj1knmkbza1zdx"; - enableParallelBuilding = false; # #32386, https://hydra.nixos.org/build/65820147 -}) diff --git a/pkgs/development/compilers/mono/5.8.nix b/pkgs/development/compilers/mono/5.8.nix deleted file mode 100644 index 7b5008fd04c..00000000000 --- a/pkgs/development/compilers/mono/5.8.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ callPackage, Foundation, libobjc }: - -callPackage ./generic-cmake.nix (rec { - inherit Foundation libobjc; - version = "5.8.0.108"; - sha256 = "177khb06dfll0pcncr84vvibni7f8m5fgb30ndgsdjk25xfcbmzc"; - enableParallelBuilding = false; -}) diff --git a/pkgs/development/compilers/mono/5.14.nix b/pkgs/development/compilers/mono/5.nix similarity index 100% rename from pkgs/development/compilers/mono/5.14.nix rename to pkgs/development/compilers/mono/5.nix diff --git a/pkgs/development/libraries/dbus-sharp/default.nix b/pkgs/development/libraries/dbus-sharp/default.nix index 2704ef2de9f..14db5baea3f 100644 --- a/pkgs/development/libraries/dbus-sharp/default.nix +++ b/pkgs/development/libraries/dbus-sharp/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchFromGitHub, pkgconfig, mono48, autoreconfHook }: +{stdenv, fetchFromGitHub, pkgconfig, mono4, autoreconfHook }: stdenv.mkDerivation rec { name = "dbus-sharp-${version}"; @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { # Use msbuild when https://github.com/NixOS/nixpkgs/pull/43680 is merged # See: https://github.com/NixOS/nixpkgs/pull/46060 - buildInputs = [ mono48 ]; + buildInputs = [ mono4 ]; dontStrip = true; diff --git a/pkgs/development/libraries/mono-addins/default.nix b/pkgs/development/libraries/mono-addins/default.nix index ca72557242f..43311c29659 100644 --- a/pkgs/development/libraries/mono-addins/default.nix +++ b/pkgs/development/libraries/mono-addins/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, mono48, gtk-sharp-2_0 }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, mono4, gtk-sharp-2_0 }: stdenv.mkDerivation rec { name = "mono-addins-${version}"; @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig autoreconfHook ]; # Use msbuild when https://github.com/NixOS/nixpkgs/pull/43680 is merged - buildInputs = [ mono48 gtk-sharp-2_0 ]; + buildInputs = [ mono4 gtk-sharp-2_0 ]; dontStrip = true; diff --git a/pkgs/servers/foundationdb/default.nix b/pkgs/servers/foundationdb/default.nix index 7e4babbb979..5d8e347de99 100644 --- a/pkgs/servers/foundationdb/default.nix +++ b/pkgs/servers/foundationdb/default.nix @@ -2,7 +2,7 @@ , lib, fetchurl, fetchpatch, fetchFromGitHub , which, findutils, m4, gawk -, python, openjdk, mono58, libressl +, python, openjdk, mono, libressl }: let @@ -50,7 +50,7 @@ let inherit rev sha256; }; - nativeBuildInputs = [ python openjdk gawk which m4 findutils mono58 ]; + nativeBuildInputs = [ python openjdk gawk which m4 findutils mono ]; buildInputs = [ libressl boost ]; patches = diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a4cbee31b9b..c27289de138 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3534,9 +3534,7 @@ in jaaa = callPackage ../applications/audio/jaaa { }; - jackett = callPackage ../servers/jackett { - mono = mono514; - }; + jackett = callPackage ../servers/jackett { }; jade = callPackage ../tools/text/sgml/jade { }; @@ -7036,9 +7034,7 @@ in fsharp = callPackage ../development/compilers/fsharp { }; - fsharp41 = callPackage ../development/compilers/fsharp41 { - mono = mono46; - }; + fsharp41 = callPackage ../development/compilers/fsharp41 { mono = mono4; }; fstar = callPackage ../development/compilers/fstar { }; @@ -7351,36 +7347,14 @@ in mlton = mlton20180207; - mono = mono5; - mono5 = mono58; - mono4 = mono48; + mono = mono5; - mono46 = lowPrio (callPackage ../development/compilers/mono/4.6.nix { + mono4 = lowPrio (callPackage ../development/compilers/mono/4.nix { inherit (darwin) libobjc; inherit (darwin.apple_sdk.frameworks) Foundation; }); - mono48 = lowPrio (callPackage ../development/compilers/mono/4.8.nix { - inherit (darwin) libobjc; - inherit (darwin.apple_sdk.frameworks) Foundation; - }); - - mono50 = lowPrio (callPackage ../development/compilers/mono/5.0.nix { - inherit (darwin) libobjc; - inherit (darwin.apple_sdk.frameworks) Foundation; - }); - - mono54 = lowPrio (callPackage ../development/compilers/mono/5.4.nix { - inherit (darwin) libobjc; - inherit (darwin.apple_sdk.frameworks) Foundation; - }); - - mono58 = callPackage ../development/compilers/mono/5.8.nix { - inherit (darwin) libobjc; - inherit (darwin.apple_sdk.frameworks) Foundation; - }; - - mono514 = callPackage ../development/compilers/mono/5.14.nix { + mono5 = callPackage ../development/compilers/mono/5.nix { inherit (darwin) libobjc; inherit (darwin.apple_sdk.frameworks) Foundation; }; @@ -13506,7 +13480,7 @@ in elasticmq = callPackage ../servers/elasticmq { }; eventstore = callPackage ../servers/nosql/eventstore { - mono = mono46; + mono = mono4; v8 = v8_6_x; }; @@ -16880,9 +16854,7 @@ in inherit (gnome3) evince; evolution-data-server = gnome3.evolution-data-server; - keepass = callPackage ../applications/misc/keepass { - buildDotnetPackage = buildDotnetPackage.override { mono = mono54; }; - }; + keepass = callPackage ../applications/misc/keepass { }; keepass-keeagent = callPackage ../applications/misc/keepass-plugins/keeagent { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9011f993321..b5c980080e9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3725,7 +3725,7 @@ in { pythonnet = callPackage ../development/python-modules/pythonnet { # `mono >= 4.6` required to prevent crashes encountered with earlier versions. - mono = pkgs.mono46; + mono = pkgs.mono4; }; pytz = callPackage ../development/python-modules/pytz { }; From 26e8258c41e46bcb22c9bf039d9d3fbd4581d0e4 Mon Sep 17 00:00:00 2001 From: obadz Date: Sat, 22 Dec 2018 23:51:08 +0000 Subject: [PATCH 2/7] mono5: 5.14.0.177 -> 5.16.0.220 --- pkgs/development/compilers/mono/5.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/mono/5.nix b/pkgs/development/compilers/mono/5.nix index dcf587a5fa4..ec7ad749d3b 100644 --- a/pkgs/development/compilers/mono/5.nix +++ b/pkgs/development/compilers/mono/5.nix @@ -2,7 +2,7 @@ callPackage ./generic-cmake.nix (rec { inherit Foundation libobjc; - version = "5.14.0.177"; - sha256 = "164l30fkvfgs1rh663h7dnm1yp7425bi9x2lh2y6zml8h4pgmxfl"; + version = "5.16.0.220"; + sha256 = "1qwdmxssplfdb5rq86f1j8lskvr9dfk5c8hqz9ic09ml69r8c87l"; enableParallelBuilding = false; }) From f382eb7d6179bc49d6fdf97a897a0353e7969eaa Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Mon, 5 Mar 2018 15:39:01 +0200 Subject: [PATCH 3/7] 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 --- .../libraries/libgdiplus/default.nix | 26 ++-- .../libraries/libgdiplus/giflib.patch | 143 ------------------ 2 files changed, 12 insertions(+), 157 deletions(-) delete mode 100644 pkgs/development/libraries/libgdiplus/giflib.patch 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; - From afbd840d2448cf5d5f83b24141edd11d746ad65a Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Fri, 9 Mar 2018 20:28:28 +0200 Subject: [PATCH 4/7] 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 10e6dd568c8..70353d68ca7 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/; From 57754ca28aeb261b7d442c36bd69b755415a97ee Mon Sep 17 00:00:00 2001 From: obadz Date: Sun, 23 Dec 2018 01:14:42 +0000 Subject: [PATCH 5/7] mono: delete two unused files deleted: generic.nix deleted: pkgconfig-before-gac-5x.patch --- pkgs/development/compilers/mono/generic.nix | 97 ------------------- .../mono/pkgconfig-before-gac-5x.patch | 65 ------------- 2 files changed, 162 deletions(-) delete mode 100644 pkgs/development/compilers/mono/generic.nix delete mode 100644 pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch diff --git a/pkgs/development/compilers/mono/generic.nix b/pkgs/development/compilers/mono/generic.nix deleted file mode 100644 index 06dcfb8b393..00000000000 --- a/pkgs/development/compilers/mono/generic.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11 -, callPackage, ncurses, zlib -, cacert, Foundation, libobjc, python - -, version, sha256 -, withLLVM ? false -, enableParallelBuilding ? true -, meta ? {} -}: - -let - llvm = callPackage ./llvm.nix { }; - name = "mono-${version}"; -in -stdenv.mkDerivation { - inherit name; - - src = fetchurl { - inherit sha256; - url = "https://download.mono-project.com/sources/mono/${name}.tar.bz2"; - }; - - buildInputs = - [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python - ] - ++ (stdenv.lib.optionals stdenv.isDarwin [ Foundation libobjc ]); - - propagatedBuildInputs = [glib]; - - NIX_LDFLAGS = if stdenv.isDarwin then "" else "-lgcc_s" ; - - # To overcome the bug https://bugzilla.novell.com/show_bug.cgi?id=644723 - dontDisableStatic = true; - - # In fact I think this line does not help at all to what I - # wanted to achieve: have mono to find libgdiplus automatically - configureFlags = [ - "--x-includes=${libX11.dev}/include" - "--x-libraries=${libX11.out}/lib" - "--with-libgdiplus=${libgdiplus}/lib/libgdiplus.so" - ] - ++ stdenv.lib.optionals withLLVM [ - "--enable-llvm" - "--enable-llvmloaded" - "--with-llvm=${llvm}" - ]; - - # Attempt to fix this error when running "mcs --version": - # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image - dontStrip = true; - - # We want pkg-config to take priority over the dlls in the Mono framework and the GAC - # because we control pkg-config - patches = [ ./pkgconfig-before-gac.patch ]; - - # Patch all the necessary scripts. Also, if we're using LLVM, we fix the default - # LLVM path to point into the Mono LLVM build, since it's private anyway. - preBuild = '' - makeFlagsArray=(INSTALL=`type -tp install`) - patchShebangs ./ - substituteInPlace mcs/class/corlib/System/Environment.cs --replace /usr/share "$out/share" - '' + stdenv.lib.optionalString withLLVM '' - substituteInPlace mono/mini/aot-compiler.c --replace "llvm_path = g_strdup (\"\")" "llvm_path = g_strdup (\"${llvm}/bin/\")" - ''; - - # Fix mono DLLMap so it can find libX11 and gdiplus to run winforms apps - # Other items in the DLLMap may need to be pointed to their store locations, I don't think this is exhaustive - # http://www.mono-project.com/Config_DllMap - postBuild = '' - find . -name 'config' -type f | xargs \ - sed -i -e "s@libX11.so.6@${libX11.out}/lib/libX11.so.6@g" \ - -e "s@/.*libgdiplus.so@${libgdiplus}/lib/libgdiplus.so@g" \ - ''; - - # Without this, any Mono application attempting to open an SSL connection will throw with - # The authentication or decryption has failed. - # ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. - postInstall = '' - echo "Updating Mono key store" - $out/bin/cert-sync ${cacert}/etc/ssl/certs/ca-bundle.crt - '' - # According to [1], gmcs is just mcs - # [1] https://github.com/mono/mono/blob/master/scripts/gmcs.in - + '' - ln -s $out/bin/mcs $out/bin/gmcs - ''; - - inherit enableParallelBuilding; - - meta = { - homepage = http://mono-project.com/; - description = "Cross platform, open source .NET development framework"; - platforms = stdenv.lib.platforms.x86; - maintainers = with stdenv.lib.maintainers; [ thoughtpolice obadz vrthra ]; - license = stdenv.lib.licenses.free; # Combination of LGPL/X11/GPL ? - } // meta; -} diff --git a/pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch b/pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch deleted file mode 100644 index 1b9c59402bf..00000000000 --- a/pkgs/development/compilers/mono/pkgconfig-before-gac-5x.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -Naur mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets ---- mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets.old 2017-04-24 23:45:18.348116305 +0200 -+++ mono-5.0.0/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets 2017-04-24 23:45:11.407051755 +0200 -@@ -167,8 +167,8 @@ - $(ReferencePath); - @(AdditionalReferencePath); - {HintPathFromItem}; -- {TargetFrameworkDirectory}; - {PkgConfig}; -+ {TargetFrameworkDirectory}; - {GAC}; - {RawFileName}; - $(OutDir) -diff -Naur mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets ---- mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets.old 2017-04-24 23:49:53.019616196 +0200 -+++ mono-5.0.0/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets 2017-04-24 23:50:05.709729585 +0200 -@@ -232,8 +232,8 @@ - $(ReferencePath); - @(AdditionalReferencePath); - {HintPathFromItem}; -- {TargetFrameworkDirectory}; - {PkgConfig}; -+ {TargetFrameworkDirectory}; - {GAC}; - {RawFileName}; - $(OutDir) -diff -Naur mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets ---- mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets.old 2017-04-24 23:52:33.200037047 +0200 -+++ mono-5.0.0/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets 2017-04-24 23:52:43.281125802 +0200 -@@ -139,8 +139,8 @@ - $(ReferencePath); - @(AdditionalReferencePath); - {HintPathFromItem}; -- {TargetFrameworkDirectory}; - {PkgConfig}; -+ {TargetFrameworkDirectory}; - {GAC}; - {RawFileName}; - $(OutDir) -diff -Naur mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets ---- mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets.old 2017-04-24 23:54:02.585821594 +0200 -+++ mono-5.0.0/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets 2017-04-24 23:54:09.313880438 +0200 -@@ -234,8 +234,8 @@ - $(ReferencePath); - @(AdditionalReferencePath); - {HintPathFromItem}; -- {TargetFrameworkDirectory}; - {PkgConfig}; -+ {TargetFrameworkDirectory}; - {GAC}; - {RawFileName}; - $(OutDir) -diff -Naur mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets.old mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets ---- mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets.old 2017-04-24 23:55:46.244895155 +0200 -+++ mono-5.0.0/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets 2017-04-24 23:55:51.998961342 +0200 -@@ -232,8 +232,8 @@ - $(ReferencePath); - @(AdditionalReferencePath); - {HintPathFromItem}; -- {TargetFrameworkDirectory}; - {PkgConfig}; -+ {TargetFrameworkDirectory}; - {GAC}; - {RawFileName}; - $(OutDir) From 1be47a2c001b16d1333016ad4e0e0504b0b9c7b5 Mon Sep 17 00:00:00 2001 From: obadz Date: Sun, 23 Dec 2018 17:59:57 +0000 Subject: [PATCH 6/7] mono: renamed generic-cmake.nix -> generic.nix --- pkgs/development/compilers/mono/4.nix | 2 +- pkgs/development/compilers/mono/5.nix | 2 +- .../compilers/mono/{generic-cmake.nix => generic.nix} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename pkgs/development/compilers/mono/{generic-cmake.nix => generic.nix} (100%) diff --git a/pkgs/development/compilers/mono/4.nix b/pkgs/development/compilers/mono/4.nix index f445127c0da..3c748e2dff7 100644 --- a/pkgs/development/compilers/mono/4.nix +++ b/pkgs/development/compilers/mono/4.nix @@ -1,6 +1,6 @@ { callPackage, Foundation, libobjc }: -callPackage ./generic-cmake.nix (rec { +callPackage ./generic.nix (rec { inherit Foundation libobjc; version = "4.8.1.0"; sha256 = "1vyvp2g28ihcgxgxr8nhzyzdmzicsh5djzk8dk1hj5p5f2k3ijqq"; diff --git a/pkgs/development/compilers/mono/5.nix b/pkgs/development/compilers/mono/5.nix index ec7ad749d3b..2b987b08364 100644 --- a/pkgs/development/compilers/mono/5.nix +++ b/pkgs/development/compilers/mono/5.nix @@ -1,6 +1,6 @@ { callPackage, Foundation, libobjc }: -callPackage ./generic-cmake.nix (rec { +callPackage ./generic.nix (rec { inherit Foundation libobjc; version = "5.16.0.220"; sha256 = "1qwdmxssplfdb5rq86f1j8lskvr9dfk5c8hqz9ic09ml69r8c87l"; diff --git a/pkgs/development/compilers/mono/generic-cmake.nix b/pkgs/development/compilers/mono/generic.nix similarity index 100% rename from pkgs/development/compilers/mono/generic-cmake.nix rename to pkgs/development/compilers/mono/generic.nix From 013927f93cbca5c823710042e469d573d17859c8 Mon Sep 17 00:00:00 2001 From: obadz Date: Sun, 23 Dec 2018 17:06:58 +0000 Subject: [PATCH 7/7] mono: llvm fork update 3.4svn-mono-f9b1a74368 -> 3.6-mono-2017-02-15 Also now builds with --enable-llvmloaded. Extracted by @obadz from @abbradar's #23295 https://github.com/NixOS/nixpkgs/commit/d27768ac1bb06aa4471dc5bcd500a583bd4ece24 --- .../compilers/mono/build-fix-llvm.patch | 12 -------- pkgs/development/compilers/mono/generic.nix | 1 - pkgs/development/compilers/mono/llvm.nix | 30 ++++++++----------- 3 files changed, 12 insertions(+), 31 deletions(-) delete mode 100644 pkgs/development/compilers/mono/build-fix-llvm.patch diff --git a/pkgs/development/compilers/mono/build-fix-llvm.patch b/pkgs/development/compilers/mono/build-fix-llvm.patch deleted file mode 100644 index 526986ad12c..00000000000 --- a/pkgs/development/compilers/mono/build-fix-llvm.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/lib/CodeGen/AsmPrinter/CMakeLists.txt.old b/lib/CodeGen/AsmPrinter/CMakeLists.txt -index be484a6..c92ff46 100644 ---- a/lib/CodeGen/AsmPrinter/CMakeLists.txt.old -+++ b/lib/CodeGen/AsmPrinter/CMakeLists.txt -@@ -10,6 +10,7 @@ add_llvm_library(LLVMAsmPrinter - DwarfCompileUnit.cpp - DwarfDebug.cpp - DwarfException.cpp -+ DwarfMonoException.cpp - ErlangGCPrinter.cpp - OcamlGCPrinter.cpp - Win64Exception.cpp diff --git a/pkgs/development/compilers/mono/generic.nix b/pkgs/development/compilers/mono/generic.nix index 12f833f5525..400b040ae85 100644 --- a/pkgs/development/compilers/mono/generic.nix +++ b/pkgs/development/compilers/mono/generic.nix @@ -30,7 +30,6 @@ stdenv.mkDerivation rec { ] ++ stdenv.lib.optionals withLLVM [ "--enable-llvm" - "--enable-llvmloaded" "--with-llvm=${llvm}" ]; diff --git a/pkgs/development/compilers/mono/llvm.nix b/pkgs/development/compilers/mono/llvm.nix index 8e9dcc1dbcb..616ec420d2d 100644 --- a/pkgs/development/compilers/mono/llvm.nix +++ b/pkgs/development/compilers/mono/llvm.nix @@ -1,9 +1,10 @@ { stdenv -, fetchurl -, perl +, lib +, fetchFromGitHub , groff , cmake -, python +, python2 +, perl , libffi , libbfd , libxml2 @@ -14,22 +15,16 @@ stdenv.mkDerivation rec { name = "llvm-${version}"; - version = "3.4svn-mono-f9b1a74368"; - src = fetchurl { - # from the HEAD of the 'mono3' branch - url = "https://github.com/mono/llvm/archive/f9b1a74368ec299fc04c4cfef4b5aa0992b7b806.tar.gz"; - name = "${name}.tar.gz"; - sha256 = "1bbkx4p5zdnk3nbdd5jxvbwqx8cdq8z1n1nhf639i98mggs0zhdg"; + version = "3.6-mono-2017-02-15"; + + src = fetchFromGitHub { + owner = "mono"; + repo = "llvm"; + rev = "dbb6fdffdeb780d11851a6be77c209bd7ada4bd3"; + sha256 = "07wd1cs3fdvzb1lv41b655z5zk34f47j8fgd9ljjimi5j9pj71f7"; }; - patches = [ ./build-fix-llvm.patch ]; - unpackPhase = '' - unpackFile ${src} - mv llvm-* llvm - sourceRoot=$PWD/llvm - ''; - - buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; + buildInputs = [ perl groff cmake libxml2 python2 libffi ] ++ lib.optional stdenv.isLinux valgrind; propagatedBuildInputs = [ ncurses zlib ]; @@ -43,7 +38,6 @@ stdenv.mkDerivation rec { cmakeFlags = with stdenv; [ "-DLLVM_ENABLE_FFI=ON" "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" - "-DCMAKE_CXX_FLAGS=-std=c++11" ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON"; enableParallelBuilding = true;