mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
Fix useDotnetFromEnv's DOTNET_ROOT detection
This commit is contained in:
parent
0271120180
commit
ed60ed3562
@ -83,6 +83,7 @@ in
|
||||
shell = stdenv.shell;
|
||||
which = "${which}/bin/which";
|
||||
dirname = "${coreutils}/bin/dirname";
|
||||
realpath = "${coreutils}/bin/realpath";
|
||||
};
|
||||
} ./dotnet-fixup-hook.sh) { };
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ wrapDotnetProgram() {
|
||||
if [ ! "${selfContainedBuild-}" ]; then
|
||||
if [ "${useDotnetFromEnv-}" ]; then
|
||||
# if dotnet CLI is available, set DOTNET_ROOT based on it. Otherwise set to default .NET runtime
|
||||
dotnetRootFlags+=("--run" 'command -v dotnet &>/dev/null && export DOTNET_ROOT="$(@dirname@ "$(@dirname@ "$(@which@ dotnet)")")" || export DOTNET_ROOT="@dotnetRuntime@"')
|
||||
dotnetRootFlags+=("--run" 'command -v dotnet &>/dev/null && export DOTNET_ROOT="$(@dirname@ "$(@realpath@ "$(@which@ dotnet)")")" || export DOTNET_ROOT="@dotnetRuntime@"')
|
||||
dotnetRootFlags+=("--suffix" "PATH" ":" "@dotnetRuntime@/bin")
|
||||
else
|
||||
dotnetRootFlags+=("--set" "DOTNET_ROOT" "@dotnetRuntime@")
|
||||
|
@ -17,16 +17,11 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0)
|
||||
paths = dotnetPackages;
|
||||
pathsToLink = [ "/host" "/packs" "/sdk" "/sdk-manifests" "/shared" "/templates" ];
|
||||
ignoreCollisions = true;
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
postBuild = ''
|
||||
cp -R ${cli}/{dotnet,share,nix-support} $out/
|
||||
|
||||
mkdir $out/bin
|
||||
ln -s $out/dotnet $out/bin/dotnet
|
||||
wrapProgram $out/bin/dotnet \
|
||||
--prefix LD_LIBRARY_PATH : ${cli.icu}/lib
|
||||
'';
|
||||
passthru = {
|
||||
inherit (cli) icu;
|
||||
|
Loading…
Reference in New Issue
Block a user