diff options
author | OTABI Tomoya <tomoya.otabi@gmail.com> | 2023-08-23 14:04:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 14:04:47 +0900 |
commit | ccaca85500f7dc6ec6fba1a28d38944d999c29a2 (patch) | |
tree | bf91e58e3f83f2cd81584ef94ac74cef490ea186 | |
parent | 55e23394236bac6e5afa3d8ef5f56a8abd4b3721 (diff) | |
parent | ed60ed3562fd9497a0cbae6208ee6a94cf277b9e (diff) |
Merge pull request #249091 from TomaSajt/dotnet-fix
Fix useDotnetFromEnv's DOTNET_ROOT detection
3 files changed, 2 insertions, 6 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix index 8d0d27f673454..7012ff36a4a55 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix @@ -83,6 +83,7 @@ in shell = stdenv.shell; which = "${which}/bin/which"; dirname = "${coreutils}/bin/dirname"; + realpath = "${coreutils}/bin/realpath"; }; } ./dotnet-fixup-hook.sh) { }; } diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh index 70728e4321ede..4fec939bed33f 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh +++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/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@") diff --git a/pkgs/development/compilers/dotnet/combine-packages.nix b/pkgs/development/compilers/dotnet/combine-packages.nix index 62076a5e16a37..eaae0db2fc027 100644 --- a/pkgs/development/compilers/dotnet/combine-packages.nix +++ b/pkgs/development/compilers/dotnet/combine-packages.nix @@ -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; |