build-system: linux-module: Build and install in parallel.
* guix/build-system/linux-module.scm (linux-module-build) (guix/build-system/linux-module.scm): Accept the PARALLEL-BUILD? keyword and pass it on to the builder. * guix/build/linux-module-build-system.scm (build, install): Capture and honour it.master
parent
7dbd06a13b
commit
834415c33a
|
@ -1,6 +1,7 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
|
;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
|
||||||
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
|
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -157,6 +158,7 @@
|
||||||
%standard-phases))
|
%standard-phases))
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(make-flags ''())
|
(make-flags ''())
|
||||||
|
(parallel-build? #t)
|
||||||
(system (%current-system))
|
(system (%current-system))
|
||||||
(source-directory ".")
|
(source-directory ".")
|
||||||
(guile #f)
|
(guile #f)
|
||||||
|
@ -187,6 +189,7 @@
|
||||||
#:tests? ,tests?
|
#:tests? ,tests?
|
||||||
#:outputs %outputs
|
#:outputs %outputs
|
||||||
#:make-flags ,make-flags
|
#:make-flags ,make-flags
|
||||||
|
#:parallel-build? ,parallel-build?
|
||||||
#:inputs %build-inputs)))
|
#:inputs %build-inputs)))
|
||||||
|
|
||||||
(define guile-for-build
|
(define guile-for-build
|
||||||
|
@ -213,6 +216,7 @@
|
||||||
(guile #f)
|
(guile #f)
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(make-flags ''())
|
(make-flags ''())
|
||||||
|
(parallel-build? #t)
|
||||||
(search-paths '())
|
(search-paths '())
|
||||||
(native-search-paths '())
|
(native-search-paths '())
|
||||||
(tests? #f)
|
(tests? #f)
|
||||||
|
|
|
@ -50,16 +50,22 @@
|
||||||
; TODO: kernel ".config".
|
; TODO: kernel ".config".
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define* (build #:key inputs make-flags (source-directory ".") #:allow-other-keys)
|
(define* (build #:key (make-flags '()) (parallel-build? #t)
|
||||||
|
(source-directory ".")
|
||||||
|
inputs
|
||||||
|
#:allow-other-keys)
|
||||||
(apply invoke "make" "-C"
|
(apply invoke "make" "-C"
|
||||||
(string-append (assoc-ref inputs "linux-module-builder")
|
(string-append (assoc-ref inputs "linux-module-builder")
|
||||||
"/lib/modules/build")
|
"/lib/modules/build")
|
||||||
(string-append "M=" (canonicalize-path source-directory))
|
(string-append "M=" (canonicalize-path source-directory))
|
||||||
(or make-flags '())))
|
`(,@(if parallel-build?
|
||||||
|
`("-j" ,(number->string (parallel-job-count)))
|
||||||
|
'())
|
||||||
|
,@make-flags)))
|
||||||
|
|
||||||
;; This block was copied from make-linux-libre--only took the "modules_install"
|
;; Similar to the "modules_install" part of make-linux-libre.
|
||||||
;; part.
|
(define* (install #:key (make-flags '()) (parallel-build? #t)
|
||||||
(define* (install #:key make-flags (source-directory ".")
|
(source-directory ".")
|
||||||
inputs native-inputs outputs
|
inputs native-inputs outputs
|
||||||
#:allow-other-keys)
|
#:allow-other-keys)
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
|
@ -80,7 +86,10 @@
|
||||||
(string-append "INSTALL_MOD_PATH=" out)
|
(string-append "INSTALL_MOD_PATH=" out)
|
||||||
"INSTALL_MOD_STRIP=1"
|
"INSTALL_MOD_STRIP=1"
|
||||||
"modules_install"
|
"modules_install"
|
||||||
(or make-flags '()))))
|
`(,@(if parallel-build?
|
||||||
|
`("-j" ,(number->string (parallel-job-count)))
|
||||||
|
'())
|
||||||
|
,@make-flags))))
|
||||||
|
|
||||||
(define %standard-phases
|
(define %standard-phases
|
||||||
(modify-phases gnu:%standard-phases
|
(modify-phases gnu:%standard-phases
|
||||||
|
|
Reference in New Issue