git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.chiavdf: init at 1.0.1
commitcef1166a10a3aa69152173ba6c110acd39ead47d authorLouis Bettens <louis@bettens.info> dateSun 9 May 2021, 10:08 (6 years ago) parenta8d87bf
3 files changed+69
pkgs/development/python-modules/chiavdf/default.nix+53 pkgs/development/python-modules/chiavdf/dont_fetch_dependencies.patch+14 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/chiavdf/default.nixnew file+53
@@ -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+}
pkgs/development/python-modules/chiavdf/dont_fetch_dependencies.patchnew file+14
@@ -0,0 +1,14 @@
1+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2+index c975128..a9f6910 100644
3+--- a/src/CMakeLists.txt
4++++ b/src/CMakeLists.txt
5+@@ -31,8 +31,7 @@ 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+
pkgs/top-level/python-packages.nix+2
@@ -1347,6 +1347,8 @@ in {
13471347
13481348 chiapos = callPackage ../development/python-modules/chiapos { };
13491349
1350+ chiavdf = callPackage ../development/python-modules/chiavdf { };
1351+
13501352 chirpstack-api = callPackage ../development/python-modules/chirpstack-api { };
13511353
13521354 ci-info = callPackage ../development/python-modules/ci-info { };