2021-02-10 18:10:48 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, click
|
|
|
|
, cryptography
|
|
|
|
, ecdsa
|
|
|
|
, fido2
|
|
|
|
, intelhex
|
|
|
|
, pyserial
|
|
|
|
, pyusb
|
|
|
|
, requests
|
|
|
|
}:
|
2019-09-25 15:56:45 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "solo-python";
|
2021-02-10 18:10:48 +00:00
|
|
|
version = "0.0.27";
|
2019-09-25 15:56:45 +01:00
|
|
|
format = "flit";
|
2019-11-01 16:33:21 +00:00
|
|
|
disabled = pythonOlder "3.6"; # only python>=3.6 is supported
|
2019-09-25 15:56:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "solokeys";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-10 18:10:48 +00:00
|
|
|
sha256 = "sha256-OCiKa6mnqJGoNCC4KqI+hMw22tzhdN63x9/KujNJqcE=";
|
2019-09-25 15:56:45 +01:00
|
|
|
};
|
|
|
|
|
2019-11-01 16:33:21 +00:00
|
|
|
# replaced pinned fido, with unrestricted fido version
|
2019-09-25 15:56:45 +01:00
|
|
|
patchPhase = ''
|
2019-11-01 16:33:21 +00:00
|
|
|
sed -i '/fido2/c\"fido2",' pyproject.toml
|
2019-09-25 15:56:45 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
2021-02-10 18:10:48 +00:00
|
|
|
cryptography
|
2019-09-25 15:56:45 +01:00
|
|
|
ecdsa
|
|
|
|
fido2
|
|
|
|
intelhex
|
|
|
|
pyserial
|
|
|
|
pyusb
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2019-11-01 16:33:21 +00:00
|
|
|
# allow for writable directory for darwin
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
# repo doesn't contain tests, ensure imports aren't broken
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"solo"
|
|
|
|
"solo.cli"
|
|
|
|
"solo.commands"
|
|
|
|
"solo.fido2"
|
|
|
|
"solo.operations"
|
|
|
|
];
|
|
|
|
|
2019-09-25 15:56:45 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python tool and library for SoloKeys";
|
|
|
|
homepage = "https://github.com/solokeys/solo-python";
|
|
|
|
maintainers = with maintainers; [ wucke13 ];
|
|
|
|
license = with licenses; [ asl20 mit ];
|
2021-04-07 19:19:29 +01:00
|
|
|
# solo-python v0.0.27 does not support fido2 >= v0.9
|
|
|
|
# https://github.com/solokeys/solo-python/issues/110
|
|
|
|
broken = true;
|
2019-09-25 15:56:45 +01:00
|
|
|
};
|
|
|
|
}
|