summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2021-09-14 23:27:36 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2021-09-14 23:27:36 +0200
commitc8e2358cca79f24a0f1183d806e9dd00d6951712 (patch)
tree302febeb7628982af143a03b9dd173c773e1f4a6 /guix/build
parenta72519489f0178051b7049d5793d95d070ebef86 (diff)
downloadguix-patches-c8e2358cca79f24a0f1183d806e9dd00d6951712.tar
guix-patches-c8e2358cca79f24a0f1183d806e9dd00d6951712.tar.gz
build-system: linux-module: Support source-directory.
As with guile-build-system, the module to be build need not necessarily live at the root of the build tree. * guix/build/linux-module-build-system.scm (build, install): Add source-directory argument and append it to "M" variable when invoking make. * guix/build-system/linux-module.scm (linux-module-build): Add source-directory argument.
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/linux-module-build-system.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/guix/build/linux-module-build-system.scm b/guix/build/linux-module-build-system.scm
index d51d76f94b..729ab6154f 100644
--- a/guix/build/linux-module-build-system.scm
+++ b/guix/build/linux-module-build-system.scm
@@ -49,16 +49,17 @@
; TODO: kernel ".config".
#t)
-(define* (build #:key inputs make-flags #:allow-other-keys)
+(define* (build #:key inputs make-flags (source-directory ".") #:allow-other-keys)
(apply invoke "make" "-C"
(string-append (assoc-ref inputs "linux-module-builder")
"/lib/modules/build")
- (string-append "M=" (getcwd))
+ (string-append "M=" (getcwd) "/" source-directory)
(or make-flags '())))
;; This block was copied from make-linux-libre--only took the "modules_install"
;; part.
-(define* (install #:key make-flags inputs native-inputs outputs
+(define* (install #:key make-flags (source-directory ".")
+ inputs native-inputs outputs
#:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(moddir (string-append out "/lib/modules")))
@@ -67,7 +68,7 @@
(apply invoke "make" "-C"
(string-append (assoc-ref inputs "linux-module-builder")
"/lib/modules/build")
- (string-append "M=" (getcwd))
+ (string-append "M=" (getcwd) "/" source-directory)
;; Disable depmod because the Guix system's module directory
;; is an union of potentially multiple packages. It is not
;; possible to use depmod to usefully calculate a dependency