From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: [PATCH 6/6] gnu: make-u-boot-package: Don't cross compile on arm. Date: Mon, 26 Sep 2016 12:34:47 +0200 Message-ID: <20160926103447.31830-6-david@craven.ch> References: <20160926103447.31830-1-david@craven.ch> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boTFe-0001xk-QE for guix-devel@gnu.org; Mon, 26 Sep 2016 06:35:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boTFc-0004S2-Aq for guix-devel@gnu.org; Mon, 26 Sep 2016 06:35:09 -0400 Received: from so254-10.mailgun.net ([198.61.254.10]:47384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boTFb-0004D0-33 for guix-devel@gnu.org; Mon, 26 Sep 2016 06:35:08 -0400 In-Reply-To: <20160926103447.31830-1-david@craven.ch> 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/u-boot.scm (make-u-boot-package): Don't cross compile on arm. --- gnu/packages/u-boot.scm | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/gnu/packages/u-boot.scm b/gnu/packages/u-boot.scm index 60fd48f..d8b8291 100644 --- a/gnu/packages/u-boot.scm +++ b/gnu/packages/u-boot.scm @@ -88,20 +88,24 @@ also initializes the boards (RAM etc).") (inherit u-boot) (name (string-append "u-boot-" (string-downcase board))) (native-inputs - `(("cross-gcc" ,(cross-gcc triplet)) - ("cross-binutils" ,(cross-binutils triplet)) - ,@(package-native-inputs u-boot))) + `(,@(package-native-inputs u-boot) + ,@(if triplet + `(("cross-gcc" ,(cross-gcc triplet)) + ("cross-binutils" ,(cross-binutils triplet))) + '()))) (arguments `(#:test-target "test" #:make-flags - (list "HOSTCC=gcc" (string-append "CROSS_COMPILE=" ,triplet "-")) + (list "HOSTCC=gcc" ,@(if triplet + `((string-append "CROSS_COMPILE=" ,triplet "-")) + '())) #:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs make-flags #:allow-other-keys) (let ((config-name (string-append ,board "_defconfig"))) (if (file-exists? (string-append "configs/" config-name)) - (zero? (apply system* "make" `(,@make-flags ,config-name))) + (zero? (apply system* "make" (cons config-name make-flags))) (begin (display "Invalid board name. Valid board names are:") (let ((dir (opendir "configs")) @@ -124,10 +128,19 @@ also initializes the boards (RAM etc).") '(,@files-to-install))))))))) (define-public u-boot-vexpress - (make-u-boot-package "vexpress_ca9x4" "arm-linux-gnueabihf" '("u-boot.bin"))) + (make-u-boot-package + "vexpress_ca9x4" + (if (string-prefix? "armhf" (%current-system)) #f "arm-linux-gnueabihf") + '("u-boot.bin"))) (define-public u-boot-malta - (make-u-boot-package "malta" "mips64el-linux-gnuabi64" '("u-boot.bin"))) + (make-u-boot-package + "malta" + (if (string-prefix? "mips64el" (%current-system)) #f "mips64el-linux-gnuabi64") + '("u-boot.bin"))) (define-public u-boot-beagle-bone-black - (make-u-boot-package "am335x_boneblack" "arm-linux-gnueabihf" '("MLO" "u-boot.img"))) + (make-u-boot-package + "am335x_boneblack" + (if (string-prefix? "armhf" (%current-system)) #f "arm-linux-gnueabihf") + '("MLO" "u-boot.img"))) -- 2.9.0