Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

56 lines
1.3 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
setuptools,
pkgs,
pytestCheckHook,
}:
let
libsecp256k1_name =
if stdenv.hostPlatform.isLinux then
"libsecp256k1.so.{v}"
else if stdenv.hostPlatform.isDarwin then
"libsecp256k1.{v}.dylib"
else
"libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}";
in
buildPythonPackage rec {
pname = "electrum-ecc";
version = "0.0.5";
pyproject = true;
build-system = [ setuptools ];
src = fetchPypi {
pname = "electrum_ecc";
inherit version;
hash = "sha256-9zO4WWoPeyXINx0Ir2Hvece4cdW0DwWluV0tBesvt9I=";
};
env = {
# Prevent compilation of the C extension as we use the system library instead.
ELECTRUM_ECC_DONT_COMPILE = "1";
};
postPatch = ''
# remove bundled libsecp256k1
rm -rf libsecp256k1/
# use the system library instead
substituteInPlace ./src/electrum_ecc/ecc_fast.py \
--replace-fail ${libsecp256k1_name} ${pkgs.secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}
'';
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "electrum_ecc" ];
meta = with lib; {
description = "Pure python ctypes wrapper for libsecp256k1";
homepage = "https://github.com/spesmilo/electrum-ecc";
license = licenses.mit;
maintainers = [ ];
};
}