9 buildDotnetModule rec {
13 src = fetchFromGitHub {
17 hash = "sha256-x/fX4o+R72Pl02u1Zsr80Rh/4Wb/aKw90fhAGmsfFUI=";
22 # This file wasn't updated between 4.6.0 and 4.7.0.
23 runtimeJarVersion = "4.6.0";
27 writeScript "fake-gradlew-for-dafny" ''
29 javac $(find -name "*.java" | grep "^./src/main") -d classes
30 jar cf build/libs/DafnyRuntime-${runtimeJarVersion}.jar -C classes dafny
31 ''} Source/DafnyRuntime/DafnyRuntimeJava/gradlew
34 # "error NETSDK1129: The 'Publish' target is not supported without
35 # specifying a target framework. The current project targets multiple
36 # frameworks, you must specify the framework for the published
38 substituteInPlace Source/DafnyRuntime/DafnyRuntime.csproj \
39 --replace-warn TargetFrameworks TargetFramework \
40 --replace-warn "netstandard2.0;net452" net6.0
43 buildInputs = [ jdk11 ];
44 nugetDeps = ./deps.nix;
46 # Build just these projects. Building Source/Dafny.sln includes a bunch of
47 # unnecessary components like tests.
49 "Source/Dafny/Dafny.csproj"
50 "Source/DafnyRuntime/DafnyRuntime.csproj"
51 "Source/DafnyLanguageServer/DafnyLanguageServer.csproj"
54 executables = [ "Dafny" ];
57 makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ z3 ]}" ];
60 ln -s "$out/bin/Dafny" "$out/bin/dafny" || true
64 description = "Programming language with built-in specification constructs";
65 homepage = "https://research.microsoft.com/dafny";
66 maintainers = with maintainers; [ layus ];
67 license = licenses.mit;
68 platforms = with platforms; (linux ++ darwin);