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