2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
|
|
|
rustPlatform,
|
|
|
|
stdenv,
|
|
|
|
libiconv,
|
|
|
|
}:
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "py-bip39-bindings";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.1.11";
|
2022-10-21 18:38:19 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "polkascan";
|
|
|
|
repo = "py-bip39-bindings";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-3/KBPUFVFkJifunGWJeAHLnY08KVTb8BHCFzDqKWH18=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "update-to-latest-maturin-and-pyo3.patch";
|
|
|
|
url = "https://github.com/polkascan/py-bip39-bindings/commit/f05cced028b43b59cfa67e17fbf0f337bdd3aa8d.patch";
|
|
|
|
hash = "sha256-/pFNSFtYyKiOoIDVqEWdZCbQxFZ7FIcvAHY2m5STlEc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "tests.py" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "bip39" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for the tiny-bip39 library";
|
|
|
|
homepage = "https://github.com/polkascan/py-bip39-bindings";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ stargate01 ];
|
|
|
|
};
|
|
|
|
}
|