nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildDunePackage,
4 ocaml,
5 fetchFromGitHub,
6 zlib,
7 dune-configurator,
8 zarith,
9 version ? if lib.versionAtLeast ocaml.version "4.13" then "1.21.1" else "1.20.1",
10}:
11
12buildDunePackage (finalAttrs: {
13 pname = "cryptokit";
14 inherit version;
15
16 src = fetchFromGitHub {
17 owner = "xavierleroy";
18 repo = "cryptokit";
19 tag = "release${lib.replaceStrings [ "." ] [ "" ] finalAttrs.version}";
20 hash =
21 {
22 "1.21.1" = "sha256-9JU9grZpTTrYYO9gai2UPq119HfenI1JAY+EyoR6x7Q=";
23 "1.20.1" = "sha256-VFY10jGctQfIUVv7dK06KP8zLZHLXTxvLyTCObS+W+E=";
24 }
25 ."${finalAttrs.version}";
26 };
27
28 # dont do autotools configuration, but do trigger findlib's preConfigure hook
29 configurePhase = ''
30 runHook preConfigure
31 runHook postConfigure
32 '';
33
34 buildInputs = [ dune-configurator ];
35 propagatedBuildInputs = [
36 zarith
37 zlib
38 ];
39
40 doCheck = true;
41
42 meta = {
43 homepage = "http://pauillac.inria.fr/~xleroy/software.html";
44 description = "Library of cryptographic primitives for OCaml";
45 license = lib.licenses.lgpl2Only;
46 };
47})