summary refs log tree commit diff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-09-13 00:25:39 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-09-13 10:10:48 +0200
commit333c0ca9661b8285ac49eed881e75c523317d5df (patch)
tree8d37616d66d2a0b934b7d702fe172e7ec1470789
parentf309671c289373893096de367c779f3175f297da (diff)
downloadguix-333c0ca9661b8285ac49eed881e75c523317d5df.tar.gz
gnu: rust@1.23.0: Use rust@1.20.0 as template.
* gnu/packages/rust.scm (rust-1.23)[inherit]: Use rust-1.20.
[arguments]<#:phases>: Delete "patch-cargo-tomls" phase deletion.
Add "provide-cc" phase deletion.
Add "configure-archiver" phase deletion.
[configure]: Inherit phase.
[reset-timestamps-after-changes]: Inherit phase.
[build]: Inherit phase.
[check]: Inherit phase.
[install]: Inherit phase.
[wrap-rustc]: Inherit phase.
-rw-r--r--gnu/packages/rust.scm93
1 files changed, 5 insertions, 88 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index ba061885b7..e84e58a30f 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -615,7 +615,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
 
 (define-public rust-1.23
   (package
-    (inherit rust-1.19)
+    (inherit rust-1.20)
     (name "rust")
     (version "1.23.0")
     (source (rust-source version "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))
@@ -633,17 +633,17 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
        ("pkg-config" ,pkg-config) ; For "cargo"
        ("which" ,which)))
     (arguments
-     (substitute-keyword-arguments (package-arguments rust-1.19)
+     (substitute-keyword-arguments (package-arguments rust-1.20)
        ((#:phases phases)
         `(modify-phases ,phases
+           (delete 'provide-cc)
+           (delete 'configure-archiver)
            (add-after 'unpack 'dont-build-native
              (lambda _
                ;; XXX: Revisit this when we use gcc 6.
                (substitute* "src/binaryen/CMakeLists.txt"
                  (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") ""))
                #t))
-           ;; TODO: Revisit this and find out whether that's needed after all.
-           (delete 'patch-cargo-tomls)
            (add-after 'patch-tests 'patch-cargo-tests
              (lambda _
                (substitute* "src/tools/cargo/tests/build.rs"
@@ -671,90 +671,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                  ;; is 0, but in same time "src" have 0 mtime in guix build!
                  (("let threshold = mtime\\(dst\\);")
                   "if !dst.exists() {\nreturn false\n}\n let threshold = mtime(dst);"))
-               #t))
-           (replace 'configure
-             (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (doc (assoc-ref outputs "doc"))
-                      (gcc (assoc-ref inputs "gcc"))
-                      (gdb (assoc-ref inputs "gdb"))
-                      (binutils (assoc-ref inputs "binutils"))
-                      (python (assoc-ref inputs "python-2"))
-                      (rustc (assoc-ref inputs "rustc-bootstrap"))
-                      (cargo (assoc-ref inputs "cargo-bootstrap"))
-                      (llvm (assoc-ref inputs "llvm"))
-                      (jemalloc (assoc-ref inputs "jemalloc")))
-                 (call-with-output-file "config.toml"
-                   (lambda (port)
-                     (display (string-append "
-[llvm]
-[build]
-cargo = \"" cargo "/bin/cargo" "\"
-rustc = \"" rustc "/bin/rustc" "\"
-docs = true
-python = \"" python "/bin/python2" "\"
-gdb = \"" gdb "/bin/gdb" "\"
-vendor = true
-submodules = false
-[install]
-prefix = \"" out "\"
-docdir = \"" doc "/share/doc/rust" "\"
-sysconfdir = \"etc\"
-localstatedir = \"var/lib\"
-[rust]
-default-linker = \"" gcc "/bin/gcc" "\"
-channel = \"stable\"
-rpath = true
-" ;; There are 2 failed codegen tests:
-  ;; codegen/mainsubprogram.rs and codegen/mainsubprogramstart.rs
-  ;; These tests require a patched LLVM
-"codegen-tests = false
-[target." ,(nix-system->gnu-triplet-for-rust) "]
-llvm-config = \"" llvm "/bin/llvm-config" "\"
-cc = \"" gcc "/bin/gcc" "\"
-cxx = \"" gcc "/bin/g++" "\"
-ar = \"" binutils "/bin/ar" "\"
-jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
-[dist]
-") port)))
-               #t)))
-         (add-before 'build 'reset-timestamps-after-changes
-           (lambda* _
-             (define ref (stat "README.md"))
-             (for-each
-              (lambda (filename)
-                (set-file-time filename ref))
-              (find-files "." #:directories? #t))
-             #t))
-         (replace 'build
-           (lambda* _
-             (invoke "./x.py" "build")
-             (invoke "./x.py" "build" "src/tools/cargo")))
-         (replace 'check
-           (lambda* _
-             ;; Disable parallel execution to prevent EAGAIN errors when
-             ;; running tests.
-             (invoke "./x.py" "-j1" "test")
-             (invoke "./x.py" "-j1" "test" "src/tools/cargo")))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (invoke "./x.py" "install")
-             (substitute* "config.toml"
-               ;; replace prefix to specific output
-               (("prefix = \"[^\"]*\"")
-                (string-append "prefix = \"" (assoc-ref outputs "cargo") "\"")))
-             (invoke "./x.py" "install" "cargo")
-             #t))
-         (add-after 'install 'wrap-rustc
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out"))
-                   (libc (assoc-ref inputs "libc"))
-                   (ld-wrapper (assoc-ref inputs "ld-wrapper")))
-               ;; Let gcc find ld and libc startup files.
-               (wrap-program (string-append out "/bin/rustc")
-                 `("PATH" ":" prefix (,(string-append ld-wrapper "/bin")))
-                 `("LIBRARY_PATH" ":" suffix (,(string-append libc "/lib"))))
-               #t)))))))))
+               #t))))))))
 
 (define-public rust-1.24
   (let ((base-rust