guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/06: gnu: linux-libre: Use system->architecture.


From: David Craven
Subject: 03/06: gnu: linux-libre: Use system->architecture.
Date: Tue, 13 Sep 2016 14:46:18 +0000 (UTC)

dvc pushed a commit to branch master
in repository guix.

commit 6d7ef2aad29679cf5327efc35e241a0a75c7c301
Author: David Craven <address@hidden>
Date:   Fri Sep 2 17:10:52 2016 +0200

    gnu: linux-libre: Use system->architecture.
    
    * gnu/packages/linux.scm (linux-libre): Use system->architecture.
---
 gnu/packages/linux.scm |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 4a3e1dc..27b5f4a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -84,7 +84,7 @@
 
 (define-public (system->linux-architecture arch)
   "Return the Linux architecture name for ARCH, a Guix system name such as
-\"x86_64-linux\"."
+\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
   (let ((arch (car (string-split arch #\-))))
     (cond ((string=? arch "i686") "i386")
           ((string-prefix? "mips" arch) "mips")
@@ -292,7 +292,7 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
        (modify-phases %standard-phases
          (delete 'configure)
          (replace 'build
-           (lambda* (#:key system inputs #:allow-other-keys #:rest args)
+           (lambda* (#:key inputs #:allow-other-keys #:rest args)
              ;; Avoid introducing timestamps
              (setenv "KCONFIG_NOTIMESTAMP" "1")
              (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
@@ -301,12 +301,12 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
              (system* "patch" "-p1" "--force"
                       "-i" (assoc-ref inputs "patch/freedo+gnu"))
 
-             (let ((arch (car (string-split system #\-))))
-               (setenv "ARCH"
-                       (cond ((string=? arch "i686") "i386")
-                             ((string=? arch "mips64el") "mips")
-                             (else arch)))
-               (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
+             (let ((arch ,(system->linux-architecture
+                           (or (%current-target-system)
+                               (%current-system)))))
+               (setenv "ARCH" arch))
+
+             (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
 
              (let ((build  (assoc-ref %standard-phases 'build))
                    (config (assoc-ref inputs "kconfig")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]