diff options
| author | Robin Gloster <mail@glob.in> | 2021-05-24 09:55:24 -0500 |
|---|---|---|
| committer | Robin Gloster <mail@glob.in> | 2021-05-24 09:55:24 -0500 |
| commit | 4bc5fbef9d159e143fb7e2c3231932e6e76f667c (patch) | |
| tree | e2198f5c552e0667d838b8ec764ddb3a4d8f6dec /pkgs/development/python-modules/chiapos | |
| parent | jq: fix build with structured-attrs on darwin (diff) | |
| parent | Merge pull request #123802 from superherointj/package-virtmanager-bugfix (diff) | |
| download | nixpkgs-origin/structured-attrs.tar.gz | |
Merge remote-tracking branch 'upstream/master' into structured-attrsorigin/structured-attrs
Diffstat (limited to 'pkgs/development/python-modules/chiapos')
| -rw-r--r-- | pkgs/development/python-modules/chiapos/default.nix | 48 | ||||
| -rw-r--r-- | pkgs/development/python-modules/chiapos/dont_fetch_dependencies.patch | 31 |
2 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/chiapos/default.nix b/pkgs/development/python-modules/chiapos/default.nix new file mode 100644 index 000000000000..1faf5a94f8cc --- /dev/null +++ b/pkgs/development/python-modules/chiapos/default.nix @@ -0,0 +1,48 @@ +{ lib +, substituteAll +, buildPythonPackage +, fetchPypi +, cmake +, cxxopts +, ghc_filesystem +, pybind11 +, pythonOlder +, psutil +, setuptools-scm +}: + +buildPythonPackage rec { + pname = "chiapos"; + version = "1.0.1"; + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-kJx57EtwPBrGMpjnSzeYYhWqc/g1N1Bg8slW5oZKjg8="; + }; + + patches = [ + # prevent CMake from trying to get libraries on the Internet + (substituteAll { + src = ./dont_fetch_dependencies.patch; + inherit cxxopts ghc_filesystem; + pybind11_src = pybind11.src; + }) + ]; + + nativeBuildInputs = [ cmake setuptools-scm ]; + + buildInputs = [ pybind11 ]; + + checkInputs = [ psutil ]; + + # CMake needs to be run by setuptools rather than by its hook + dontConfigure = true; + + meta = with lib; { + description = "Chia proof of space library"; + homepage = "https://www.chia.net/"; + license = licenses.asl20; + maintainers = teams.chia.members; + }; +} diff --git a/pkgs/development/python-modules/chiapos/dont_fetch_dependencies.patch b/pkgs/development/python-modules/chiapos/dont_fetch_dependencies.patch new file mode 100644 index 000000000000..ca18fd292ca8 --- /dev/null +++ b/pkgs/development/python-modules/chiapos/dont_fetch_dependencies.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9b4a2f5..86f849c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,22 +18,19 @@ include(FetchContent) + + FetchContent_Declare( + pybind11-src +- GIT_REPOSITORY https://github.com/pybind/pybind11.git +- GIT_TAG v2.6.2 ++ SOURCE_DIR @pybind11_src@ + ) + FetchContent_MakeAvailable(pybind11-src) + + FetchContent_Declare( + cxxopts +- GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git +- GIT_TAG v2.2.1 ++ SOURCE_DIR @cxxopts@ + ) + FetchContent_MakeAvailable(cxxopts) + + FetchContent_Declare( + gulrak +- GIT_REPOSITORY https://github.com/gulrak/filesystem.git +- GIT_TAG v1.5.4 ++ SOURCE_DIR @ghc_filesystem@ + ) + FetchContent_MakeAvailable(gulrak) + + |
