Subject: [bug#66623] [PATCH 1/3] gnu: Add sbcl-xkbcommon package

From: Karl Hallsby <[email-masked]>
Date: Thu, 19 Oct 2023 00:06:01 -0500

* gnu/packages/lisp-xyz.scm (New variable): Add sbcl-xkbcommon package
at most recent revision.
---
 gnu/packages/lisp-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index f2c581e65f..1ac43e7e3a 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -40,6 +40,7 @@
 ;;; Copyright © 2023 Roman Scherer <[email-masked]>
 ;;; Copyright © 2023 ykonai <[email-masked]>
 ;;; Copyright © 2023 Gabriel Hondet <[email-masked]>
+;;; Copyright © 2023 Raven Hallsby <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26738,6 +26739,51 @@ (define-public cl-nkeymaps
 (define-public ecl-nkeymaps
   (sbcl-package->ecl-package sbcl-nkeymaps))
 
+(define-public sbcl-xkbcommon
+  (let ((commit "aa9513d93f42d7816f88dd1bd8bd21375e7d7512")
+        (revision "0"))
+    (package
+      (name "sbcl-xkbcommon")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/sdilts/cl-xkbcommon")
+               (commit commit)))
+         (file-name (git-file-name "sbcl-xkbcommon" version))
+         (sha256
+          (base32 "02zdbkh7yliw9vg8i8wx2xgcpfni0fr4z0w19kkxvaib8xm9rx1q"))))
+      (build-system asdf-build-system/sbcl)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-paths
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "xkbcommon.lisp"
+                 (("\\(define-foreign-library libxkbcommon" all)
+                  (string-append all "\n"
+                                 "  (:unix \""
+                                 (assoc-ref inputs "libxkbcommon")
+                                 "/lib/libxkbcommon.so\")"))))))))
+      (native-inputs
+       (list pkg-config))
+      (inputs
+       (list libxkbcommon
+             sbcl-cffi))
+      (home-page "https://github.com/sdilts/cl-xkbcommon")
+      (synopsis "Common Lisp FFI bindings for xkbcommon (libxkbcommon)")
+      (description
+       "Common Lisp FFI bindings for xkbcommon (libxkbcommon) using
+cffi-grovel.")
+      (license license:expat))))
+
+(define-public cl-xkbcommon
+  (sbcl-package->cl-source-package sbcl-xkbcommon))
+
+(define-public ecl-xkbcommon
+  (sbcl-package->ecl-package sbcl-xkbcommon))
+
 (define-public sbcl-njson
   (package
     (name "sbcl-njson")
-- 
2.41.0