Subject: [bug#67515] [PATCH 42/91] gnu: Add rust-wayland-sys-0.31.

From: Sergio Pastor Pérez <[email-masked]>
Date: Tue, 28 Nov 2023 22:12:20 +0100

* gnu/packages/crates-graphics.scm (rust-wayland-sys-0.31): New variable.

Change-Id: Id3d4ae66611a9686aee0e72a7359e34cdb1a0a2e
---
 gnu/packages/crates-graphics.scm | 49 +++++++++++++++++++++++++-------
 1 file changed, 39 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/crates-graphics.scm b/gnu/packages/crates-graphics.scm
index 258fe2447a..34429553b5 100644
--- a/gnu/packages/crates-graphics.scm
+++ b/gnu/packages/crates-graphics.scm
@@ -3544,26 +3544,25 @@ (define-public rust-wayland-server-0.21
         ("rust-wayland-sys" ,rust-wayland-sys-0.21)
         ("rust-wayland-scanner" ,rust-wayland-scanner-0.21))))))
 
-(define-public rust-wayland-sys-0.30
+(define-public rust-wayland-sys-0.31
   (package
     (name "rust-wayland-sys")
-    (version "0.30.1")
+    (version "0.31.1")
     (source
      (origin
        (method url-fetch)
        (uri (crate-uri "wayland-sys" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "01man4ll2kyxp9x2934rhnf98522pzwsd2c6jwr73q08qqma1cln"))))
+        (base32 "1bxpwamgagpxa8p9m798gd3g6rwj2m4sbdvc49zx05jjzzmci80m"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:cargo-inputs
-       (("rust-dlib" ,rust-dlib-0.5)
-        ("rust-lazy-static" ,rust-lazy-static-1)
-        ("rust-libc" ,rust-libc-0.2)
-        ("rust-log" ,rust-log-0.4)
-        ("rust-memoffset" ,rust-memoffset-0.7)
-        ("rust-pkg-config" ,rust-pkg-config-0.3))
+     `(#:cargo-inputs (("rust-dlib" ,rust-dlib-0.5.1)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-log" ,rust-log-0.4)
+                       ("rust-memoffset" ,rust-memoffset-0.9)
+                       ("rust-once-cell" ,rust-once-cell-1)
+                       ("rust-pkg-config" ,rust-pkg-config-0.3))
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-libraries
@@ -3584,6 +3583,36 @@ (define-public rust-wayland-sys-0.30
 crate @code{rust-wayland-client} for usable bindings.")
     (license license:expat)))
 
+(define-public rust-wayland-sys-0.30
+  (package
+    (inherit rust-wayland-sys-0.31)
+    (name "rust-wayland-sys")
+    (version "0.30.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "wayland-sys" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "01man4ll2kyxp9x2934rhnf98522pzwsd2c6jwr73q08qqma1cln"))))
+    (arguments
+     `(#:cargo-inputs
+       (("rust-dlib" ,rust-dlib-0.5)
+        ("rust-lazy-static" ,rust-lazy-static-1)
+        ("rust-libc" ,rust-libc-0.2)
+        ("rust-log" ,rust-log-0.4)
+        ("rust-memoffset" ,rust-memoffset-0.7)
+        ("rust-pkg-config" ,rust-pkg-config-0.3))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-libraries
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((libwayland (dirname (search-input-file
+                                         inputs "lib/libwayland-client.so"))))
+               (substitute* (find-files "src" "\\.rs$")
+                 (("libwayland.*\\.so" shared-lib)
+                  (string-append libwayland "/" shared-lib)))))))))))
+
 (define-public rust-wayland-sys-0.29
   (package
     (inherit rust-wayland-sys-0.30)
-- 
2.41.0