Subject: [bug#44492] [PATCH v8 45/51] gnu: Add rust-atk-0.9.

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

* gnu/packages/crates-gtk.scm (rust-atk-0.9): New variable.
---
 gnu/packages/crates-gtk.scm | 56 +++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/crates-gtk.scm b/gnu/packages/crates-gtk.scm
index 87afa30ddf..db1160e2d5 100644
--- a/gnu/packages/crates-gtk.scm
+++ b/gnu/packages/crates-gtk.scm
@@ -103,8 +103,55 @@
        (("rust-shell-words" ,rust-shell-words-0.1)
         ("rust-tempfile" ,rust-tempfile-3))))))
 
+(define-public rust-atk-0.9
+  (package
+    (name "rust-atk")
+    (version "0.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "atk" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "09n46zp8jgxspdzhmi93cag79jjnr0ila94n8nr53g8hw88ljaw1"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-atk-sys" ,rust-atk-sys-0.10)
+        ("rust-bitflags" ,rust-bitflags-1)
+        ("rust-glib" ,rust-glib-0.10)
+        ("rust-glib-sys" ,rust-glib-sys-0.10)
+        ("rust-gobject-sys" ,rust-gobject-sys-0.10)
+        ("rust-gtk-rs-lgpl-docs"
+         ,rust-gtk-rs-lgpl-docs-0.1)
+        ("rust-libc" ,rust-libc-0.2))
+       #:cargo-development-inputs
+       (("rust-gir-format-check" ,rust-gir-format-check-0.1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'fix-version-requirements
+           (lambda* (#:key inputs vendor-dir #:allow-other-keys)
+             (substitute*
+                 (map
+                  (lambda (dir) (string-append dir "/Cargo.toml"))
+                  (find-files vendor-dir "system-deps.*" #:directories? #t))
+               (("0.0.10") ,(package-version rust-version-compare-0.0)))
+             #t)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("atk" ,atk)
+       ("glib" ,glib)))
+    (home-page "http://gtk-rs.org/")
+    (synopsis "Rust bindings for the ATK library")
+    (description "Rust bindings for the ATK library")
+    (license license:expat)))
+
 (define-public rust-atk-0.8
   (package
+    (inherit rust-atk-0.9)
     (name "rust-atk")
     (version "0.8.0")
     (source
@@ -125,14 +172,7 @@
         ("rust-gtk-rs-lgpl-docs" ,rust-gtk-rs-lgpl-docs-0.1)
         ("rust-libc" ,rust-libc-0.2))
        #:cargo-development-inputs
-       (("rust-gir-format-check" ,rust-gir-format-check-0.1))))
-    (inputs
-     `(("atk" ,atk)
-       ("glib" ,glib)))
-    (home-page "https://gtk-rs.org/")
-    (synopsis "Rust bindings for the ATK library")
-    (description "Rust bindings for the ATK library")
-    (license license:expat)))
+       (("rust-gir-format-check" ,rust-gir-format-check-0.1))))))
 
 (define-public rust-cairo-rs-0.9
   (package
-- 
2.31.0