summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyfwup/default.nix
blob: 7d39ec1f3408044a33de4d7e8becc583dc184c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pyusb,
  tqdm,
  libusb1,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pyfwup";
  version = "0.5.3";

  pyproject = true;

  src = fetchFromGitHub {
    owner = "greatscottgadgets";
    repo = "pyfwup";
    tag = version;
    hash = "sha256-Dy/mO5dWvuuzas9XPY8ibZCuPUP8NGaUVt0j2cvhZrM=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail '"setuptools-git-versioning<2"' "" \
      --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
  '';

  dependencies = [
    pyusb
    tqdm
    libusb1
  ];

  build-system = [ setuptools ];

  pythonImportsCheck = [
    "fwup"
    "fwup_utils"
  ];

  meta = {
    description = "Python FirmWare UPgrader";
    homepage = "https://github.com/greatscottgadgets/pyfwup";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.msanft ];
  };
}