all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Prikler <leo.prikler@student.tugraz.at>
To: 50157@debbugs.gnu.org
Cc: maximedevos@telenet.be, efraim@flashner.co.il
Subject: [bug#50157] [PATCH v2 1/2] build-system: linux-module: Support source-directory.
Date: Thu, 26 Aug 2021 13:10:34 +0200	[thread overview]
Message-ID: <20210826111035.20464-1-leo.prikler@student.tugraz.at> (raw)
In-Reply-To: <20210821220053.31441-1-leo.prikler@student.tugraz.at>

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.
---
 guix/build-system/linux-module.scm       | 4 +++-
 guix/build/linux-module-build-system.scm | 9 +++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm
index fc3d959ce7..33bc8c95df 100644
--- a/guix/build-system/linux-module.scm
+++ b/guix/build-system/linux-module.scm
@@ -158,6 +158,7 @@
                              (outputs '("out"))
                              (make-flags ''())
                              (system (%current-system))
+                             (source-directory ".")
                              (guile #f)
                              (substitutable? #t)
                              (imported-modules
@@ -175,7 +176,8 @@
                                       ((source)
                                        source)
                                       (source
-                                        source))
+                                       source))
+                     #:source-directory ,source-directory
                      #:search-paths ',(map search-path-specification->sexp
                                            search-paths)
                      #:phases ,phases
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
-- 
2.33.0





  parent reply	other threads:[~2021-08-26 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 22:00 [bug#50157] [PATCH] gnu: Add xpadneo Leo Prikler
2021-08-22  9:58 ` Maxime Devos
2021-08-22 10:08   ` Leo Prikler
2021-08-22 11:32     ` Efraim Flashner
2021-08-22 12:03       ` Leo Prikler
2021-08-26 11:10 ` Leo Prikler [this message]
2021-08-26 11:10   ` [bug#50157] [PATCH v2 2/2] " Leo Prikler
2021-09-14 22:03     ` bug#50157: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210826111035.20464-1-leo.prikler@student.tugraz.at \
    --to=leo.prikler@student.tugraz.at \
    --cc=50157@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.