gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / rust.scm
index e9dd599..cec565b 100644 (file)
@@ -4,8 +4,8 @@
 ;;; Copyright © 2016 ng0 <ng0@n0.is>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2017, 2018 Nikolai Merinov <nikolai.merinov@member.fsf.org>
-;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
 ;;;
@@ -196,7 +196,7 @@ safety and thread safety guarantees.")
     (properties '((timeout . 72000)               ;20 hours
                   (max-silent-time . 18000)))     ;5 hours (for armel)
     (arguments
-     `(#:imported-modules ,%cargo-utils-modules ;for `generate-checksums'
+     `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
        #:modules ((guix build utils) (ice-9 match) (guix build gnu-build-system))
        #:phases
        (modify-phases %standard-phases
@@ -270,19 +270,11 @@ test = { path = \"../libtest\" }
              #t))
          (add-after 'patch-source-shebangs 'patch-cargo-checksums
            (lambda* _
+             (use-modules (guix build cargo-utils))
              (substitute* "src/Cargo.lock"
                (("(\"checksum .* = )\".*\"" all name)
                 (string-append name "\"" ,%cargo-reference-hash "\"")))
-             (for-each
-              (lambda (filename)
-                (use-modules (guix build cargo-utils))
-                (delete-file filename)
-                (let* ((dir (dirname filename)))
-                  (display (string-append
-                            "patch-cargo-checksums: generate-checksums for "
-                            dir "\n"))
-                  (generate-checksums dir)))
-              (find-files "src/vendor" ".cargo-checksum.json"))
+             (generate-all-checksums "src/vendor")
              #t))
          ;; This phase is overridden by newer versions.
          (replace 'configure
@@ -387,7 +379,7 @@ test = { path = \"../libtest\" }
     (build-system gnu-build-system)
     (native-inputs
      `(("bison" ,bison) ; For the tests
-       ("cmake" ,cmake)
+       ("cmake" ,cmake-minimal)
        ("flex" ,flex) ; For the tests
        ("gdb" ,gdb)   ; For the tests
        ("procps" ,procps) ; For the tests
@@ -399,7 +391,7 @@ test = { path = \"../libtest\" }
     (inputs
      `(("jemalloc" ,jemalloc-4.5.0)
        ("llvm" ,llvm-3.9.1)
-       ("openssl" ,openssl)
+       ("openssl" ,openssl-1.0)
        ("libssh2" ,libssh2) ; For "cargo"
        ("libcurl" ,curl)))  ; For "cargo"
 
@@ -408,10 +400,7 @@ test = { path = \"../libtest\" }
     ;; modules (see <https://bugs.gnu.org/31392>).
     (native-search-paths
      (list (search-path-specification
-            (variable "C_INCLUDE_PATH")
-            (files '("include")))
-           (search-path-specification
-            (variable "CPLUS_INCLUDE_PATH")
+            (variable "CPATH")
             (files '("include")))
            (search-path-specification
             (variable "LIBRARY_PATH")
@@ -790,6 +779,11 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                                        "rust-bootstrap-stage0-test.patch"
                                        "rust-1.25-accept-more-detailed-gdb-lines.patch"
                                        "rust-reproducible-builds.patch")))))
+      (native-inputs
+       ;; FIXME: Rust 1.27 and some later versions require GDB 8.2 specifically.
+       ;; See <https://bugs.gnu.org/37810>.
+       (alist-replace "gdb" (list gdb-8.2)
+                      (package-native-inputs base-rust)))
       (arguments
        (substitute-keyword-arguments (package-arguments base-rust)
          ((#:phases phases)
@@ -975,19 +969,11 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
              ;; root of the rust tarball
              (replace 'patch-cargo-checksums
                (lambda* _
+                 (use-modules (guix build cargo-utils))
                  (substitute* "Cargo.lock"
                    (("(\"checksum .* = )\".*\"" all name)
                     (string-append name "\"" ,%cargo-reference-hash "\"")))
-                 (for-each
-                  (lambda (filename)
-                    (use-modules (guix build cargo-utils))
-                    (delete-file filename)
-                    (let* ((dir (dirname filename)))
-                      (display (string-append
-                                "patch-cargo-checksums: generate-checksums for "
-                                dir "\n"))
-                      (generate-checksums dir)))
-                  (find-files "vendor" ".cargo-checksum.json"))
+                 (generate-all-checksums "vendor")
                  #t))
              (add-after 'enable-codegen-tests 'override-jemalloc
                (lambda* (#:key inputs #:allow-other-keys)
@@ -1073,10 +1059,10 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                    (("bins::check") "//bins::check"))
                  #t)))))))))
 
-(define-public rust
+(define-public rust-1.36
   (let ((base-rust
          (rust-bootstrapped-package rust-1.35 "1.36.0"
-           "18r688ih4xi9m8gv55g1amb8inrwkdxp5fbcqb6i4gqxi90l3i0m")))
+           "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04")))
     (package
       (inherit base-rust)
       (arguments
@@ -1084,3 +1070,20 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
          ((#:phases phases)
           `(modify-phases ,phases
              (delete 'patch-process-docs-rev-cmd))))))))
+
+(define-public rust
+  (let ((base-rust
+         (rust-bootstrapped-package rust-1.36 "1.37.0"
+           "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj")))
+    (package
+      (inherit base-rust)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base-rust)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'configure 'configure-cargo-home
+               (lambda _
+                 (let ((cargo-home (string-append (getcwd) "/.cargo")))
+                   (mkdir-p cargo-home)
+                   (setenv "CARGO_HOME" cargo-home)
+                   #t))))))))))