unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: Add cargo.
@ 2016-12-29 15:34 David Craven
  2016-12-29 15:34 ` [PATCH 2/2] build-system: cargo: Use correct cargo David Craven
  2016-12-30 21:58 ` [PATCH 1/2] gnu: Add cargo Chris Marusich
  0 siblings, 2 replies; 9+ messages in thread
From: David Craven @ 2016-12-29 15:34 UTC (permalink / raw)
  To: guix-devel

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

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 8aa867317..c6c4f3171 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -23,11 +23,15 @@
   #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages cmake)
   #: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 gnu)
   #:use-module (guix build-system trivial)
@@ -265,3 +269,54 @@ safety and thread safety guarantees.")
     (home-page "https://www.rust-lang.org")
     ;; Dual licensed.
     (license (list license:asl2.0 license:expat))))
+
+(define-public cargo
+  (package
+    (name "cargo")
+    (version (cargo-version (rustc-version %rust-bootstrap-binaries-version)))
+    (source (origin
+              (method url-fetch)
+              ;; Use a cargo tarball with vendored dependencies and a cargo
+              ;; config file.
+              (uri (string-append
+                    "https://github.com/dvc94ch/cargo"
+                    "/archive/" version "-cargo-vendor.tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0hpix5hwz10pm1wh65gimhsy9nxjvy7yikgbpw8afwglqr3bl856"))))
+    (build-system cargo-build-system)
+    (inputs
+     `(("cmake" ,cmake)
+       ("curl" ,curl)
+       ("libgit2" ,libgit2)
+       ("libssh2" ,libssh2)
+       ("openssl" ,openssl)
+       ("pkg-config" ,pkg-config)
+       ("python-2" ,python-2)
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:cargo ,cargo-bootstrap
+       #:tests? #f ; FIXME
+       #:phases
+       (modify-phases %standard-phases
+         ;; Avoid cargo complaining about missmatched checksums.
+         (delete 'patch-source-shebangs)
+         (delete 'patch-generated-file-shebangs)
+         (delete 'patch-usr-bin-file)
+         ;; Set CARGO_HOME to use the vendored dependencies.
+         (add-after 'unpack 'set-cargo-home
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((gcc (assoc-ref inputs "gcc"))
+                    (cc (string-append gcc "/bin/gcc")))
+               (setenv "CARGO_HOME" (string-append (getcwd) "/cargohome"))
+               (setenv "CMAKE_C_COMPILER" cc)
+               (setenv "CC" cc))
+             #t)))))
+    (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+))))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-02 21:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 15:34 [PATCH 1/2] gnu: Add cargo David Craven
2016-12-29 15:34 ` [PATCH 2/2] build-system: cargo: Use correct cargo David Craven
2017-01-02 21:12   ` Ludovic Courtès
2016-12-30 21:58 ` [PATCH 1/2] gnu: Add cargo Chris Marusich
2016-12-30 23:11   ` David Craven
2016-12-31  0:07     ` Chris Marusich
2016-12-31  0:21       ` David Craven
2016-12-31  2:31         ` Chris Marusich
2017-01-02 21:07           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).