gnu: crate: Add proc-macro2 and quote.
[jackhill/guix/guix.git] / gnu / packages / crates-io.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages crates-io)
20 #:use-module (guix build-system cargo)
21 #:use-module (guix download)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix packages))
24
25 (define-public rust-unicode-xid
26 (package
27 (name "rust-unicode-xid")
28 (version "0.1.0")
29 (source
30 (origin
31 (method url-fetch)
32 (uri (crate-uri "unicode-xid" version))
33 (file-name
34 (string-append name "-" version ".tar.gz"))
35 (sha256
36 (base32
37 "1z57lqh4s18rr4x0j4fw4fmp9hf9346h0kmdgqsqx0fhjr3k0wpw"))))
38 (build-system cargo-build-system)
39 (home-page
40 "https://github.com/unicode-rs/unicode-xid")
41 (synopsis "Determine Unicode XID related properties")
42 (description "Determine whether characters have the XID_Start
43 or XID_Continue properties according to Unicode Standard Annex #31.")
44 ;; Dual licensed.
45 (license (list license:asl2.0 license:expat))))
46
47 (define-public rust-proc-macro2
48 (package
49 (name "rust-proc-macro2")
50 (version "0.4.27")
51 (source
52 (origin
53 (method url-fetch)
54 (uri (crate-uri "proc-macro2" version))
55 (file-name
56 (string-append name "-" version ".tar.gz"))
57 (sha256
58 (base32
59 "05c92v787snyaq4ss16vxc9mdv6zndfgsdq8k3hnnyffmsf7ycad"))))
60 (build-system cargo-build-system)
61 (arguments
62 `(#:cargo-inputs (("rust-unicode-xid" ,rust-unicode-xid))
63 #:cargo-development-inputs (("rust-quote" ,rust-quote))))
64 (home-page "https://github.com/alexcrichton/proc-macro2")
65 (synopsis "Stable implementation of the upcoming new `proc_macro` API")
66 (description "This package provides a stable implementation of the upcoming new
67 `proc_macro` API. Comes with an option, off by default, to also reimplement itself
68 in terms of the upstream unstable API.")
69 ;; Dual licensed.
70 (license (list license:asl2.0 license:expat))))
71
72 (define-public rust-quote
73 (package
74 (name "rust-quote")
75 (version "0.6.12")
76 (source
77 (origin
78 (method url-fetch)
79 (uri (crate-uri "quote" version))
80 (file-name
81 (string-append name "-" version ".tar.gz"))
82 (sha256
83 (base32
84 "1nw0klza45hf127kfyrpxsxd5jw2l6h21qxalil3hkr7bnf7kx7s"))))
85 (build-system cargo-build-system)
86 (arguments
87 `(#:cargo-inputs (("rust-proc-macro2" ,rust-proc-macro2))))
88 (home-page "https://github.com/dtolnay/quote")
89 (synopsis "Quasi-quoting macro quote!(...)")
90 (description "Quasi-quoting macro quote!(...)")
91 ;; Dual licensed.
92 (license (list license:asl2.0 license:expat))))