From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f33Cb-0004Lc-C4 for guix-patches@gnu.org; Mon, 02 Apr 2018 13:25:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f33CY-0004ic-Iw for guix-patches@gnu.org; Mon, 02 Apr 2018 13:25:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55692) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f33CY-0004iV-GZ for guix-patches@gnu.org; Mon, 02 Apr 2018 13:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f33CY-0006qi-B0 for guix-patches@gnu.org; Mon, 02 Apr 2018 13:25:02 -0400 Subject: [bug#31026] [PATCH 2/2] gnu: Factorize rust-bootstrapped-package. Resent-Message-ID: From: Danny Milosavljevic Date: Mon, 2 Apr 2018 19:24:09 +0200 Message-Id: <20180402172409.13230-2-dannym@scratchpost.org> In-Reply-To: <20180402172409.13230-1-dannym@scratchpost.org> References: <20180402171721.12331-1-dannym@scratchpost.org> <20180402172409.13230-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31026@debbugs.gnu.org * gnu/packages/rust.scm (rust-bootstrapped-package): New procedure. (rust): Use rust-bootstrapped-package. --- gnu/packages/rust.scm | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 8ec748fa6..eaa8c4852 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -235,6 +235,18 @@ safety and thread safety guarantees.") ;; Dual licensed. (license (list license:asl2.0 license:expat)))) +(define (rust-bootstrapped-package base-rust version checksum) + "Bootstrap rust VERSION with source checksum CHECKSUM using BASE-RUST." + (package + (inherit base-rust) + (version version) + (source + (rust-source version checksum)) + (native-inputs + (alist-replace "cargo-bootstrap" (list base-rust "cargo") + (alist-replace "rustc-bootstrap" (list base-rust) + (package-native-inputs base-rust)))))) + (define-public rust-1.23 (package (inherit rust-1.19) @@ -337,18 +349,13 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" #t))))))))) (define-public rust - (let ((base-rust rust-1.23)) + (let ((base-rust + (rust-bootstrapped-package rust-1.23 "1.24.1" + "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))) (package (inherit base-rust) - (version "1.24.1") - (source - (rust-source version - "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y")) - (native-inputs - (alist-replace "cargo-bootstrap" (list base-rust "cargo") - (alist-replace "rustc-bootstrap" (list base-rust) - (package-native-inputs base-rust)))) (arguments (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) `(modify-phases ,phases - (delete 'fix-mtime-bug)))))))) + ((#:phases phases) + `(modify-phases ,phases + (delete 'fix-mtime-bug))))))))