bandwhich: 0.23.0 -> 0.23.1; move to by-name; nixfmt; useFetchCargoVendor (#356934)
[NixPkgs.git] / pkgs / by-name / ad / adafruit-nrfutil / package.nix
blob00d0d8052ab061c57927abcca0cbe8b4c0bfdeb3
2   lib,
3   python3Packages,
4   fetchFromGitHub,
5   fetchpatch,
6 }:
8 python3Packages.buildPythonApplication rec {
9   pname = "adafruit-nrfutil";
10   version = "0.5.3.post17";
11   pyproject = true;
13   src = fetchFromGitHub {
14     owner = "adafruit";
15     repo = "Adafruit_nRF52_nrfutil";
16     rev = "refs/tags/${version}";
17     hash = "sha256-mHHKOQE9AGBX8RAyaPOy+JS3fTs98+AFdq9qsVy7go4=";
18   };
20   patches = [
21     # Pull a patch which fixes the tests, but is not yet released in a new version:
22     # https://github.com/adafruit/Adafruit_nRF52_nrfutil/pull/38
23     # https://github.com/adafruit/Adafruit_nRF52_nrfutil/pull/42
24     (fetchpatch {
25       name = "fix-tests.patch";
26       url = "https://github.com/adafruit/Adafruit_nRF52_nrfutil/commit/e5fbcc8ee5958041db38c04139ba686bf7d1b845.patch";
27       hash = "sha256-0tbJldGtYcDdUzA3wZRv0lenXVn6dqV016U9nMpQ6/w=";
28     })
29     (fetchpatch {
30       name = "fix-test-test_get_vk_pem.patch";
31       url = "https://github.com/adafruit/Adafruit_nRF52_nrfutil/commit/f42cee3c2d7c8d0911f27ba24d6a140083cb85cf.patch";
32       hash = "sha256-7WoRqPKc8O5EYK7Fj1WrMJREwhueiVpkEizIfVnEPBU=";
33     })
34   ];
36   build-system = [ python3Packages.setuptools ];
38   dependencies = with python3Packages; [
39     click
40     ecdsa
41     pyserial
42   ];
44   nativeCheckInputs = with python3Packages; [
45     behave
46     pytestCheckHook
47   ];
49   preCheck = ''
50     mkdir test-reports
51   '';
53   pythonImportsCheck = [
54     "nordicsemi"
55   ];
57   meta = {
58     homepage = "https://github.com/adafruit/Adafruit_nRF52_nrfutil";
59     description = "Modified version of Nordic's nrfutil 0.5.x for use with the Adafruit Feather nRF52";
60     mainProgram = "adafruit-nrfutil";
61     # https://github.com/adafruit/Adafruit_nRF52_nrfutil/issues/41
62     license = lib.licenses.unfreeRedistributable;
63     maintainers = with lib.maintainers; [ stargate01 ];
64   };