1{
2 stdenv,
3 lib,
4 fetchFromGitLab,
5 buildDunePackage,
6 gmp,
7 pkg-config,
8 dune-configurator,
9 zarith,
10 integers,
11 stdlib-random,
12 alcotest,
13 bisect_ppx,
14}:
15
16buildDunePackage (
17 rec {
18 pname = "class_group_vdf";
19 version = "0.0.5";
20
21 src = fetchFromGitLab {
22 owner = "nomadic-labs/cryptography";
23 repo = "ocaml-chia-vdf";
24 rev = "v${version}";
25 hash = "sha256-/wPlS9JrQH+4kvEzsn2DCkAFhu0LMxlIIKQZ9jOJkco=";
26 };
27
28 minimalOCamlVersion = "4.08";
29
30 nativeBuildInputs = [
31 gmp
32 pkg-config
33 dune-configurator
34 ];
35
36 buildInputs = [
37 dune-configurator
38 ];
39
40 propagatedBuildInputs = [
41 zarith
42 integers
43 stdlib-random
44 ];
45
46 checkInputs = [
47 alcotest
48 bisect_ppx
49 ];
50
51 doCheck = true;
52
53 meta = {
54 description = "Verifiable Delay Functions bindings to Chia's VDF";
55 homepage = "https://gitlab.com/nomadic-labs/tezos";
56 license = lib.licenses.mit;
57 maintainers = [ lib.maintainers.ulrikstrid ];
58 };
59 }
60 # Darwin sdk on intel target 10.12 (2016) at the time of writing. It is likely that host will be at least 10.14 (2018). This fix allow it to build and run on 10.14 and build on 10.12 (but don't run).
61 //
62 lib.optionalAttrs
63 (
64 lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.14"
65 && stdenv.hostPlatform.isMacOS
66 && stdenv.hostPlatform.isx86_64
67 )
68 {
69 preHook = ''
70 export MACOSX_DEPLOYMENT_TARGET=10.14
71 '';
72 }
73)