about summary refs log tree commit diff
path: root/pkgs/development/tools/omnisharp-roslyn/default.nix
blob: 7818273f80f3b2bd21f4ba7c64c4106e6af33d85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ lib, fetchFromGitHub, buildDotnetModule, dotnetCorePackages }:

let
  sdkVersion = dotnetCorePackages.sdk_6_0.version;
in
buildDotnetModule rec {
  pname = "omnisharp-roslyn";
  version = "1.38.2";

  src = fetchFromGitHub {
    owner = "OmniSharp";
    repo = pname;
    rev = "v${version}";
    sha256 = "7XJIdotfffu8xo+S6xlc1zcK3oY9QIg1CJhCNJh5co0=";
  };

  projectFile = "src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj";
  nugetDeps = ./deps.nix;

  dotnetInstallFlags = [ "--framework net6.0" ];

  postPatch = ''
    # Relax the version requirement
    substituteInPlace global.json \
      --replace '6.0.100' '${sdkVersion}'
  '';

  postFixup = ''
    # Delete files to mimick hacks in https://github.com/OmniSharp/omnisharp-roslyn/blob/bdc14ca/build.cake#L594
    rm $out/lib/omnisharp-roslyn/NuGet.*.dll
    rm $out/lib/omnisharp-roslyn/System.Configuration.ConfigurationManager.dll
  '';

  meta = with lib; {
    description = "OmniSharp based on roslyn workspaces";
    homepage = "https://github.com/OmniSharp/omnisharp-roslyn";
    platforms = platforms.unix;
    sourceProvenance = with sourceTypes; [
      fromSource
      binaryNativeCode  # dependencies
    ];
    license = licenses.mit;
    maintainers = with maintainers; [ tesq0 ericdallo corngood mdarocha ];
    mainProgram = "OmniSharp";
  };
}