2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
cryptography,
|
|
|
|
click,
|
|
|
|
construct,
|
|
|
|
ecdsa,
|
|
|
|
hidapi,
|
|
|
|
intelhex,
|
|
|
|
pillow,
|
2024-07-27 06:49:29 +00:00
|
|
|
protobuf,
|
2024-06-05 15:53:02 +00:00
|
|
|
requests,
|
|
|
|
setuptools,
|
2024-07-27 06:49:29 +00:00
|
|
|
setuptools-scm,
|
2024-06-05 15:53:02 +00:00
|
|
|
tabulate,
|
|
|
|
toml,
|
|
|
|
AppKit,
|
2020-12-09 12:39:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ledgerwallet";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.5.0";
|
2023-05-24 13:37:59 +00:00
|
|
|
format = "pyproject";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LedgerHQ";
|
|
|
|
repo = "ledgerctl";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-PBULYvyO3+YaW+a1/enJtKB/DR4ndL/o/WdpETbWyZ0=";
|
2020-12-09 12:39:15 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [
|
|
|
|
setuptools
|
2024-07-27 06:49:29 +00:00
|
|
|
setuptools-scm
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ AppKit ];
|
2020-12-09 12:39:15 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-05-24 13:37:59 +00:00
|
|
|
cryptography
|
|
|
|
click
|
|
|
|
construct
|
|
|
|
ecdsa
|
|
|
|
hidapi
|
|
|
|
intelhex
|
|
|
|
pillow
|
2024-07-27 06:49:29 +00:00
|
|
|
protobuf
|
2023-05-24 13:37:59 +00:00
|
|
|
requests
|
|
|
|
tabulate
|
|
|
|
toml
|
2020-12-09 12:39:15 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail '"protobuf >=3.20,<4"' '"protobuf >=3.20"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Regenerate protobuf bindings to lift the version upper-bound and enable
|
|
|
|
# compatibility the current default protobuf library.
|
|
|
|
preBuild = ''
|
|
|
|
protoc --python_out=. --pyi_out=. ledgerwallet/proto/*.proto
|
|
|
|
'';
|
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
pythonImportsCheck = [ "ledgerwallet" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-12-09 12:39:15 +00:00
|
|
|
homepage = "https://github.com/LedgerHQ/ledgerctl";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library to control Ledger devices";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ledgerctl";
|
2020-12-09 12:39:15 +00:00
|
|
|
license = licenses.mit;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
d-xo
|
|
|
|
erdnaxe
|
|
|
|
];
|
2020-12-09 12:39:15 +00:00
|
|
|
};
|
|
|
|
}
|