* gnu/packages/rust.scm (rust-thread-local): New variable.
---
 gnu/packages/rust.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index b31b3ee4c..910f296b6 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -655,3 +655,30 @@ that is different for every thread.  Until Rust version 
1.14, the
 standard library did not expose a way to do that, which
 made @code{thread-id} necessary.")
     (license license:asl2.0)))
+
+(define-public rust-thread-local
+  (package
+    (name "rust-thread-local")
+    (version "0.3.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "thread_local" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0pg07fla8i4z4v2bmzq49pr2z8ww6lbg9b7iwwbffz7py0ibg4vp"))))
+    (build-system cargo-build-system)
+    (inputs
+     `(("rust-thread-id" ,rust-thread-id "src")
+       ("rust-unreachable" ,rust-unreachable "src")))
+    (home-page "https://github.com/Amanieu/thread_local-rs";)
+    (synopsis "Per-object thread-local storage")
+    (description
+     "This library provides the ThreadLocal type which allows a
+separate copy of an object to be used for each thread.  This allows for
+per-object thread-local storage, unlike the standard library's
+@code{thread_local!} macro which only allows static thread-local
+storage.")
+    (license (list license:asl2.0 license:expat))))
-- 
2.11.0


Reply via email to