gnu: linux-libre: Generalize 'kernel-config' to support variants.

* gnu/packages/linux.scm (kernel-config): Rewrite to support optional
  #:variant keyword argument.
master
Mark H Weaver 2016-02-02 01:11:12 -05:00
parent 5e764e2b6f
commit 17db07061f
1 changed files with 18 additions and 13 deletions

View File

@ -66,6 +66,7 @@
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:use-module (ice-9 match)) #:use-module (ice-9 match))
@ -196,20 +197,24 @@
(base32 (base32
"1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06")))) "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
(define (kernel-config system) (define* (kernel-config system #:key variant)
"Return the absolute file name of the Linux-Libre build configuration file "Return the absolute file name of the Linux-Libre build configuration file
for SYSTEM, or #f if there is no configuration for SYSTEM." for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
(define (lookup file) (and-let* ((arch (match system
(let ((file (string-append "gnu/packages/" file))) ("i686-linux"
(search-path %load-path file))) "i686")
("x86_64-linux"
(match system "x86_64")
("i686-linux" (_
(lookup "linux-libre-i686.conf")) #f)))
("x86_64-linux" (name (string-append "linux-libre-"
(lookup "linux-libre-x86_64.conf")) (if variant
(_ (string-append variant "-")
#f))) "")
arch
".conf"))
(file (string-append "gnu/packages/" name)))
(search-path %load-path file)))
(define-public linux-libre (define-public linux-libre
(let* ((version "4.4.1") (let* ((version "4.4.1")