3
0
Fork 0
forked from mirrors/nixpkgs
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.

33 lines
833 B
Nix
Raw Normal View History

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