proverif: add interact support

This commit is contained in:
Shogo Takata 2025-07-02 19:44:50 +09:00 committed by Vincent Laporte
parent fbdf0b99ff
commit ae5cc0f6dc
2 changed files with 39 additions and 5 deletions

View File

@ -3,6 +3,11 @@
stdenv, stdenv,
fetchurl, fetchurl,
ocamlPackages, ocamlPackages,
makeBinaryWrapper,
graphviz,
m4,
enable_interact ? false,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -16,16 +21,44 @@ stdenv.mkDerivation rec {
strictDeps = true; strictDeps = true;
nativeBuildInputs = with ocamlPackages; [ nativeBuildInputs =
with ocamlPackages;
[
ocaml ocaml
findlib findlib
]; ]
++ lib.optionals enable_interact [ makeBinaryWrapper ];
buildInputs = lib.optionals enable_interact [
ocamlPackages.lablgtk
];
nativeCheckInputs = [ m4 ];
buildPhase = ''
runHook preBuild
${if enable_interact then "./build" else "./build -nointeract"}
runHook postBuild
'';
doCheck = true;
checkPhase = ''
runHook preCheck
./test
runHook postCheck
'';
buildPhase = "./build -nointeract";
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -D -t $out/bin proverif proveriftotex install -D -t $out/bin proverif proveriftotex
install -D -t $out/share/emacs/site-lisp/ emacs/proverif.el install -D -t $out/share/emacs/site-lisp/ emacs/proverif.el
${lib.optionalString enable_interact ''
install -D -t $out/bin proverif_interact
wrapProgram $out/bin/proverif_interact \
--prefix PATH : ${lib.makeBinPath [ graphviz ]}
''}
runHook postInstall runHook postInstall
''; '';

View File

@ -0,0 +1 @@
{ proverif }: proverif.override { enable_interact = true; }