diff mbox series

[bug#68023,12/13] gnu: Add python-dtschema.

Message ID ace05a206fda6ccb7e59fddc63f2d11129662da7.1703494195.git.othacehe@gnu.org
State New
Headers show
Series Add support for Linux `make dtbs_check` | expand

Commit Message

Mathieu Othacehe Dec. 25, 2023, 9:09 a.m. UTC
* gnu/packages/bootloaders.scm (python-dtschema): New variable.

Change-Id: Iaf5de29ea6db2cdf0998a22f48faf9126282c09d
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 gnu/packages/bootloaders.scm | 43 ++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index f8ba93ce01..fa13b630f3 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -41,6 +41,7 @@  (define-module (gnu packages bootloaders)
   #:use-module (gnu packages base)
   #:use-module (gnu packages disk)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages build-tools)
   #:use-module (gnu packages cdrom)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
@@ -60,6 +61,7 @@  (define-module (gnu packages bootloaders)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
@@ -75,6 +77,7 @@  (define-module (gnu packages bootloaders)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system pyproject)
+  #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (guix download)
   #:use-module (guix gexp)
@@ -704,6 +707,46 @@  (define-public dtc
 tree binary files.  These are board description files used by Linux and BSD.")
     (license license:gpl2+)))
 
+(define-public python-dtschema
+  (package
+    (name "python-dtschema")
+    (version "2023.11")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "dtschema" version))
+              (sha256
+               (base32
+                "0fr7byph8xpg3z37fjb8fyhmxyk8cqjfyd30rxaskh23lyg496ng"))))
+    (build-system pyproject-build-system)
+    (native-inputs
+     (list python-toml python-setuptools-scm))
+    (propagated-inputs
+     (list dtc
+           python-attrs
+           python-jsonschema
+           python-jsonschema-specifications
+           python-rfc3987
+           python-ruamel.yaml))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Fix the dependency name.
+          (add-after 'unpack 'libfdt
+            (lambda _
+              (substitute* "pyproject.toml"
+                (("pylibfdt") "libfdt"))))
+          ;; No tests.
+          (delete 'check))))
+    (home-page "https://github.com/devicetree-org/dt-schema")
+    (synopsis "Devicetree schema validation")
+    (description "This module provides tools and schema data for Devicetree
+schema validation using the json-schema vocabulary.  The tools validate
+Devicetree files using DT binding schema files.  The tools also validate the
+DT binding schema files.  Schema files are written in a JSON compatible subset
+of YAML to be both human and machine readable.")
+    (license license:bsd-2)))
+
 (define %u-boot-rockchip-inno-usb-patch
   ;; Fix regression in 2020.10 causing freezes on boot with USB boot enabled.
   ;; See https://gitlab.manjaro.org/manjaro-arm/packages/core/uboot-rockpro64/-/issues/4