Subject: [bug#44492] [PATCH v8 41/51] gnu: Add rust-dbus-0.2.

From: Leo Prikler <[email-masked]>
Date: Wed, 17 Mar 2021 21:27:25 +0100

* gnu/packages/crates-gtk.scm (rust-dbus-0.2): New variable.
---
 gnu/packages/crates-gtk.scm | 40 +++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/crates-gtk.scm b/gnu/packages/crates-gtk.scm
index f8f56ebc76..5dd0dde649 100644
--- a/gnu/packages/crates-gtk.scm
+++ b/gnu/packages/crates-gtk.scm
@@ -228,6 +228,46 @@
         ("rust-x11" ,rust-x11-2)
         ("rust-pkg-config" ,rust-pkg-config-0.3))))))
 
+(define-public rust-dbus-0.2
+  (package
+    (name "rust-dbus")
+    (version "0.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "dbus" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0b85dl7y396g8xh1xh89wxnb1fvvf840dar9axavfhhhlq7c385l"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:tests? #f ; XXX: fatal warnings are still fatal
+       #:cargo-inputs
+       (("rust-libc" ,rust-libc-0.2))
+       #:cargo-development-inputs
+       (("rust-tempdir" ,rust-tempdir-0.3))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'pre-check
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Tests require a running X server.
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")
+             ;; For the missing /etc/machine-id.
+             (setenv "DBUS_FATAL_WARNINGS" "0")
+             #t)))))
+    (native-inputs
+     `(("xorg-server" ,xorg-server-for-tests)))
+    (inputs
+     `(("dbus" ,dbus)))
+    (home-page "https://github.com/diwic/dbus-rs")
+    (synopsis "Rust bindings to D-Bus")
+    (description "This package provides Rust bindings to D-Bus, a bus commonly
+used for inter-process communication.")
+    (license (list license:asl2.0 license:expat))))
+
 (define-public rust-gdk-0.13
   (package
     (name "rust-gdk")
-- 
2.31.0