nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, fetchFromGitLab, buildDunePackage
2, gmp, pkg-config, dune-configurator
3, zarith, integers
4, alcotest, bisect_ppx
5}:
6
7buildDunePackage (rec {
8 pname = "class_group_vdf";
9 version = "0.0.4";
10 duneVersion = "3";
11
12 src = fetchFromGitLab {
13 owner = "nomadic-labs/cryptography";
14 repo = "ocaml-chia-vdf";
15 rev = "v${version}";
16 hash = "sha256-KvpnX2DTUyfKARNWHC2lLBGH2Ou2GfRKjw05lu4jbBs=";
17 };
18
19 minimalOCamlVersion = "4.08";
20
21 nativeBuildInputs = [
22 gmp
23 pkg-config
24 dune-configurator
25 ];
26
27 buildInputs = [
28 dune-configurator
29 ];
30
31 propagatedBuildInputs = [
32 zarith
33 integers
34 ];
35
36 checkInputs = [
37 alcotest
38 bisect_ppx
39 ];
40
41 doCheck = true;
42
43 meta = {
44 description = "Verifiable Delay Functions bindings to Chia's VDF";
45 homepage = "https://gitlab.com/nomadic-labs/tezos";
46 license = lib.licenses.mit;
47 maintainers = [ lib.maintainers.ulrikstrid ];
48 };
49}
50# 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).
51// lib.optionalAttrs (lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.14" && stdenv.hostPlatform.isMacOS && stdenv.hostPlatform.isx86_64) {
52 preHook = ''
53 export MACOSX_DEPLOYMENT_TARGET=10.14
54 '';
55})