From 87c93fb8ee28444d085e8b29364834e0f78a37a9 Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Wed, 26 Apr 2017 08:41:53 +0200 Subject: [PATCH] Use proper generic-cmake --- pkgs/development/compilers/mono/5.0.nix | 2 +- .../mono/{generic-5x.nix => generic-cmake.nix} | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) rename pkgs/development/compilers/mono/{generic-5x.nix => generic-cmake.nix} (89%) diff --git a/pkgs/development/compilers/mono/5.0.nix b/pkgs/development/compilers/mono/5.0.nix index 662cb71c7f0..e51bbc0c308 100644 --- a/pkgs/development/compilers/mono/5.0.nix +++ b/pkgs/development/compilers/mono/5.0.nix @@ -1,6 +1,6 @@ { stdenv, callPackage, Foundation, libobjc }: -callPackage ./generic-5x.nix (rec { +callPackage ./generic-cmake.nix (rec { inherit Foundation libobjc; version = "5.0.0.48"; sha256 = "13n20wmijkhd7vm41lzz1n774rna67d94prl33bz1lly0idsciq0"; diff --git a/pkgs/development/compilers/mono/generic-5x.nix b/pkgs/development/compilers/mono/generic-cmake.nix similarity index 89% rename from pkgs/development/compilers/mono/generic-5x.nix rename to pkgs/development/compilers/mono/generic-cmake.nix index aa3ba368b61..71cafe2cca2 100644 --- a/pkgs/development/compilers/mono/generic-5x.nix +++ b/pkgs/development/compilers/mono/generic-cmake.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, cmake, autoconf, libtool, automake, gcc }: +{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, autoconf, libtool, automake, cmake, which }: let llvm = callPackage ./llvm.nix { }; @@ -8,11 +8,11 @@ stdenv.mkDerivation rec { src = fetchurl { inherit sha256; - url = "https://download.mono-project.com/sources/mono/${name}.tar.bz2"; + url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2"; }; buildInputs = - [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python cmake autoconf libtool automake gcc + [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python autoconf libtool automake cmake which ] ++ (stdenv.lib.optionals stdenv.isDarwin [ Foundation libobjc ]); @@ -36,6 +36,11 @@ stdenv.mkDerivation rec { "--with-llvm=${llvm}" ]; + configurePhase = '' + substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "/bin/sh" + ./autogen.sh --prefix $out + ''; + # 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; @@ -45,7 +50,7 @@ stdenv.mkDerivation rec { # 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-5x.patch ]; + 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. @@ -55,7 +60,6 @@ stdenv.mkDerivation rec { 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/\")" - echo 11111 ''; # Fix mono DLLMap so it can find libX11 and gdiplus to run winforms apps