Patchwork [12/12] gnu: Add cargo.

login
register
mail settings
Submitter David Craven
Date Dec. 11, 2016, 5:25 p.m.
Message ID <20161211172537.23315-13-david@craven.ch>
Download mbox | patch
Permalink /patch/18363/
State New
Headers show

Comments

David Craven - Dec. 11, 2016, 5:25 p.m.
* gnu/packages/rust.scm (cargo): New variable.
---
 gnu/packages/rust.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
Ludovic Courtès - Dec. 13, 2016, 10:51 p.m.
David Craven <david@craven.ch> skribis:

> * gnu/packages/rust.scm (cargo): New variable.

LGTM, thanks!

Ludo’.

Patch

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index a64f72f03..dfe0db60e 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -19,13 +19,18 @@ 
 (define-module (gnu packages rust)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bootstrap)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages ssh)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (guix build-system cargo)
   #:use-module (guix build-system gnu)
@@ -271,6 +276,43 @@  fast, prevents segfaults, and guarantees thread safety.")
     (home-page "https://www.rust-lang.org")
     (license (list license:asl2.0 license:expat))))
 
+(define-public cargo
+  ;; NOTE: To build cargo manually:
+  ;; cd /tmp && tar -xf $(guix build -S cargo)
+  ;; cd cargo*
+  ;; guix environment cargo
+  ;; cargo build --release
+  (package
+    (name "cargo")
+    (version (cargo-version (rustc-version %rust-bootstrap-binaries-version)))
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/rust-lang/cargo"
+                    "/archive/" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0cbm32dw85zqf84yk2bvld5ggdkxlndn8kp3wri9z5c68mj0xv4h"))))
+    (build-system cargo-build-system)
+    (inputs
+     `(("cmake" ,cmake)
+       ("curl" ,curl)
+       ("libgit2" ,libgit2)
+       ("libssh2" ,libssh2)
+       ("openssl" ,openssl)
+       ("pkg-config" ,pkg-config)
+       ("python-2" ,python-2)
+       ("rust-bootstrap" ,rust-bootstrap)
+       ("zlib" ,zlib)))
+    (home-page "https://github.com/rust-lang/cargo")
+    (synopsis "Build tool and package manager for Rust")
+    (description "Cargo downloads your Rust project’s dependencies and compiles
+your project.")
+    ;; Cargo is dual licensed Apache and MIT. Also contains
+    ;; code from openssl which is GPL2 with linking exception.
+    (license (list license:asl2.0 license:expat license:gpl2+))))
+
 (define-public rust-libc
   (package
     (name "rust-libc")