2023-08-10 07:59:29 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2023-03-08 16:32:21 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, jsonschema
|
|
|
|
, pythonOlder
|
|
|
|
, rfc3987
|
|
|
|
, ruamel-yaml
|
|
|
|
, setuptools-scm
|
2023-03-30 22:05:00 +00:00
|
|
|
, libfdt
|
2023-03-08 16:32:21 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dtschema";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2024.02";
|
|
|
|
format = "pyproject";
|
2023-03-08 16:32:21 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "devicetree-org";
|
|
|
|
repo = "dt-schema";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-UJU8b9BzuuUSHRjnA6hOd1bMPNOlk4LNtrQV5aZmGhI=";
|
2023-03-08 16:32:21 +00:00
|
|
|
};
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
patches = [
|
|
|
|
# Change name of pylibfdt to libfdt
|
|
|
|
./fix_libfdt_name.patch
|
|
|
|
];
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jsonschema
|
|
|
|
rfc3987
|
|
|
|
ruamel-yaml
|
2023-03-30 22:05:00 +00:00
|
|
|
libfdt
|
2023-03-08 16:32:21 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Module has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"dtschema"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
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${version}";
|
|
|
|
license = with licenses; [ bsd2 /* or */ gpl2Only ];
|
|
|
|
maintainers = with maintainers; [ sorki ];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
broken = (
|
|
|
|
# Library not loaded: @rpath/libfdt.1.dylib
|
|
|
|
stdenv.isDarwin ||
|
|
|
|
|
|
|
|
# see https://github.com/devicetree-org/dt-schema/issues/108
|
|
|
|
versionAtLeast jsonschema.version "4.18"
|
|
|
|
);
|
2023-03-08 16:32:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|