summary refs log tree commit diff
path: root/gnu/packages/rust-apps.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/rust-apps.scm')
-rw-r--r--gnu/packages/rust-apps.scm93
1 files changed, 85 insertions, 8 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 215955214c..8ad3c0ced4 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
-;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019, 2020 John Soo <jsoo1@asu.edu>
+;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,7 +22,11 @@
   #:use-module (guix build-system cargo)
   #:use-module (guix download)
   #:use-module (guix packages)
-  #:use-module (gnu packages crates-io))
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages crates-io)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages version-control))
 
 (define-public ripgrep
   (package
@@ -66,7 +70,7 @@ gitignore rules.")
 (define-public rust-cbindgen
   (package
     (name "rust-cbindgen")
-    (version "0.9.1")
+    (version "0.12.2")
     (source
       (origin
         (method url-fetch)
@@ -74,7 +78,7 @@ gitignore rules.")
         (file-name (string-append name "-" version ".crate"))
         (sha256
          (base32
-          "1zgamxahlxmg4warzivaa8m1f8d6b45mhznm7n6d7p5l18acdblx"))))
+          "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))
     (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs
@@ -86,11 +90,84 @@ gitignore rules.")
         ("serde-json" ,rust-serde-json-1.0)
         ("syn" ,rust-syn-1.0)
         ("tempfile" ,rust-tempfile-3.0)
-        ("toml" ,rust-toml-0.5))
-       #:cargo-development-inputs
-       (("autocfg" ,rust-autocfg-0.1))))
+        ("toml" ,rust-toml-0.5))))
     (home-page "https://github.com/eqrion/cbindgen/")
     (synopsis "Tool for generating C bindings to Rust code")
     (description
      "This package provides a tool for generating C/C++ bindings to Rust code.")
     (license license:mpl2.0)))
+
+(define-public tokei
+  (package
+    (name "tokei")
+    (version "10.1.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (crate-uri "tokei" version))
+        (file-name
+         (string-append name "-" version ".tar.gz"))
+        (sha256
+         (base32
+          "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-clap" ,rust-clap-2)
+        ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
+        ("rust-dirs" ,rust-dirs-2.0)
+        ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
+        ("rust-env-logger" ,rust-env-logger-0.7)
+        ("rust-grep-searcher" ,rust-grep-searcher-0.1)
+        ("rust-hex" ,rust-hex-0.4)
+        ("rust-ignore" ,rust-ignore-0.4)
+        ("rust-log" ,rust-log-0.4)
+        ("rust-rayon" ,rust-rayon-1.3)
+        ("rust-serde" ,rust-serde-1.0)
+        ("rust-serde-cbor" ,rust-serde-cbor-0.10)
+        ("rust-serde-derive" ,rust-serde-derive-1.0)
+        ("rust-serde-json" ,rust-serde-json-1.0)
+        ("rust-serde-yaml" ,rust-serde-yaml-0.8)
+        ("rust-term-size" ,rust-term-size-0.3)
+        ("rust-toml" ,rust-toml-0.5))
+       #:cargo-development-inputs
+       (("rust-git2" ,rust-git2-0.11)
+        ("rust-handlebars" ,rust-handlebars-2.0)
+        ("rust-ignore" ,rust-ignore-0.4)
+        ("rust-lazy-static" ,rust-lazy-static-1.4)
+        ("rust-regex" ,rust-regex-1.3)
+        ("rust-serde-json" ,rust-serde-json-1.0)
+        ("rust-tempfile" ,rust-tempfile-3.0))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'unvendor-libraries-from-crates
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((openssl (assoc-ref inputs "openssl")))
+               (setenv "OPENSSL_DIR" openssl)
+               (setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1")
+               (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1")
+               (delete-file-recursively
+                 (string-append "guix-vendor/rust-libgit2-sys-"
+                                ,(package-version rust-libgit2-sys-0.10)
+                                ".crate/libgit2"))
+               (delete-file-recursively
+                 (string-append "guix-vendor/rust-libssh2-sys-"
+                                ,(package-version rust-libssh2-sys-0.2)
+                                ".crate/libssh2"))
+               (delete-file-recursively
+                 (string-append "guix-vendor/rust-libz-sys-"
+                                ,(package-version rust-libz-sys-1.0)
+                                ".crate/src/zlib")))
+             #t)))))
+    (native-inputs
+     `(("libgit2" ,libgit2)
+       ("openssl" ,openssl)
+       ("pkg-config" ,pkg-config)
+       ("zlib" ,zlib)))
+    (home-page "https://tokei.rs")
+    (synopsis "Count code, quickly")
+    (description
+     "Tokei is a program that displays statistics about your code.  Tokei will
+show number of files, total lines within those files and code, comments, and
+blanks grouped by language.")
+    (license (list license:expat license:asl2.0))))