[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/17] gnu: linux-libre: Use make-linux-libre.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH 07/17] gnu: linux-libre: Use make-linux-libre. |
Date: |
Sun, 11 Sep 2016 23:07:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
David Craven <address@hidden> skribis:
> * gnu/packages/linux.scm (linux-libre, linux-libre-4.4,
> linux-libre-4.1): Use make-linux-libre.
> (make-linux-libre): New variable.
[...]
> +(define-public linux-libre
> + (let* ((version "4.7.2")
> + (conf (kernel-config
> + (or (%current-target-system)
> + (%current-system))
> + #:variant (version-major+minor version))))
I just realized that this won’t do what we want.
The expression (or (%current-target-system) (%current-system)) is
evaluated at the top-level—i.e., when (gnu packages linux) is loaded.
At that time, (%current-system) holds its default value and
(%current-target-system) is #f. IOW, even if you do:
guix build -s foo linux-libre
or:
guix build --target=bar linux-libre
you always end up with the x86_64-linux kernel config (if you’re on
x86_64-linux).
Conversely, when we write:
(package
;; …
(inputs `(("conf" ,(kernel-config
(or (%current-target-system) …))))))
things work as expected because the ‘inputs’ field is “thunked”
(lazy-evaluated) specifically for this purpose.
A solution would be to pass a procedure instead of a config:
(define* (make-linux-libre version hash
#:key
(configuration-file #f)
(defconfig "defconfig"))
(package
(name "linux-libre")
(version version)
(source (origin
(method url-fetch)
(uri (linux-libre-urls version))
(sha256 (base32 hash))
(patches (origin-patches %boot-logo-patch))))
(build-system gnu-build-system)
(supported-systems '("x86_64-linux" "i686-linux"))
(inputs
`(("bc" ,bc)
;; …
;; Call ‘configuration-file’ and pass it the right system type.
,@(if configuration-file
`(("kconfig" ,(configuration-file
(or (%current-target-system) …))))
'())))
(define variant1
(make-linux-libre v h
#:configuration-file (lambda (system)
…)))
Makes sense?
HTH!
Ludo’.
- [PATCH 01/17] gnu: module-init-tools: Prevent line wrapping., (continued)
- [PATCH 02/17] gnu: linux-libre: Use modify-phases., David Craven, 2016/09/09
- [PATCH 03/17] gnu: linux-libre: Use system->architecture., David Craven, 2016/09/09
- [PATCH 06/17] gnu: linux-libre: Add support for cross-compilation., David Craven, 2016/09/09
- Re: [PATCH 06/17] gnu: linux-libre: Add support for cross-compilation., Ludovic Courtès, 2016/09/11
- [PATCH 07/17] gnu: linux-libre: Use make-linux-libre., David Craven, 2016/09/09
- Re: [PATCH 07/17] gnu: linux-libre: Use make-linux-libre.,
Ludovic Courtès <=
- [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration parameter., David Craven, 2016/09/09
- Re: [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration parameter., Ludovic Courtès, 2016/09/11
- [PATCH 09/17] gnu: dtc: Remove patch-paths phase., David Craven, 2016/09/09
- Re: [PATCH 09/17] gnu: dtc: Remove patch-paths phase., Ludovic Courtès, 2016/09/11
- [PATCH 10/17] gnu: Add u-boot-beagle-bone-black., David Craven, 2016/09/09
- Re: [PATCH 10/17] gnu: Add u-boot-beagle-bone-black., Ludovic Courtès, 2016/09/11
- [PATCH 11/17] gnu: Add make-linux-libre-source., David Craven, 2016/09/09
- Re: [PATCH 11/17] gnu: Add make-linux-libre-source., Ludovic Courtès, 2016/09/11
- Re: [PATCH 11/17] gnu: Add make-linux-libre-source., Ludovic Courtès, 2016/09/11
- [PATCH 13/17] gnu: make-linux-libre: Add zImage to output., David Craven, 2016/09/09