depot/third_party/nixpkgs/pkgs/applications/science/logic/cryptoverif/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

63 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl, ocaml, writeScript }:
stdenv.mkDerivation (finalAttrs: {
pname = "cryptoverif";
version = "2.11";
src = fetchurl {
url = "http://prosecco.gforge.inria.fr/personal/bblanche/cryptoverif/cryptoverif${finalAttrs.version}.tar.gz";
hash = "sha256-duc7t0Qpr1Z2FZEoufdQ7kcBlLbXHO+r9ivEgUxqK9s=";
};
/* Fix up the frontend to load the 'default' cryptoverif library
** from under $out/libexec. By default, it expects to find the files
** in $CWD which doesn't work. */
postPatch = ''
substituteInPlace ./src/syntax.ml \
--replace \"default\" \"$out/libexec/default\"
'';
strictDeps = true;
nativeBuildInputs = [ ocaml ];
buildPhase = ''
runHook preBuild
./build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/libexec
cp ./cryptoverif $out/bin
cp ./default.cvl $out/libexec
cp ./default.ocvl $out/libexec
runHook postInstall
'';
passthru.updateScript = writeScript "update-cryptoverif" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts curl pcre2
set -eu -o pipefail
version="$(curl -s https://bblanche.gitlabpages.inria.fr/CryptoVerif/ |
pcre2grep -o1 '\bCryptoVerif version ([.[:alnum:]]+),')"
update-source-version "$UPDATE_NIX_ATTR_PATH" "$version"
'';
meta = {
description = "Cryptographic protocol verifier in the computational model";
mainProgram = "cryptoverif";
homepage = "https://bblanche.gitlabpages.inria.fr/CryptoVerif/";
license = lib.licenses.cecill-b;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.thoughtpolice ];
};
})