1{ stdenv
2, lib
3, substituteAll
4, buildPythonPackage
5, fetchPypi
6, catch2
7, cmake
8, cxxopts
9, ghc_filesystem
10, pybind11
11, pytestCheckHook
12, pythonOlder
13, psutil
14, setuptools-scm
15}:
16
17buildPythonPackage rec {
18 pname = "chiapos";
19 version = "1.0.10";
20 disabled = pythonOlder "3.7";
21
22 src = fetchPypi {
23 inherit pname version;
24 sha256 = "sha256-2SqWdGzSXs53PafXnCvTGQXNJqD+5gdJnaYi2O2ABLg=";
25 };
26
27 patches = [
28 # prevent CMake from trying to get libraries on the Internet
29 (substituteAll {
30 src = ./dont_fetch_dependencies.patch;
31 inherit cxxopts ghc_filesystem;
32 catch2_src = catch2.src;
33 pybind11_src = pybind11.src;
34 })
35 ];
36
37 nativeBuildInputs = [ cmake setuptools-scm ];
38
39 buildInputs = [ pybind11 ];
40
41 checkInputs = [
42 psutil
43 pytestCheckHook
44 ];
45
46
47 # CMake needs to be run by setuptools rather than by its hook
48 dontConfigure = true;
49
50 meta = with lib; {
51 broken = stdenv.isDarwin;
52 description = "Chia proof of space library";
53 homepage = "https://www.chia.net/";
54 license = licenses.asl20;
55 maintainers = teams.chia.members;
56 };
57}