gnu: u-boot: Use scandir.
* gnu/packages/u-boot.scm (make-u-boot-package): Modify.
This commit is contained in:
parent
2d92eca154
commit
40c4e3bbda
|
@ -93,7 +93,8 @@ also initializes the boards (RAM etc).")
|
||||||
("cross-binutils" ,(cross-binutils triplet))
|
("cross-binutils" ,(cross-binutils triplet))
|
||||||
,@(package-native-inputs u-boot)))
|
,@(package-native-inputs u-boot)))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:test-target "test"
|
`(#:modules ((ice-9 ftw) (guix build utils) (guix build gnu-build-system))
|
||||||
|
#:test-target "test"
|
||||||
#:make-flags
|
#:make-flags
|
||||||
(list "HOSTCC=gcc" (string-append "CROSS_COMPILE=" ,triplet "-"))
|
(list "HOSTCC=gcc" (string-append "CROSS_COMPILE=" ,triplet "-"))
|
||||||
#:phases
|
#:phases
|
||||||
|
@ -105,14 +106,14 @@ also initializes the boards (RAM etc).")
|
||||||
(zero? (apply system* "make" `(,@make-flags ,config-name)))
|
(zero? (apply system* "make" `(,@make-flags ,config-name)))
|
||||||
(begin
|
(begin
|
||||||
(display "Invalid board name. Valid board names are:")
|
(display "Invalid board name. Valid board names are:")
|
||||||
(let ((dir (opendir "configs"))
|
(let ((suffix-len (string-length "_defconfig")))
|
||||||
(suffix-length (string-length "_defconfig")))
|
(scandir "configs"
|
||||||
(do ((file-name (readdir dir) (readdir dir)))
|
(lambda (file-name)
|
||||||
((eof-object? file-name))
|
(when (string-suffix? "_defconfig" file-name)
|
||||||
(when (string-suffix? "_defconfig" file-name)
|
(format #t
|
||||||
(format #t "- ~A\n"
|
"- ~A\n"
|
||||||
(string-drop-right file-name suffix-length))))
|
(string-drop-right file-name
|
||||||
(closedir dir))
|
suffix-len))))))
|
||||||
#f)))))
|
#f)))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
(lambda* (#:key outputs make-flags #:allow-other-keys)
|
||||||
|
|
Loading…
Reference in New Issue