2021-02-17 17:02:09 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, click
|
|
|
|
, cryptography
|
|
|
|
, ecdsa
|
|
|
|
, fido2
|
|
|
|
, intelhex
|
|
|
|
, pyserial
|
|
|
|
, pyusb
|
|
|
|
, requests
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "solo-python";
|
2021-06-01 10:57:12 +00:00
|
|
|
version = "0.0.30";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "flit";
|
|
|
|
disabled = pythonOlder "3.6"; # only python>=3.6 is supported
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "solokeys";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-06-01 10:57:12 +00:00
|
|
|
sha256 = "1i9kybp08qfcdx6m4wl7ij40y1v17mvvhcdg7zglwfakblf69w41";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# replaced pinned fido, with unrestricted fido version
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i '/fido2/c\"fido2",' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
2021-02-17 17:02:09 +00:00
|
|
|
cryptography
|
2020-04-24 23:36:52 +00:00
|
|
|
ecdsa
|
|
|
|
fido2
|
|
|
|
intelhex
|
|
|
|
pyserial
|
|
|
|
pyusb
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|