2023-03-08 16:32:21 +00:00
|
|
|
{ lib
|
|
|
|
, 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";
|
2023-03-30 22:05:00 +00:00
|
|
|
version = "2022.12";
|
2023-03-08 16:32:21 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "devicetree-org";
|
|
|
|
repo = "dt-schema";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-30 22:05:00 +00:00
|
|
|
sha256 = "sha256-+wF6WdonZrkZEnlq/P6QeT3X7CMinxbapLa7q0t2zUc=";
|
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
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|