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 06/17] gnu: linux-libre: Add support for cross-compilation.
Date: Fri,  9 Sep 2016 14:34:15 +0200	[thread overview]
Message-ID: <20160909123426.18499-6-david@craven.ch> (raw)
In-Reply-To: <20160909123426.18499-1-david@craven.ch>

* gnu/packages/linux.scm (linux-libre): Add support for
  cross-compilation.
---
 gnu/packages/linux.scm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 436f3d3..ce714c6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -291,17 +291,21 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
        #:phases
        (modify-phases %standard-phases
          (replace 'configure
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key inputs native-inputs target #:allow-other-keys)
              ;; Avoid introducing timestamps
              (setenv "KCONFIG_NOTIMESTAMP" "1")
              (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
 
+             ;; Set ARCH and CROSS_COMPILE
              (let ((arch ,(system->linux-architecture
                            (or (%current-target-system)
                                (%current-system)))))
-               (setenv "ARCH" arch))
+               (setenv "ARCH" arch)
+               (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
 
-             (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
+               (when target
+                 (setenv "CROSS_COMPILE" (string-append target "-"))
+                 (format #t "`CROSS_COMPILE' set to `~a'~%" (getenv "CROSS_COMPILE"))))
 
              (let ((build  (assoc-ref %standard-phases 'build))
                    (config (assoc-ref inputs "kconfig")))
@@ -334,10 +338,10 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
 
                (zero? (system* "make" "oldconfig")))))
          (replace 'install
-           (lambda* (#:key inputs outputs #:allow-other-keys)
+           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
              (let* ((out    (assoc-ref outputs "out"))
                     (moddir (string-append out "/lib/modules"))
-                    (mit    (assoc-ref inputs "module-init-tools")))
+                    (mit    (assoc-ref (or native-inputs inputs) "module-init-tools")))
                (mkdir-p moddir)
                (for-each (lambda (file)
                            (copy-file file
-- 
2.9.0

  parent reply	other threads:[~2016-09-09 12:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 22:45 Linux kernel David Craven
2016-09-09  1:36 ` Leo Famulari
2016-09-09 12:34   ` [PATCH 01/17] gnu: module-init-tools: Prevent line wrapping David Craven
2016-09-09 12:34     ` [PATCH 02/17] gnu: linux-libre: Use modify-phases David Craven
2016-09-09 12:34     ` [PATCH 03/17] gnu: linux-libre: Use system->architecture David Craven
2016-09-09 12:34     ` [PATCH 04/17] gnu: linux-libre: Apply %boot-logo patch in origin David Craven
2016-09-11 20:57       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 05/17] gnu: linux-libre: Move kernel configuration to configure phase David Craven
2016-09-11 20:57       ` Ludovic Courtès
2016-09-09 12:34     ` David Craven [this message]
2016-09-11 20:58       ` [PATCH 06/17] gnu: linux-libre: Add support for cross-compilation Ludovic Courtès
2016-09-09 12:34     ` [PATCH 07/17] gnu: linux-libre: Use make-linux-libre David Craven
2016-09-11 21:07       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration parameter David Craven
2016-09-11 21:13       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 09/17] gnu: dtc: Remove patch-paths phase David Craven
2016-09-11 21:14       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 10/17] gnu: Add u-boot-beagle-bone-black David Craven
2016-09-11 21:16       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 11/17] gnu: Add make-linux-libre-source David Craven
2016-09-11 21:21       ` Ludovic Courtès
2016-09-11 21:23       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 12/17] gnu: make-linux-libre: Add extra-version parameter David Craven
2016-09-11 21:32       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 13/17] gnu: make-linux-libre: Add zImage to output David Craven
2016-09-11 21:24       ` Ludovic Courtès
2016-09-12  6:59         ` Danny Milosavljevic
2016-09-12  7:46           ` David Craven
2016-09-09 12:34     ` [PATCH 14/17] gnu: linux-libre: Use kmod David Craven
2016-09-11 21:25       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 15/17] gnu: make-linux-libre: Add supported-systems parameter David Craven
2016-09-11 21:28       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 16/17] gnu: Add linux-libre-multi-v7 David Craven
2016-09-09 14:31       ` Vincent Legoll
2016-09-11 21:30       ` Ludovic Courtès
2016-09-09 12:34     ` [PATCH 17/17] gnu: Add linux-libre-beagle-bone-black David Craven
2016-09-11 21:33       ` Ludovic Courtès
2016-09-09 22:26 ` Linux kernel Ludovic Courtès
2016-09-09 22:48   ` David Craven
2016-09-10 12:57     ` 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=20160909123426.18499-6-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.