Subject: [PATCH v4 44/47] gnu: Add rust-sourceview4-0.2.

From: Leo Prikler <[email-masked]>
Date: Thu, 11 Mar 2021 23:07:53 +0100

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

diff --git a/gnu/packages/crates-gtk.scm b/gnu/packages/crates-gtk.scm
index d3f9a5c728..0a5defef0b 100644
--- a/gnu/packages/crates-gtk.scm
+++ b/gnu/packages/crates-gtk.scm
@@ -2208,3 +2208,62 @@ the Secret Service API")
     (description "This package provides FFI bindings for GtkSourceView, version
 4.x.")
     (license license:lgpl2.1+)))
+
+(define-public rust-sourceview4-0.2
+  (package
+    (name "rust-sourceview4")
+    (version "0.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "sourceview4" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1c35bm98gmn93qralgjlippdjm2d6199j811qgrn1zd4iv3j3kv7"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-bitflags" ,rust-bitflags-1)
+        ("rust-cairo-rs" ,rust-cairo-rs-0.9)
+        ("rust-gdk" ,rust-gdk-0.13)
+        ("rust-gdk-pixbuf" ,rust-gdk-pixbuf-0.9)
+        ("rust-gdk-sys" ,rust-gdk-sys-0.10)
+        ("rust-gio" ,rust-gio-0.9)
+        ("rust-gio-sys" ,rust-gio-sys-0.10)
+        ("rust-glib" ,rust-glib-0.10)
+        ("rust-glib-sys" ,rust-glib-sys-0.10)
+        ("rust-gobject-sys" ,rust-gobject-sys-0.10)
+        ("rust-gtk" ,rust-gtk-0.9)
+        ("rust-gtk-sys" ,rust-gtk-sys-0.10)
+        ("rust-libc" ,rust-libc-0.2)
+        ("rust-pango" ,rust-pango-0.9)
+        ("rust-sourceview4-sys"
+         ,rust-sourceview4-sys-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)
+       ("cairo" ,cairo)
+       ("glib" ,glib)
+       ("gtk+" ,gtk+)
+       ("gtksourceview" ,gtksourceview)
+       ("pango" ,pango)))
+    (home-page "https://gitlab.gnome.org/World/Rust/sourceview4-rs")
+    (synopsis "API bindings for GtkSourceView")
+    (description "This package provides API bindings for GtkSourceView,
+version 4.x.")
+    (license license:lgpl2.1+)))
-- 
2.30.1