From patchwork Thu Sep 22 13:19:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Craven X-Patchwork-Id: 15924 Received: (qmail 126950 invoked by uid 89); 22 Sep 2016 14:15:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Sep 2016 14:15:13 +0000 Received: from localhost ([::1]:46630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4mJ-0001LR-3D for patchwork@sourceware.org; Thu, 22 Sep 2016 10:15:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn3ur-0004bB-Av for guix-devel@gnu.org; Thu, 22 Sep 2016 09:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn3uT-0001b2-Is for guix-devel@gnu.org; Thu, 22 Sep 2016 09:19:52 -0400 Received: from so254-10.mailgun.net ([198.61.254.10]:35168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn3uS-0001XN-3r for guix-devel@gnu.org; Thu, 22 Sep 2016 09:19:29 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=craven.ch; q=dns/txt; s=mx; t=1474550366; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=95BQp+K0Tc4rFdBJnZpt+K6eC9JnDLaJJ6BfROuKm2g=; b=Jh1kpXl2HuHdbmHnMAflWDZccdwyPUb9lFeZEOIdF0PS4hRbzEDpNHHatgB4u1j7QJeHUTlk niEgsJPCIqBjGd2xqMZ8O1GonbDhQmuZZwZSFN0ikpO99m92kSsfQu7k/fj35Lz/3NBX2nV2 PN7yW1nH3aNQTFZPdd+WbTZELlg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=craven.ch; s=mx; q=dns; h=Sender: From: To: Cc: Subject: Date: Message-Id: In-Reply-To: References; b=ORY2yO29HVOtLriuQ1EVyl9LaNcSf+5DVc3XUNiyq5SGAKSzSZy8UnkbOmfZ/U1ACpAMP8 qPNE/NnsploL5vuHP5VgeMN0ke88ATM1QwS41iQnnz4uaNccpXEfXs8GQZAOXP1VIQCNyxME CzDRYebR4y0Bbqm9mC5+T+NgtQFis= X-Mailgun-Sending-Ip: 198.61.254.10 X-Mailgun-Sid: WyIxMzZlMCIsICJndWl4LWRldmVsQGdudS5vcmciLCAiMDFiMjAiXQ== Received: from xps.craven.ch (pub151248146013.dh-hfc.datazug.ch [151.248.146.13]) by mxa.mailgun.org with ESMTP id 57e3da56.7f02fc0a46c0-in01; Thu, 22 Sep 2016 13:19:18 -0000 (UTC) From: David Craven To: guix-devel@gnu.org Subject: [PATCH 10/12] gnu: Add rustc-bootstrap. Date: Thu, 22 Sep 2016 15:19:01 +0200 Message-Id: <20160922131903.1606-10-david@craven.ch> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160922131903.1606-1-david@craven.ch> References: <20160922131903.1606-1-david@craven.ch> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 198.61.254.10 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" * gnu/packages/rust.scm (rustc-bootstrap): New variable. --- gnu/packages/rust.scm | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 1831aa7..4030d18 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -17,7 +17,16 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages rust) - #:use-module (guix download)) + #:use-module (gnu packages base) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) + #:use-module (gnu packages elf) + #:use-module (gnu packages gcc) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module ((guix licenses) #:prefix license:)) (define rust-bootstrap-x86_64-1.12.0 (origin @@ -28,3 +37,59 @@ (sha256 (base32 "1is1k93zarvxx0h7b57ga8vr9gj34b36l9la6zkph41x33gfgpvl")))) + +(define-public rustc-bootstrap + (package + (name "rustc-bootstrap") + (version "1.12.0") + (source rust-bootstrap-x86_64-1.12.0) + (build-system gnu-build-system) + (native-inputs + `(("patchelf" ,patchelf))) + (inputs + `(("gcc-lib" ,gcc "lib") + ("gcc-toolchain-6" ,gcc-toolchain-6) + ("zlib" ,zlib))) + (arguments + `(#:tests? #f + #:strip-binaries? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (gcc-lib (assoc-ref inputs "gcc-lib")) + (toolchain (assoc-ref inputs "gcc-toolchain-6")) + (zlib (assoc-ref inputs "zlib")) + (platform ,(system->rust-platform (%current-system))) + (ld-so (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker)))) + (system* "bash" "install.sh" + (string-append "--prefix=" out) + (string-append "--components=rustc," + "rust-std-" platform)) + (for-each + (lambda (file) + (system* "patchelf" + "--set-rpath" + (string-append out "/lib:" zlib "/lib:" + gcc-lib "/lib:" toolchain "/lib") + file)) + (cons* (string-append out "/bin/rustc") + (string-append out "/bin/rustdoc") + (find-files out "\\.so$"))) + (for-each + (lambda (file) + (system* "patchelf" + "--set-interpreter" ld-so + file)) + (list (string-append out "/bin/rustc") + (string-append out "/bin/rustdoc"))) + (symlink (string-append toolchain "/bin/gcc") + (string-append out "/bin/cc")))))))) + (home-page "https://www.rust-lang.org") + (synopsis "Rustc bootstrap") + (description "Rustc bootstrap.") + (license license:asl2.0)))