@@ -0,0 +1,53 @@
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+
15+buildPythonPackage rec {
16+ pname = "chiavdf";
17+ version = "1.0.1";
18+ disabled = pythonOlder "3.7";
19+
20+ src = fetchPypi {
21+ inherit pname version;
22+ hash = "sha256-z0od/VrH580+9641lKNI7jbVMlJZKCWnoT+GljnFxmU=";
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+ checkInputs = [
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+ description = "Chia verifiable delay function utilities";
49+ homepage = "https://www.chia.net/";
50+ license = licenses.asl20;
51+ maintainers = teams.chia.members;
52+ };
53+}