summary refs log tree commit diff
path: root/gnu/packages/rust.scm
diff options
context:
space:
mode:
authorDavid Craven <david@craven.ch>2017-01-09 12:31:31 +0100
committerDavid Craven <david@craven.ch>2017-01-09 18:01:52 +0100
commit5d18d776d269ab9a6c44e049936389df3454ba30 (patch)
tree9b677922f594b4314964c435efd84e26437899c7 /gnu/packages/rust.scm
parent834458f6ff91fbe8be7c2997915f3aee20e47829 (diff)
downloadguix-5d18d776d269ab9a6c44e049936389df3454ba30.tar.gz
gnu: rustc: Retain binutils.
* gnu/packages/rust.scm (rustc)[arguments]: Retain binutils. Add
  wrap-rustc phase.

Problem reported by Ben Woodcroft <donttrustben@gmail.com>.
Diffstat (limited to 'gnu/packages/rust.scm')
-rw-r--r--gnu/packages/rust.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 97d0d7cb0d..ae04530041 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -241,6 +241,7 @@ rustc-bootstrap and cargo-bootstrap packages.")
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (gcc (assoc-ref inputs "gcc"))
+                    (binutils (assoc-ref inputs "binutils"))
                     (python (assoc-ref inputs "python-2"))
                     (rustc (assoc-ref inputs "rustc-bootstrap"))
                     (llvm (assoc-ref inputs "llvm"))
@@ -250,7 +251,7 @@ rustc-bootstrap and cargo-bootstrap packages.")
                             (string-append "--datadir=" out "/share")
                             (string-append "--infodir=" out "/share/info")
                             (string-append "--default-linker=" gcc "/bin/gcc")
-                            (string-append "--default-ar=" gcc "/bin/ar")
+                            (string-append "--default-ar=" binutils "/bin/ar")
                             (string-append "--python=" python "/bin/python2")
                             (string-append "--local-rust-root=" rustc)
                             (string-append "--llvm-root=" llvm)
@@ -261,7 +262,16 @@ rustc-bootstrap and cargo-bootstrap packages.")
                             ;;"--enable-rustbuild"
                             "--disable-manage-submodules")))
                ;; Rust uses a custom configure script (no autoconf).
-               (zero? (apply system* "./configure" flags))))))))
+               (zero? (apply system* "./configure" flags)))))
+         (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"))))))))))
     (synopsis "Compiler for the Rust progamming language")
     (description "Rust is a systems programming language that provides memory
 safety and thread safety guarantees.")