1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, pythonOlder
6, pyserial
7, click
8, ecdsa
9, behave
10, nose
11}:
12
13buildPythonPackage rec {
14 pname = "adafruit-nrfutil";
15 version = "0.5.3.post17";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "adafruit";
22 repo = "Adafruit_nRF52_nrfutil";
23 rev = version;
24 hash = "sha256-mHHKOQE9AGBX8RAyaPOy+JS3fTs98+AFdq9qsVy7go4=";
25 };
26
27 patches = [
28 # Pull a patch which fixes the tests, but is not yet released in a new version:
29 # https://github.com/adafruit/Adafruit_nRF52_nrfutil/pull/38
30 (fetchpatch {
31 name = "fix-tests.patch";
32 url = "https://github.com/adafruit/Adafruit_nRF52_nrfutil/commit/e5fbcc8ee5958041db38c04139ba686bf7d1b845.patch";
33 hash = "sha256-0tbJldGtYcDdUzA3wZRv0lenXVn6dqV016U9nMpQ6/w=";
34 })
35 ];
36
37 propagatedBuildInputs = [
38 pyserial
39 click
40 ecdsa
41 ];
42
43 nativeCheckInputs = [
44 behave
45 nose
46 ];
47
48 preCheck = ''
49 mkdir test-reports
50 '';
51
52 pythonImportsCheck = [
53 "nordicsemi"
54 ];
55
56 meta = with lib; {
57 homepage = "https://github.com/adafruit/Adafruit_nRF52_nrfutil";
58 description = "Modified version of Nordic's nrfutil 0.5.x for use with the Adafruit Feather nRF52";
59 license = licenses.bsd3;
60 maintainers = with maintainers; [ stargate01 ];
61 };
62}