Subject: [PATCH v3 27/46] gnu: Add rust-letter-avatar-1.

From: Leo Prikler <[email-masked]>
Date: Sun, 7 Mar 2021 18:34:39 +0100

* gnu/packages/crates-gtk.scm (rust-letter-avatar-1): New variable.
---
 gnu/packages/crates-gtk.scm | 43 +++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/crates-gtk.scm b/gnu/packages/crates-gtk.scm
index 99fc6fe451..a0d55fa8bd 100644
--- a/gnu/packages/crates-gtk.scm
+++ b/gnu/packages/crates-gtk.scm
@@ -1603,6 +1603,49 @@ GStreamer.")
 converts raw links to http links and strips unwanted tags.")
     (license license:gpl3)))
 
+(define-public rust-letter-avatar-1
+  (package
+    (name "rust-letter-avatar")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "letter-avatar" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0if2mihpxn4xissv68qciqn5vywy0kl0sx9hcyrhd70s2fyn09k6"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-cairo-rs" ,rust-cairo-rs-0.9)
+        ("rust-pango" ,rust-pango-0.9)
+        ("rust-pangocairo" ,rust-pangocairo-0.10)
+        ("rust-unicode-segmentation"
+         ,rust-unicode-segmentation-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
+     `(("cairo" ,cairo)
+       ("glib" ,glib)
+       ("pango" ,pango)))
+    (home-page "https://gitlab.gnome.org/jsparber/letter-avatar")
+    (synopsis "Generate user avatars")
+    (description "This package provides a user avatar generator based, that
+renders username initials.")
+    (license license:gpl3+)))
+
 (define-public rust-pango-0.9
   (package
     (name "rust-pango")
-- 
2.30.1