12 inherit (dotnetCorePackages) sdk_8_0 runtime_6_0;
15 finalPackage = buildDotnetModule rec {
16 pname = "omnisharp-roslyn";
19 src = fetchFromGitHub {
21 repo = "omnisharp-roslyn";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-WQIBNqUqvVA0UhSoPdf179X+GYKp4LhPvYeEAet6TnY=";
26 projectFile = "src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj";
27 nugetDeps = ./deps.nix;
30 with dotnetCorePackages;
35 dotnet-runtime = sdk_8_0;
37 dotnetInstallFlags = [ "--framework net6.0" ];
43 # These flags are set by the cake build.
44 "-property:PackageVersion=${version}"
45 "-property:AssemblyVersion=${version}.0"
46 "-property:FileVersion=${version}.0"
47 "-property:InformationalVersion=${version}"
48 "-property:RuntimeFrameworkVersion=${runtime_6_0.version}"
49 "-property:RollForward=LatestMajor"
53 # Relax the version requirement
56 # Patch the project files so we can compile them properly
57 for project in src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj; do
58 substituteInPlace $project \
59 --replace '<RuntimeIdentifiers>win7-x64;win7-x86;win10-arm64</RuntimeIdentifiers>' '<RuntimeIdentifiers>linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>'
63 useDotnetFromEnv = true;
64 executables = [ "OmniSharp" ];
70 runCommand "with-${if sdk ? version then sdk.version else "no"}-sdk"
83 expect_before timeout {
84 send_error "timeout!\n"
87 expect ".NET Core SDK ${if sdk ? version then sdk.version else sdk_8_0.version}"
88 expect "{\"Event\":\"started\","
92 exit [lindex $result 3]
98 # Make sure we can run OmniSharp with any supported SDK version, as well as without
99 with-net6-sdk = with-sdk dotnetCorePackages.sdk_6_0;
100 with-net8-sdk = with-sdk dotnetCorePackages.sdk_8_0;
101 no-sdk = with-sdk null;
104 passthru.updateScript = ./update.sh;
107 description = "OmniSharp based on roslyn workspaces";
108 homepage = "https://github.com/OmniSharp/omnisharp-roslyn";
109 sourceProvenance = with lib.sourceTypes; [
111 binaryNativeCode # dependencies
113 license = lib.licenses.mit;
114 maintainers = with lib.maintainers; [
121 mainProgram = "OmniSharp";