> +(define (make-u-boot-package board triplet xgcc) ... > + (begin > + (display "Invalid boardname. Valid boardnames would > have been:") > + (newline) > + (system* "ls" "-1" "configs") > + #f)))))
I've improved the error message if the board name is unknown: #:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs make-flags #:allow-other-keys) (let ((configname (string-append ,board "_defconfig"))) (if (zero? (system* "ls" (string-append "configs/" configname))) (zero? (apply system* "make" `(,@make-flags ,configname))) (begin (use-modules (ice-9 match) (ice-9 format)) (display "Invalid boardname. Valid boardnames would have been:") (newline) (let ((dir (opendir "configs"))) (do ((filename (readdir dir) (readdir dir))) ((eof-object? filename)) (if (string-suffix? "_defconfig" filename) (format #t "- ~A\n" (string-drop-right filename (string-length "_defconfig"))))) (closedir dir)) #f))))) (replace 'install (lambda* (#:key outputs make-flags #:allow-other-keys) (let ((out (string-append (assoc-ref outputs "out") "/libexec"))) (mkdir-p out) (for-each (lambda (name) (let ((outname (string-append out "/" name))) (mkdir-p (dirname outname)) (copy-file name outname))) (find-files "." ".*\\.(bin|efi)$"))))))))))