1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00

dotnet: make wrappers usable as DOTNET_ROOT

This simplifies the code a bit and makes it possible to use dotnetCorePackages.combinePackages as dotnet-runtime again.
Partial revert of ddd08e404f.
This commit is contained in:
js6pak 2024-11-24 22:40:41 +01:00 committed by David McFarland
parent e2dabfa5e1
commit 895b69405c
7 changed files with 11 additions and 12 deletions

View file

@ -52,8 +52,7 @@
{
name = "dotnet-fixup-hook";
substitutions = {
# this is used for DOTNET_ROOT, so we need unwrapped
dotnetRuntime = if (dotnet-runtime != null) then dotnet-runtime.unwrapped else null;
dotnetRuntime = if (dotnet-runtime != null) then dotnet-runtime else null;
wrapperPath = lib.makeBinPath [ which coreutils ];
};
}

View file

@ -32,7 +32,7 @@
let
dyalogHome = "$out/lib/dyalog";
makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnet-sdk_8.unwrapped}/share/dotnet";
makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnet-sdk_8}/share/dotnet";
licenseUrl = "https://www.dyalog.com/uploads/documents/Developer_Software_Licence.pdf";

View file

@ -36,7 +36,7 @@ let
cmakeFlags = [
"-DCORECLR_DIR=${coreclr-src}/src/coreclr"
"-DDOTNET_DIR=${dotnet-sdk.unwrapped}/share/dotnet"
"-DDOTNET_DIR=${dotnet-sdk}/share/dotnet"
"-DBUILD_MANAGED=0"
];
};

View file

@ -93,7 +93,7 @@ buildPythonApplication rec {
VIRTUALENV_NO_DOWNLOAD=1 PRE_COMMIT_NO_CONCURRENCY=1 LANG=en_US.UTF-8
# Resolve `.NET location: Not found` errors for dotnet tests
export DOTNET_ROOT="${dotnet-sdk.unwrapped}/share/dotnet"
export DOTNET_ROOT="${dotnet-sdk}/share/dotnet"
export HOME=$(mktemp -d)

View file

@ -20,7 +20,7 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
];`'';
(buildEnv {
name = "dotnet-core-combined";
paths = map (x: x.unwrapped) dotnetPackages;
paths = dotnetPackages;
pathsToLink = map (x: "/share/dotnet/${x}") [
"host"
"packs"
@ -34,7 +34,7 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
postBuild =
''
mkdir -p "$out"/share/dotnet
cp "${cli.unwrapped}"/share/dotnet/dotnet $out/share/dotnet
cp "${cli}"/share/dotnet/dotnet $out/share/dotnet
cp -R "${cli}"/nix-support "$out"/
mkdir "$out"/bin
ln -s "$out"/share/dotnet/dotnet "$out"/bin/dotnet

View file

@ -46,8 +46,9 @@ stdenvNoCC.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall
mkdir -p "$out"/bin "$out"/share/dotnet
mkdir -p "$out"/bin "$out"/share
ln -s "$src"/bin/* "$out"/bin
ln -s "$src"/share/dotnet "$out"/share
runHook postInstall
'';
@ -125,8 +126,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
)
(
lib.optionalString (runtime != null) ''
# TODO: use runtime here
export DOTNET_ROOT=${runtime.unwrapped}/share/dotnet
export DOTNET_ROOT=${runtime}/share/dotnet
''
+ run
);

View file

@ -21,7 +21,7 @@ let
removeReferencesTo
];
postFixup = (oldAttrs.postFixup or "") + ''
remove-references-to -t ${dotnet-runtime.unwrapped} "$out/bin/Application"
remove-references-to -t ${dotnet-runtime} "$out/bin/Application"
'';
});
@ -46,7 +46,7 @@ in
use-dotnet-root-env = testers.testEqualContents {
assertion = "buildDotnetModule uses DOTNET_ROOT from environment in wrapper";
expected = runtimeVersionFile;
actual = runCommand "use-dotnet-from-env-root-test" { env.DOTNET_ROOT = "${dotnet-runtime.unwrapped}/share/dotnet"; } ''
actual = runCommand "use-dotnet-from-env-root-test" { env.DOTNET_ROOT = "${dotnet-runtime}/share/dotnet"; } ''
${appWithoutFallback}/bin/Application >"$out"
'';
};