pythonPackages.blspy: init at 1.0.2
This commit is contained in:
parent
d4fdd9a19c
commit
ffdf830cdd
58
pkgs/development/python-modules/blspy/default.nix
Normal file
58
pkgs/development/python-modules/blspy/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, fetchFromGitHub
|
||||
, setuptools-scm
|
||||
, substituteAll
|
||||
, cmake
|
||||
, boost
|
||||
, gmp
|
||||
, pybind11
|
||||
, pythonOlder
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "blspy";
|
||||
version = "1.0.2";
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-N1mk83uZrzSty2DyXfKiVp85z/jmztiUSRXKfNBRJV4=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# prevent CMake from trying to get libraries on the Internet
|
||||
(substituteAll {
|
||||
src = ./dont_fetch_dependencies.patch;
|
||||
pybind11_src = pybind11.src;
|
||||
relic_src = fetchFromGitHub {
|
||||
owner = "relic-toolkit";
|
||||
repo = "relic";
|
||||
rev = "1885ae3b681c423c72b65ce1fe70910142cf941c"; # pinned by blspy
|
||||
hash = "sha256-tsSZTcssl8t7Nqdex4BesgQ+ACPgTdtHnJFvS9josN0=";
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake setuptools-scm ];
|
||||
|
||||
buildInputs = [ boost gmp.static pybind11 ];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"blspy"
|
||||
];
|
||||
|
||||
# Note: upstream testsuite is just a single test.py script outside of any framework
|
||||
doCheck = false;
|
||||
|
||||
# CMake needs to be run by setuptools rather than by its hook
|
||||
dontConfigure = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "BLS signatures with aggregation";
|
||||
homepage = "https://github.com/Chia-Network/bls-signatures/";
|
||||
license = licenses.asl20;
|
||||
maintainers = teams.chia.members;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
diff --git a/python-bindings/CMakeLists.txt b/python-bindings/CMakeLists.txt
|
||||
index 255e3bb..5f99c3a 100644
|
||||
--- a/python-bindings/CMakeLists.txt
|
||||
+++ b/python-bindings/CMakeLists.txt
|
||||
@@ -6,8 +6,7 @@ include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
pybind11
|
||||
- GIT_REPOSITORY https://github.com/pybind/pybind11.git
|
||||
- GIT_TAG v2.6.2
|
||||
+ SOURCE_DIR @pybind11_src@
|
||||
)
|
||||
FetchContent_MakeAvailable(pybind11 relic)
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index faecc61..3272116 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -4,18 +4,9 @@ set (CMAKE_CXX_STANDARD 17)
|
||||
# CMake 3.14+
|
||||
include(FetchContent)
|
||||
|
||||
-if (DEFINED ENV{RELIC_MAIN})
|
||||
- set(RELIC_GIT_TAG "origin/main")
|
||||
-else ()
|
||||
- set(RELIC_GIT_TAG "1885ae3b681c423c72b65ce1fe70910142cf941c")
|
||||
-endif ()
|
||||
-
|
||||
-message(STATUS "Relic will be built from: ${RELIC_GIT_TAG}")
|
||||
-
|
||||
FetchContent_Declare(
|
||||
relic
|
||||
- GIT_REPOSITORY https://github.com/relic-toolkit/relic.git
|
||||
- GIT_TAG ${RELIC_GIT_TAG}
|
||||
+ SOURCE_DIR @relic_src@
|
||||
)
|
||||
FetchContent_MakeAvailable(relic)
|
||||
|
|
@ -1091,6 +1091,8 @@ in {
|
|||
|
||||
block-io = callPackage ../development/python-modules/block-io { };
|
||||
|
||||
blspy = callPackage ../development/python-modules/blspy { };
|
||||
|
||||
bluepy = callPackage ../development/python-modules/bluepy { };
|
||||
|
||||
bluepy-devices = callPackage ../development/python-modules/bluepy-devices { };
|
||||
|
|
Loading…
Reference in a new issue