gnu: cross-base: Allow non-default linux-headers.

* gnu/packages/cross-base.scm (cross-kernel-headers): Add
LINUX-HEADERS optional argument.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Carl Dong 2019-05-28 15:57:41 +00:00 committed by Danny Milosavljevic
parent 7180dd6716
commit 2ea77d48a7
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 7 additions and 5 deletions

View File

@ -39,7 +39,8 @@
#:export (cross-binutils #:export (cross-binutils
cross-libc cross-libc
cross-gcc cross-gcc
cross-newlib?)) cross-newlib?
cross-kernel-headers))
(define-syntax %xgcc (define-syntax %xgcc
;; GCC package used as the basis for cross-compilation. It doesn't have to ;; GCC package used as the basis for cross-compilation. It doesn't have to
@ -276,18 +277,19 @@ target that libc."
(define* (cross-kernel-headers target (define* (cross-kernel-headers target
#:optional #:optional
(linux-headers linux-libre-headers)
(xgcc (cross-gcc target)) (xgcc (cross-gcc target))
(xbinutils (cross-binutils target))) (xbinutils (cross-binutils target)))
"Return headers depending on TARGET." "Return headers depending on TARGET."
(define xlinux-headers (define xlinux-headers
(package (inherit linux-libre-headers) (package (inherit linux-headers)
(name (string-append (package-name linux-libre-headers) (name (string-append (package-name linux-headers)
"-cross-" target)) "-cross-" target))
(arguments (arguments
(substitute-keyword-arguments (substitute-keyword-arguments
`(#:implicit-cross-inputs? #f `(#:implicit-cross-inputs? #f
,@(package-arguments linux-libre-headers)) ,@(package-arguments linux-headers))
((#:phases phases) ((#:phases phases)
`(alist-replace `(alist-replace
'build 'build
@ -300,7 +302,7 @@ target that libc."
,phases)))) ,phases))))
(native-inputs `(("cross-gcc" ,xgcc) (native-inputs `(("cross-gcc" ,xgcc)
("cross-binutils" ,xbinutils) ("cross-binutils" ,xbinutils)
,@(package-native-inputs linux-libre-headers))))) ,@(package-native-inputs linux-headers)))))
(define xgnumach-headers (define xgnumach-headers
(package (inherit gnumach-headers) (package (inherit gnumach-headers)