Merge pull request #30156 from kuznero/pr/coreclr2

Fix coreclr and upgrade to 2.0.0
This commit is contained in:
Jörg Thalheim 2017-10-25 13:33:07 +01:00 committed by GitHub
commit fdb4bec671
2 changed files with 24 additions and 46 deletions

View File

@ -12,19 +12,19 @@
, lttng-ust , lttng-ust
, liburcu , liburcu
, libuuid , libuuid
, ed , libkrb5
, debug ? false , debug ? false
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "coreclr-${version}"; name = "coreclr-${version}";
version = "1.0.4"; version = "2.0.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "dotnet"; owner = "dotnet";
repo = "coreclr"; repo = "coreclr";
rev = "v${version}"; rev = "v${version}";
sha256 = "1wpig71q0kh2yrq162d32x00zlwrrs1wymkgijh49cqkn4cwkh91"; sha256 = "16z58ix8kmk8csfy5qsqz8z30czhrap2vb8s8vdflmbcfnq31jcw";
}; };
buildInputs = [ buildInputs = [
@ -41,67 +41,43 @@ stdenv.mkDerivation rec {
lttng-ust lttng-ust
liburcu liburcu
libuuid libuuid
ed libkrb5
]; ];
configurePhase = '' configurePhase = ''
# Prevent clang-3.5 (rather than just clang) from being selected as the compiler as that's # override to avoid cmake running
# not wrapped patchShebangs .
# substituteInPlace src/pal/tools/gen-buildsys-clang.sh --replace "which \"clang-\$" "which \"clang-DoNotFindThisOne\$"
patchShebangs build.sh
patchShebangs src/pal/tools/gen-buildsys-clang.sh
# 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
''; '';
BuildArch = if stdenv.is64bit then "x64" else "x86"; BuildArch = if stdenv.is64bit then "x64" else "x86";
BuildType = if debug then "Debug" else "Release"; BuildType = if debug then "Debug" else "Release";
hardeningDisable = [ "strictoverflow" "format" ]; hardeningDisable = [
NIX_CFLAGS_COMPILE = [ "strictoverflow"
"-Wno-error=unused-result" "-Wno-error=delete-non-virtual-dtor" "format"
"-Wno-error=null-dereference"
]; ];
buildPhase = '' buildPhase = ''
runHook preBuild
./build.sh $BuildArch $BuildType ./build.sh $BuildArch $BuildType
runHook postBuild
# 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
popd
''; '';
installPhase = '' installPhase = ''
mkdir -p $out runHook preInstall
cp -rv bin/Product/Linux.$BuildArch.$BuildType/* $out 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
''; '';
meta = { meta = with stdenv.lib; {
homepage = http://dotnet.github.io/core/; homepage = http://dotnet.github.io/core/;
description = ".NET is a general purpose development platform"; description = ".NET is a general purpose development platform";
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
maintainers = with stdenv.lib.maintainers; [ obadz ]; maintainers = with maintainers; [ kuznero ];
license = stdenv.lib.licenses.mit; license = licenses.mit;
broken = true; # CoreCLR has proven to be very difficult to package. PRs welcome if someone wants to shave that yak.
}; };
} }

View File

@ -13179,7 +13179,9 @@ with pkgs;
comic-relief = callPackage ../data/fonts/comic-relief {}; comic-relief = callPackage ../data/fonts/comic-relief {};
coreclr = callPackage ../development/compilers/coreclr { }; coreclr = callPackage ../development/compilers/coreclr {
debug = config.coreclr.debug or false;
};
corefonts = callPackage ../data/fonts/corefonts { }; corefonts = callPackage ../data/fonts/corefonts { };