about summary refs log tree commit diff
path: root/pkgs/by-name/ro/roslyn-ls/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ro/roslyn-ls/package.nix')
-rw-r--r--pkgs/by-name/ro/roslyn-ls/package.nix66
1 files changed, 38 insertions, 28 deletions
diff --git a/pkgs/by-name/ro/roslyn-ls/package.nix b/pkgs/by-name/ro/roslyn-ls/package.nix
index 5fb77607ed47d..df3eb2e3071f6 100644
--- a/pkgs/by-name/ro/roslyn-ls/package.nix
+++ b/pkgs/by-name/ro/roslyn-ls/package.nix
@@ -1,9 +1,26 @@
-{ lib, fetchFromGitHub, buildDotnetModule, dotnetCorePackages, stdenvNoCC, testers, roslyn-ls, jq }:
+{
+  lib,
+  fetchFromGitHub,
+  buildDotnetModule,
+  dotnetCorePackages,
+  stdenvNoCC,
+  testers,
+  roslyn-ls,
+  jq,
+}:
 let
   pname = "roslyn-ls";
-  dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_6_0 sdk_7_0 sdk_8_0 sdk_9_0 ];
+  dotnet-sdk =
+    with dotnetCorePackages;
+    combinePackages [
+      sdk_6_0
+      sdk_7_0
+      sdk_8_0
+      sdk_9_0
+    ];
   # need sdk on runtime as well
   dotnet-runtime = dotnetCorePackages.sdk_9_0;
+  rid = dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system;
 
   project = "Microsoft.CodeAnalysis.LanguageServer";
 in
@@ -32,11 +49,6 @@ buildDotnetModule rec {
     # Upstream uses rollForward = latestPatch, which pins to an *exact* .NET SDK version.
     jq '.sdk.rollForward = "latestMinor"' < global.json > global.json.tmp
     mv global.json.tmp global.json
-
-    substituteInPlace $dotnetProjectFiles \
-      --replace-fail \
-        '>win-x64;win-arm64;linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>' \
-        '>linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>'
   '';
 
   dotnetFlags = [
@@ -45,35 +57,33 @@ buildDotnetModule rec {
     # see this comment: https://github.com/NixOS/nixpkgs/pull/318497#issuecomment-2256096471
     # we can remove below line after https://github.com/dotnet/roslyn/issues/73439 is fixed
     "-p:UsingToolMicrosoftNetCompilers=false"
+    "-p:TargetRid=${rid}"
   ];
 
   # two problems solved here:
   # 1. --no-build removed -> BuildHost project within roslyn is running Build target during publish
   # 2. missing crossgen2 7.* in local nuget directory when PublishReadyToRun=true
   # the latter should be fixable here but unsure how
-  installPhase =
-    let
-      rid = dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system;
-    in
-    ''
-      runHook preInstall
+  installPhase = ''
+    runHook preInstall
 
-      env dotnet publish $dotnetProjectFiles \
-          -p:ContinuousIntegrationBuild=true \
-          -p:Deterministic=true \
-          -p:InformationalVersion=$version \
-          -p:UseAppHost=true \
-          -p:PublishTrimmed=false \
-          -p:PublishReadyToRun=false \
-          --configuration Release \
-          --no-self-contained \
-          --output "$out/lib/$pname" \
-          --runtime ${rid} \
-          ''${dotnetInstallFlags[@]}  \
-          ''${dotnetFlags[@]}
+    env dotnet publish $dotnetProjectFiles \
+        -p:ContinuousIntegrationBuild=true \
+        -p:Deterministic=true \
+        -p:InformationalVersion=$version \
+        -p:UseAppHost=true \
+        -p:PublishTrimmed=false \
+        -p:PublishReadyToRun=false \
+        --configuration Release \
+        --no-self-contained \
+        --output "$out/lib/$pname" \
+        --no-restore \
+        --runtime ${rid} \
+        ''${dotnetInstallFlags[@]}  \
+        ''${dotnetFlags[@]}
 
-      runHook postInstall
-    '';
+    runHook postInstall
+  '';
 
   passthru = {
     tests.version = testers.testVersion { package = roslyn-ls; };