nixpkgs/pkgs/development/compilers/coreclr/default.nix

102 lines
2.2 KiB
Nix
Raw Normal View History

2019-02-03 16:33:35 +01:00
{ config, stdenv
2015-06-24 13:56:24 +02:00
, fetchFromGitHub
2017-11-10 16:26:38 +01:00
, fetchpatch
2015-06-24 13:56:24 +02:00
, which
, cmake
2017-01-27 20:12:54 +01:00
, clang
, llvmPackages
2015-06-24 13:56:24 +02:00
, libunwind
, gettext
, openssl
2016-10-02 17:43:06 +02:00
, python2
, icu
, lttng-ust
, liburcu
, libuuid
2017-10-05 16:41:27 +02:00
, libkrb5
2019-02-03 16:33:35 +01:00
, debug ? config.coreclr.debug or false
2015-06-24 13:56:24 +02:00
}:
stdenv.mkDerivation rec {
name = "coreclr-${version}";
2018-04-12 01:08:59 +02:00
version = "2.0.7";
2015-06-24 13:56:24 +02:00
src = fetchFromGitHub {
2016-10-02 17:43:06 +02:00
owner = "dotnet";
repo = "coreclr";
rev = "v${version}";
2018-04-12 01:08:59 +02:00
sha256 = "0pzkrfgqywhpijbx7j1v4lxa6270h6whymb64jdkp7yj56ipqh2n";
2015-06-24 13:56:24 +02:00
};
2017-11-10 16:26:38 +01:00
patches = [
(fetchpatch {
# glibc 2.26
url = https://github.com/dotnet/coreclr/commit/a8f83b615708c529b112898e7d2fbc3f618b26ee.patch;
sha256 = "047ph5gip4z2h7liwdxsmpnlaq0sd3hliaw4nyqjp647m80g3ffq";
})
2018-04-12 01:08:59 +02:00
(fetchpatch {
# clang 5
url = https://github.com/dotnet/coreclr/commit/9b22e1a767dee38f351001c5601f56d78766a43e.patch;
sha256 = "1w1lxw5ryvhq8m5m0kv880c4bh6y9xdgypkr76sqbh3v568yghzg";
})
2017-11-10 16:26:38 +01:00
];
2018-04-12 01:08:59 +02:00
nativeBuildInputs = [
2015-06-24 13:56:24 +02:00
which
cmake
2017-01-27 20:12:54 +01:00
clang
2018-04-12 01:08:59 +02:00
];
buildInputs = [
2017-01-27 20:12:54 +01:00
llvmPackages.llvm
llvmPackages.lldb
2015-06-24 13:56:24 +02:00
libunwind
gettext
openssl
2016-10-02 17:43:06 +02:00
python2
icu
lttng-ust
liburcu
libuuid
2017-10-05 16:41:27 +02:00
libkrb5
2015-06-24 13:56:24 +02:00
];
configurePhase = ''
2017-10-06 15:52:08 +02:00
# override to avoid cmake running
patchShebangs .
2015-06-24 13:56:24 +02:00
'';
2016-10-02 17:43:06 +02:00
BuildArch = if stdenv.is64bit then "x64" else "x86";
BuildType = if debug then "Debug" else "Release";
2015-06-24 13:56:24 +02:00
2017-10-06 15:52:08 +02:00
hardeningDisable = [
"strictoverflow"
"format"
2017-01-27 20:12:54 +01:00
];
2016-10-02 17:43:06 +02:00
buildPhase = ''
2017-10-06 15:52:08 +02:00
runHook preBuild
2018-04-12 01:08:59 +02:00
# disable -Werror which can potentially breaks with every compiler upgrade
./build.sh $BuildArch $BuildType cmakeargs "-DCLR_CMAKE_WARNINGS_ARE_ERRORS=OFF"
2017-10-06 15:52:08 +02:00
runHook postBuild
2015-06-24 13:56:24 +02:00
'';
2016-10-02 17:43:06 +02:00
installPhase = ''
2017-10-06 15:52:08 +02:00
runHook preInstall
mkdir -p $out/share/dotnet $out/bin
cp -r bin/Product/Linux.$BuildArch.$BuildType/* $out/share/dotnet
for cmd in coreconsole corerun createdump crossgen ilasm ildasm mcs superpmi; do
ln -s $out/share/dotnet/$cmd $out/bin/$cmd
done
runHook postInstall
2016-10-02 17:43:06 +02:00
'';
2017-10-06 15:52:08 +02:00
meta = with stdenv.lib; {
homepage = https://github.com/dotnet/core/;
description = ".NET is a general purpose development platform";
platforms = [ "x86_64-linux" ];
2017-10-08 22:22:07 +02:00
maintainers = with maintainers; [ kuznero ];
2017-10-06 15:52:08 +02:00
license = licenses.mit;
2015-06-24 13:56:24 +02:00
};
}