summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/dtschema/default.nix
blob: f891540dc7971c7939d8ce2a7a928333034733db (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
50
51
52
53
54
55
56
57
58
{
  stdenv,
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  jsonschema,
  rfc3987,
  ruamel-yaml,
  setuptools-scm,
  libfdt,
  pytestCheckHook,
  dtc,
}:

buildPythonPackage (finalAttrs: {
  pname = "dtschema";
  version = "2026.04";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "devicetree-org";
    repo = "dt-schema";
    tag = "v${finalAttrs.version}";
    hash = "sha256-U86h0FVmsYfoKMOaS3DRwKOUjpsm4uNTbUm2YJehaFs=";
  };

  build-system = [ setuptools-scm ];

  dependencies = [
    jsonschema
    rfc3987
    ruamel-yaml
    libfdt
  ];

  pythonImportsCheck = [ "dtschema" ];

  nativeCheckInputs = [
    pytestCheckHook
    dtc
  ];

  enabledTestPaths = [ "test/test-dt-validate.py" ];

  meta = {
    description = "Tooling for devicetree validation using YAML and jsonschema";
    homepage = "https://github.com/devicetree-org/dt-schema/";
    changelog = "https://github.com/devicetree-org/dt-schema/releases/tag/v${finalAttrs.version}";
    license = with lib.licenses; [
      bsd2 # or
      gpl2Only
    ];
    maintainers = with lib.maintainers; [ sorki ];

    # Library not loaded: @rpath/libfdt.1.dylib
    broken = stdenv.hostPlatform.isDarwin;
  };
})