summary refs log tree commit diff
path: root/pkgs/development/python-modules/svdtools/default.nix
blob: 03db4b6356e2279ceec4ec7fef336a6853dc6eea (plain) (blame)
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
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, braceexpand
, click
, pyyaml
, lxml
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "svdtools";
  version = "0.1.21";

  disabled = pythonOlder "3.8";

  src = fetchPypi {
    inherit version pname;
    sha256 = "0qc94haqkj4dbhify1l3x0ji1dx34m79nfnsk1c7l1kl2zjvz6bz";
  };

  # remove upon next release
  # see: https://github.com/stm32-rs/svdtools/pull/96
  prePatch = ''
    substituteInPlace setup.py \
      --replace 'PyYAML ~= 5.3' 'PyYAML >= 5.3'
  '';

  propagatedBuildInputs = [
    braceexpand
    click
    pyyaml
    lxml
  ];

  checkInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "svdtools" ];

  meta = with lib; {
    description = "Python package to handle vendor-supplied, often buggy SVD files";
    homepage = "https://github.com/stm32-rs/svdtools";
    changelog = "https://github.com/stm32-rs/svdtools/blob/v${version}/CHANGELOG-python.md";
    license = with licenses; [ asl20 /* or */ mit ];
    maintainers = with maintainers; [ newam ];
  };
}