all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Craven <david@craven.ch>
To: guix-devel@gnu.org
Subject: [PATCH] gnu: rustc: Retain binutils.
Date: Mon,  9 Jan 2017 14:45:34 +0100	[thread overview]
Message-ID: <20170109134534.15933-1-david@craven.ch> (raw)

* gnu/packages/rust.scm (rustc)[arguments]: Retain binutils. Add
  wrap-rustc phase.

Problem reported by Ben Woodcroft <donttrustben@gmail.com>.
---
 gnu/packages/rust.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 97d0d7cb0..ae0453004 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.")
-- 
2.11.0

             reply	other threads:[~2017-01-09 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 13:45 David Craven [this message]
2017-01-09 14:05 ` [PATCH] gnu: rustc: Retain binutils David Craven
2017-01-09 22:59 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170109134534.15933-1-david@craven.ch \
    --to=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.