nixpkgs/pkgs/by-name/cr/cryptoverif/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

64 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 ];
};
})