1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pyusb,
6 tqdm,
7 libusb1,
8 setuptools,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "pyfwup";
14 version = "0.5.3";
15
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "greatscottgadgets";
22 repo = "pyfwup";
23 tag = version;
24 hash = "sha256-Dy/mO5dWvuuzas9XPY8ibZCuPUP8NGaUVt0j2cvhZrM=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace-fail '"setuptools-git-versioning<2"' "" \
30 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
31 '';
32
33 dependencies = [
34 pyusb
35 tqdm
36 libusb1
37 ];
38
39 build-system = [ setuptools ];
40
41 pythonImportsCheck = [
42 "fwup"
43 "fwup_utils"
44 ];
45
46 meta = {
47 description = "Python FirmWare UPgrader";
48 homepage = "https://github.com/greatscottgadgets/pyfwup";
49 license = lib.licenses.bsd3;
50 maintainers = [ lib.maintainers.msanft ];
51 };
52}