2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, fetchPypi
|
|
|
|
, nrfutil
|
|
|
|
, libnitrokey
|
|
|
|
, nix-update-script
|
|
|
|
}:
|
2022-01-27 00:19:43 +00:00
|
|
|
|
|
|
|
with python3Packages;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "pynitrokey";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.4.39";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
2022-01-27 00:19:43 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-KXYHeWwV9Tw1ZpO/vASHjDnceeb+1K0yIUohb7EcRAI=";
|
2022-01-27 00:19:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-03-30 22:05:00 +00:00
|
|
|
certifi
|
|
|
|
cffi
|
2022-01-27 00:19:43 +00:00
|
|
|
click
|
2023-07-15 17:15:38 +00:00
|
|
|
click-aliases
|
2022-01-27 00:19:43 +00:00
|
|
|
cryptography
|
|
|
|
ecdsa
|
2023-03-30 22:05:00 +00:00
|
|
|
frozendict
|
2022-01-27 00:19:43 +00:00
|
|
|
fido2
|
|
|
|
intelhex
|
2023-03-30 22:05:00 +00:00
|
|
|
nkdfu
|
2022-08-21 13:32:41 +00:00
|
|
|
nrfutil
|
2023-03-30 22:05:00 +00:00
|
|
|
python-dateutil
|
2022-01-27 00:19:43 +00:00
|
|
|
pyusb
|
|
|
|
requests
|
2023-07-15 17:15:38 +00:00
|
|
|
semver
|
2022-08-21 13:32:41 +00:00
|
|
|
spsdk
|
2023-03-30 22:05:00 +00:00
|
|
|
tqdm
|
2022-01-27 00:19:43 +00:00
|
|
|
urllib3
|
2023-03-24 00:07:29 +00:00
|
|
|
tlv8
|
2023-03-30 22:05:00 +00:00
|
|
|
typing-extensions
|
2023-10-09 19:29:22 +00:00
|
|
|
importlib-metadata
|
2023-03-24 00:07:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-10-09 19:29:22 +00:00
|
|
|
flit-core
|
2023-03-24 00:07:29 +00:00
|
|
|
pythonRelaxDepsHook
|
2022-01-27 00:19:43 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# FIXME: does pythonRelaxDepsHook not work for pypaBuildHook + flit-core?
|
|
|
|
pypaBuildFlags = [ "--skip-dependency-check" ];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
pythonRelaxDeps = [
|
2023-08-22 20:05:09 +00:00
|
|
|
"click"
|
2023-03-24 00:07:29 +00:00
|
|
|
"cryptography"
|
2023-04-29 16:46:19 +00:00
|
|
|
"protobuf"
|
2023-03-30 22:05:00 +00:00
|
|
|
"python-dateutil"
|
2023-03-24 00:07:29 +00:00
|
|
|
"spsdk"
|
2023-03-30 22:05:00 +00:00
|
|
|
"typing_extensions"
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# libnitrokey is not propagated to users of the pynitrokey Python package.
|
2023-03-30 22:05:00 +00:00
|
|
|
# It is only usable from the wrapped bin/nitropy
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"--set LIBNK_PATH ${lib.makeLibraryPath [ libnitrokey ]}"
|
2023-03-24 00:07:29 +00:00
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pynitrokey" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client for Nitrokey devices";
|
|
|
|
homepage = "https://github.com/Nitrokey/pynitrokey";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
maintainers = with maintainers; [ frogamic ];
|
|
|
|
mainProgram = "nitropy";
|
|
|
|
};
|
|
|
|
}
|