Subject: [bug#73523] [PATCH v3 3/3] gnu: Add pywlroots version 0.17.0

From: Aaron Covrig <[email-masked]>
Date: Thu, 24 Oct 2024 20:20:31 -0400

From: big bug <[email-masked]>

* gnu/packages/python-xyz (python-pywlroots): New variable.
---
 gnu/packages/python-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 41ed393f67..d22fef08b9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -287,6 +287,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
+  #:use-module (gnu packages wm)
   #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xdisorg)
@@ -37150,6 +37151,44 @@ (define-public python-pywayland
 Python.")
     (license license:asl2.0)))
 
+(define-public python-pywlroots
+  (package
+    (name "python-pywlroots")
+    (version "0.17.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pywlroots" version))
+       (sha256
+        (base32 "1frxqkkh2867rh0c6j0jsmzrga8k6235f6ygkk4cph2883hjpjvj"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'build 'pre-build
+                     ;; needed, otherwise pixman.h will not be found
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (let ((pixman (string-append (assoc-ref inputs "pixman")
+                                                    "/include")))
+                         (setenv "C_INCLUDE_PATH"
+                                 (string-append pixman "/" "pixman-1" ":"
+                                                (or (getenv "C_INCLUDE_PATH")
+                                                    "")))))))))
+    (inputs (list pixman wayland libinput libxkbcommon wlroots))
+    (propagated-inputs (list python-pywayland python-xkbcommon))
+    (native-inputs (append (if (%current-target-system)
+                               (list pkg-config-for-build wayland)
+                               '())
+                           (list pkg-config python-cffi)))
+    (home-page "https://github.com/flacjacket/pywlroots")
+    (synopsis "Python binding to the wlroots library using cffi")
+    (description
+     "A Python binding to the wlroots library using cffi.  The library uses
+pywayland to provide the Wayland bindings and python-xkbcommon to provide
+wlroots keyboard functionality.")
+    (license license:ncsa)))
+
 (define-public python-srt
   (package
     (name "python-srt")
-- 
2.46.0