diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix b/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix new file mode 100644 index 000000000000..95d5b95718dd --- /dev/null +++ b/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix @@ -0,0 +1,33 @@ +{ stdenv, makeWrapper, runCommand, why3 }: +provers: +let configAwkScript = runCommand "why3-conf.awk" { inherit provers; } + '' + for p in $provers; do + for b in $p/bin/*; do + BASENAME=$(basename $b) + echo "/^command =/{ gsub(\"$BASENAME\", \"$b\") }" >> $out + done + done + echo '{ print }' >> $out + ''; +in +stdenv.mkDerivation { + pname = "${why3.pname}-with-provers"; + version = why3.version; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ why3 ] ++ provers; + + dontUnpack = true; + + buildPhase = '' + mkdir -p $out/share/why3/ + why3 config detect -C $out/share/why3/why3.conf + awk -i inplace -f ${configAwkScript} $out/share/why3/why3.conf + ''; + + installPhase = '' + mkdir -p $out/bin + makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--config $out/share/why3/why3.conf" + ''; +} |