From 494ef6c83f3e7067e4f8f98a4fa11b5f2bbfbe6f Mon Sep 17 00:00:00 2001 From: John Soo Date: Tue, 16 Jun 2020 18:52:55 -0700 Subject: [PATCH 04/33] gnu: Add rust-derive-more-0.99. * gnu/packages/crates-io.scm (rust-derive-more-0.99): New variable. --- gnu/packages/crates-io.scm | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index aadb153548..28dc5b2fcf 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -5077,6 +5077,45 @@ for arbitrary structs.") (description "Internal helper library for the derive_builder crate.") (license (list license:expat license:asl2.0)))) +(define-public rust-derive-more-0.99 + (package + (name "rust-derive-more") + (version "0.99.8") + (source + (origin + (method url-fetch) + (uri (crate-uri "derive-more" version)) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0wfnn4bjw5kmcr4h70kxhsbf8gd9alrw5kd6kmkp9mr0z18m6rdw")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-proc-macro2" ,rust-proc-macro2-1.0) + ("rust-quote" ,rust-quote-1.0) + ("rust-syn" ,rust-syn-1.0)) + #:cargo-development-inputs + (("rust-peg" ,rust-peg-0.6) + ("rust-rustc-version" ,rust-rustc-version-0.2)))) + (home-page + "https://github.com/JelteF/derive_more") + (synopsis + "Adds derive macros for more traits") + (description + "Rust has lots of builtin traits that are implemented for its basic +types, such as @code{Add}, @code{Not}, @code{From} or @code{Display}. +However, when wrapping these types inside your own structs or enums you lose +the implementations of these traits and are required to recreate them. This is +especially annoying when your own structures are very simple, such as when +using the commonly advised newtype pattern (e.g. @code{MyInt(i32)}). + +This library tries to remove these annoyances and the corresponding +boilerplate code. It does this by allowing you to derive lots of commonly used +traits for both structs and enums.") + (license license:expat))) + (define-public rust-derive-new-0.5 (package (name "rust-derive-new") -- 2.26.2