nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
846 B
Nix
Raw Normal View History

2021-11-13 22:28:25 +00:00
{ stdenv, makeWrapper, runCommand, why3 }:
2019-06-19 02:01:38 +00:00
provers:
let configAwkScript = runCommand "why3-conf.awk" { inherit provers; }
2021-08-16 20:50:19 +00:00
''
for p in $provers; do
for b in $p/bin/*; do
BASENAME=$(basename $b)
echo "/^command =/{ gsub(\"$BASENAME\", \"$b\") }" >> $out
2019-06-19 02:01:38 +00:00
done
2021-08-16 20:50:19 +00:00
done
echo '{ print }' >> $out
'';
in
stdenv.mkDerivation {
2022-03-22 16:57:23 +00:00
pname = "${why3.pname}-with-provers";
version = why3.version;
2019-06-19 02:01:38 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ why3 ] ++ provers;
2019-06-19 02:01:38 +00:00
2021-12-07 21:08:49 +00:00
dontUnpack = true;
2019-06-19 02:01:38 +00:00
buildPhase = ''
2021-08-16 20:50:19 +00:00
mkdir -p $out/share/why3/
2021-12-07 21:08:49 +00:00
why3 config detect -C $out/share/why3/why3.conf
2021-08-16 20:50:19 +00:00
awk -i inplace -f ${configAwkScript} $out/share/why3/why3.conf
2019-06-19 02:01:38 +00:00
'';
installPhase = ''
2021-08-16 20:50:19 +00:00
mkdir -p $out/bin
2022-04-30 13:37:40 +00:00
makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--config $out/share/why3/why3.conf"
2019-06-19 02:01:38 +00:00
'';
}