git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.chiapos: init at 1.0.1
commita8d87bf2e32a11cf9656138b24220821bb60d82c authorLouis Bettens <louis@bettens.info> dateSun 9 May 2021, 00:56 (6 years ago) parentbdad351
3 files changed+81
pkgs/development/python-modules/chiapos/default.nix+48 pkgs/development/python-modules/chiapos/dont_fetch_dependencies.patch+31 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/chiapos/default.nixnew file+48
@@ -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+}
pkgs/development/python-modules/chiapos/dont_fetch_dependencies.patchnew file+31
@@ -0,0 +1,31 @@
1+diff --git a/CMakeLists.txt b/CMakeLists.txt
2+index 9b4a2f5..86f849c 100644
3+--- a/CMakeLists.txt
4++++ b/CMakeLists.txt
5+@@ -18,22 +18,19 @@ include(FetchContent)
6+
7+ FetchContent_Declare(
8+ pybind11-src
9+- GIT_REPOSITORY https://github.com/pybind/pybind11.git
10+- GIT_TAG v2.6.2
11++ SOURCE_DIR @pybind11_src@
12+ )
13+ FetchContent_MakeAvailable(pybind11-src)
14+
15+ FetchContent_Declare(
16+ cxxopts
17+- GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
18+- GIT_TAG v2.2.1
19++ SOURCE_DIR @cxxopts@
20+ )
21+ FetchContent_MakeAvailable(cxxopts)
22+
23+ FetchContent_Declare(
24+ gulrak
25+- GIT_REPOSITORY https://github.com/gulrak/filesystem.git
26+- GIT_TAG v1.5.4
27++ SOURCE_DIR @ghc_filesystem@
28+ )
29+ FetchContent_MakeAvailable(gulrak)
30+
31+
pkgs/top-level/python-packages.nix+2
@@ -1345,6 +1345,8 @@ in {
13451345
13461346 chevron = callPackage ../development/python-modules/chevron { };
13471347
1348+ chiapos = callPackage ../development/python-modules/chiapos { };
1349+
13481350 chirpstack-api = callPackage ../development/python-modules/chirpstack-api { };
13491351
13501352 ci-info = callPackage ../development/python-modules/ci-info { };