1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, click
6, cryptography
7, ecdsa
8, fido2
9, intelhex
10, pyserial
11, pyusb
12, requests
13}:
14
15 buildPythonPackage rec {
16 pname = "solo-python";
17 version = "0.0.27";
18 format = "flit";
19 disabled = pythonOlder "3.6"; # only python>=3.6 is supported
20
21 src = fetchFromGitHub {
22 owner = "solokeys";
23 repo = pname;
24 rev = version;
25 sha256 = "sha256-OCiKa6mnqJGoNCC4KqI+hMw22tzhdN63x9/KujNJqcE=";
26 };
27
28 # replaced pinned fido, with unrestricted fido version
29 patchPhase = ''
30 sed -i '/fido2/c\"fido2",' pyproject.toml
31 '';
32
33 propagatedBuildInputs = [
34 click
35 cryptography
36 ecdsa
37 fido2
38 intelhex
39 pyserial
40 pyusb
41 requests
42 ];
43
44 # allow for writable directory for darwin
45 preBuild = ''
46 export HOME=$TMPDIR
47 '';
48
49 # repo doesn't contain tests, ensure imports aren't broken
50 pythonImportsCheck = [
51 "solo"
52 "solo.cli"
53 "solo.commands"
54 "solo.fido2"
55 "solo.operations"
56 ];
57
58 meta = with lib; {
59 description = "Python tool and library for SoloKeys";
60 homepage = "https://github.com/solokeys/solo-python";
61 maintainers = with maintainers; [ wucke13 ];
62 license = with licenses; [ asl20 mit ];
63 # solo-python v0.0.27 does not support fido2 >= v0.9
64 # https://github.com/solokeys/solo-python/issues/110
65 broken = true;
66 };
67}