summary refs log tree commit diff
diff options
context:
space:
mode:
authorTomaSajt <62384384+TomaSajt@users.noreply.github.com>2023-08-03 22:03:41 +0200
committerTomaSajt <62384384+TomaSajt@users.noreply.github.com>2023-08-08 00:37:49 +0200
commited60ed3562fd9497a0cbae6208ee6a94cf277b9e (patch)
tree8d93b523021c1f38e74b90e4d1d237c7cd70903e
parent0271120180bfabe01bad1dc4163102e9204ea878 (diff)
downloadnixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.tar
nixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.tar.gz
nixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.tar.bz2
nixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.tar.lz
nixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.tar.xz
nixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.tar.zst
nixpkgs-ed60ed3562fd9497a0cbae6208ee6a94cf277b9e.zip
Fix useDotnetFromEnv's DOTNET_ROOT detection
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix1
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh2
-rw-r--r--pkgs/development/compilers/dotnet/combine-packages.nix5
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 8d0d27f6734..7012ff36a4a 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 70728e4321e..4fec939bed3 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 62076a5e16a..eaae0db2fc0 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;