3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/misc/netcoredbg/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2 KiB
Nix
Raw Normal View History

2021-06-04 20:19:33 +01:00
{ lib, clangStdenv, stdenvNoCC, cmake, fetchFromGitHub, dotnetCorePackages, buildDotnetModule }:
let
pname = "netcoredbg";
2022-05-11 09:42:31 +01:00
version = "2.0.0-895";
2021-06-04 20:19:33 +01:00
# according to CMakeLists.txt, this should be 3.1 even when building for .NET 5
coreclr-version = "3.1.19";
coreclr-src = fetchFromGitHub {
owner = "dotnet";
repo = "coreclr";
rev = "v${coreclr-version}";
sha256 = "o1KafmXqNjX9axr6sSxPKrfUX0e+b/4ANiVQt4T2ybw=";
};
2022-05-11 09:42:31 +01:00
dotnet-sdk = dotnetCorePackages.sdk_6_0;
2021-06-04 20:19:33 +01:00
src = fetchFromGitHub {
owner = "Samsung";
repo = pname;
rev = version;
2022-05-11 09:42:31 +01:00
sha256 = "sha256-zOfChuNjD6py6KD1AmN5DgCGxD2YNH9gTyageoiN8PU=";
2021-06-04 20:19:33 +01:00
};
unmanaged = clangStdenv.mkDerivation rec {
inherit src pname version;
2022-05-11 09:42:31 +01:00
patches = [ ./limits.patch ];
nativeBuildInputs = [ cmake dotnet-sdk ];
2021-06-04 20:19:33 +01:00
hardeningDisable = [ "strictoverflow" ];
preConfigure = ''
2022-07-20 08:53:11 +01:00
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
2021-06-04 20:19:33 +01:00
dotnetVersion="$(${dotnet-sdk}/bin/dotnet --list-runtimes | grep -Po '^Microsoft.NETCore.App \K.*?(?= )')"
2022-07-20 08:53:11 +01:00
2021-06-04 20:19:33 +01:00
cmakeFlagsArray+=(
"-DDBGSHIM_RUNTIME_DIR=${dotnet-sdk}/shared/Microsoft.NETCore.App/$dotnetVersion"
)
'';
cmakeFlags = [
"-DCORECLR_DIR=${coreclr-src}"
"-DDOTNET_DIR=${dotnet-sdk}"
"-DBUILD_MANAGED=0"
];
};
managed = buildDotnetModule {
inherit pname version src dotnet-sdk;
projectFile = "src/managed/ManagedPart.csproj";
nugetDeps = ./deps.nix;
executables = [ ];
};
in
stdenvNoCC.mkDerivation {
inherit pname version;
buildCommand = ''
mkdir -p $out/share/netcoredbg $out/bin
cp ${unmanaged}/* $out/share/netcoredbg
cp ${managed}/lib/netcoredbg/* $out/share/netcoredbg
ln -s $out/share/netcoredbg/netcoredbg $out/bin/netcoredbg
'';
2022-10-10 22:40:30 +01:00
passthru = {
inherit (managed) fetch-deps;
};
2021-06-04 20:19:33 +01:00
meta = with lib; {
description = "Managed code debugger with MI interface for CoreCLR";
homepage = "https://github.com/Samsung/netcoredbg";
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.leo60228 ];
};
}