2015-06-24 12:56:24 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
2017-11-10 15:26:38 +00:00
|
|
|
, fetchpatch
|
2015-06-24 12:56:24 +01:00
|
|
|
, which
|
|
|
|
, cmake
|
2017-01-27 19:12:54 +00:00
|
|
|
, clang
|
|
|
|
, llvmPackages
|
2015-06-24 12:56:24 +01:00
|
|
|
, libunwind
|
|
|
|
, gettext
|
|
|
|
, openssl
|
2016-10-02 16:43:06 +01:00
|
|
|
, python2
|
|
|
|
, icu
|
|
|
|
, lttng-ust
|
|
|
|
, liburcu
|
|
|
|
, libuuid
|
2017-10-05 15:41:27 +01:00
|
|
|
, libkrb5
|
2016-10-02 16:43:06 +01:00
|
|
|
, debug ? false
|
2015-06-24 12:56:24 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "coreclr-${version}";
|
2017-10-05 15:41:27 +01:00
|
|
|
version = "2.0.0";
|
2015-06-24 12:56:24 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2016-10-02 16:43:06 +01:00
|
|
|
owner = "dotnet";
|
|
|
|
repo = "coreclr";
|
|
|
|
rev = "v${version}";
|
2017-10-05 15:41:27 +01:00
|
|
|
sha256 = "16z58ix8kmk8csfy5qsqz8z30czhrap2vb8s8vdflmbcfnq31jcw";
|
2015-06-24 12:56:24 +01:00
|
|
|
};
|
|
|
|
|
2017-11-10 15:26:38 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# glibc 2.26
|
|
|
|
url = https://github.com/dotnet/coreclr/commit/a8f83b615708c529b112898e7d2fbc3f618b26ee.patch;
|
|
|
|
sha256 = "047ph5gip4z2h7liwdxsmpnlaq0sd3hliaw4nyqjp647m80g3ffq";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2015-06-24 12:56:24 +01:00
|
|
|
buildInputs = [
|
|
|
|
which
|
|
|
|
cmake
|
2017-01-27 19:12:54 +00:00
|
|
|
clang
|
|
|
|
llvmPackages.llvm
|
|
|
|
llvmPackages.lldb
|
2015-06-24 12:56:24 +01:00
|
|
|
libunwind
|
|
|
|
gettext
|
|
|
|
openssl
|
2016-10-02 16:43:06 +01:00
|
|
|
python2
|
|
|
|
icu
|
|
|
|
lttng-ust
|
|
|
|
liburcu
|
|
|
|
libuuid
|
2017-10-05 15:41:27 +01:00
|
|
|
libkrb5
|
2015-06-24 12:56:24 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
2017-10-06 14:52:08 +01:00
|
|
|
# override to avoid cmake running
|
|
|
|
patchShebangs .
|
2015-06-24 12:56:24 +01:00
|
|
|
'';
|
|
|
|
|
2016-10-02 16:43:06 +01:00
|
|
|
BuildArch = if stdenv.is64bit then "x64" else "x86";
|
|
|
|
BuildType = if debug then "Debug" else "Release";
|
2015-06-24 12:56:24 +01:00
|
|
|
|
2017-10-06 14:52:08 +01:00
|
|
|
hardeningDisable = [
|
|
|
|
"strictoverflow"
|
|
|
|
"format"
|
2017-01-27 19:12:54 +00:00
|
|
|
];
|
2016-10-02 16:43:06 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
2017-10-06 14:52:08 +01:00
|
|
|
runHook preBuild
|
2017-10-09 23:58:11 +01:00
|
|
|
./build.sh $BuildArch $BuildType
|
2017-10-06 14:52:08 +01:00
|
|
|
runHook postBuild
|
2015-06-24 12:56:24 +01:00
|
|
|
'';
|
|
|
|
|
2016-10-02 16:43:06 +01:00
|
|
|
installPhase = ''
|
2017-10-06 14:52:08 +01: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 16:43:06 +01:00
|
|
|
'';
|
|
|
|
|
2017-10-06 14:52:08 +01:00
|
|
|
meta = with stdenv.lib; {
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://dotnet.github.io/core/;
|
2016-02-27 17:24:00 +00:00
|
|
|
description = ".NET is a general purpose development platform";
|
2015-07-22 05:26:08 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2017-10-08 21:22:07 +01:00
|
|
|
maintainers = with maintainers; [ kuznero ];
|
2017-10-06 14:52:08 +01:00
|
|
|
license = licenses.mit;
|
2015-06-24 12:56:24 +01:00
|
|
|
};
|
|
|
|
}
|