1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, setuptools-scm
6, substituteAll
7, cmake
8, boost
9, gmp
10, pybind11
11, pytestCheckHook
12, pythonOlder
13}:
14
15buildPythonPackage rec {
16 pname = "chiavdf";
17 version = "1.0.8";
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-ilT7tCdX8ak3qmpXJ0LITf0ZGAdFSN4tm6GKw06A/m8=";
23 };
24
25 patches = [
26 # prevent CMake from trying to get libraries on the Internet
27 (substituteAll {
28 src = ./dont_fetch_dependencies.patch;
29 pybind11_src = pybind11.src;
30 })
31 ];
32
33 # x86 instructions are needed for this component
34 BUILD_VDF_CLIENT = lib.optionalString (!stdenv.isx86_64) "N";
35
36 nativeBuildInputs = [ cmake setuptools-scm ];
37
38 buildInputs = [ boost gmp pybind11 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ];
43
44 # CMake needs to be run by setuptools rather than by its hook
45 dontConfigure = true;
46
47 meta = with lib; {
48 broken = stdenv.isDarwin;
49 description = "Chia verifiable delay function utilities";
50 homepage = "https://www.chia.net/";
51 license = licenses.asl20;
52 maintainers = teams.chia.members;
53 };
54}