2015-06-24 13:56:24 +02:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, 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
|
|
|
|
, ed
|
|
|
|
, debug ? false
|
2015-06-24 13:56:24 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "coreclr-${version}";
|
2016-10-02 17:43:06 +02:00
|
|
|
version = "1.0.4";
|
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}";
|
|
|
|
sha256 = "1wpig71q0kh2yrq162d32x00zlwrrs1wymkgijh49cqkn4cwkh91";
|
2015-06-24 13:56:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
which
|
|
|
|
cmake
|
2017-01-27 20:12:54 +01:00
|
|
|
clang
|
|
|
|
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
|
|
|
|
ed
|
2015-06-24 13:56:24 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
# Prevent clang-3.5 (rather than just clang) from being selected as the compiler as that's
|
|
|
|
# not wrapped
|
2017-01-27 20:12:54 +01:00
|
|
|
# substituteInPlace src/pal/tools/gen-buildsys-clang.sh --replace "which \"clang-\$" "which \"clang-DoNotFindThisOne\$"
|
2015-06-24 13:56:24 +02:00
|
|
|
|
|
|
|
patchShebangs build.sh
|
|
|
|
patchShebangs src/pal/tools/gen-buildsys-clang.sh
|
2016-10-02 17:43:06 +02:00
|
|
|
|
|
|
|
# See https://github.com/dotnet/coreclr/issues/7573#issuecomment-253081323
|
|
|
|
ed -v ./src/pal/src/include/pal/palinternal.h << EOF
|
|
|
|
/^#undef memcpy
|
|
|
|
-1
|
|
|
|
d
|
|
|
|
+1
|
|
|
|
d
|
|
|
|
w
|
|
|
|
EOF
|
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
|
|
|
|
2016-10-02 17:43:06 +02:00
|
|
|
hardeningDisable = [ "strictoverflow" "format" ];
|
2017-01-27 20:12:54 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-Wno-error=unused-result" "-Wno-error=delete-non-virtual-dtor"
|
|
|
|
"-Wno-error=null-dereference"
|
|
|
|
];
|
2016-10-02 17:43:06 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
./build.sh $BuildArch $BuildType
|
|
|
|
|
|
|
|
# Try to make some sensible hierarchy out of the output
|
|
|
|
pushd bin/Product/Linux.$BuildArch.$BuildType
|
|
|
|
mkdir lib2
|
|
|
|
mv *.so *.so.dbg lib2
|
|
|
|
mv bin lib3
|
|
|
|
mkdir lib4
|
|
|
|
mv Loader lib4
|
|
|
|
mv inc include
|
|
|
|
mv gcinfo include
|
|
|
|
mkdir bin
|
|
|
|
mkdir -p share/doc
|
|
|
|
mv sosdocsunix.txt share/doc
|
|
|
|
for f in * ; do test -f $f && mv -v $f bin; done
|
2015-06-24 13:56:24 +02:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2016-10-02 17:43:06 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -rv bin/Product/Linux.$BuildArch.$BuildType/* $out
|
|
|
|
'';
|
|
|
|
|
2015-06-24 13:56:24 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://dotnet.github.io/core/;
|
2016-02-27 18:24:00 +01:00
|
|
|
description = ".NET is a general purpose development platform";
|
2015-07-22 06:26:08 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-06-24 13:56:24 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ obadz ];
|
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|