[PATCH] build-system: linux-module: Allow passing #:make-flags argument.

DoneSubmitted by Danny Milosavljevic.
Details
2 participants
  • Danny Milosavljevic
  • Mathieu Othacehe
Owner
unassigned
Severity
normal
D
D
Danny Milosavljevic wrote on 1 Jun 2020 14:59
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20200601125910.12840-1-dannym@scratchpost.org
* guix/build-system/linux-module.scm (linux-module-build): Add #:make-flags.
(linux-module-build-cross): Add #:make-flags.
* guix/build/linux-module-build-system.scm (install): Pass make-flags.
---
guix/build-system/linux-module.scm | 4 ++++
guix/build/linux-module-build-system.scm | 11 +++++++----
2 files changed, 11 insertions(+), 4 deletions(-)

Toggle diff (76 lines)
diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm
index ca104f7c75..1077215671 100644
--- a/guix/build-system/linux-module.scm
+++ b/guix/build-system/linux-module.scm
@@ -129,6 +129,7 @@
                              (phases '(@ (guix build linux-module-build-system)
                                          %standard-phases))
                              (outputs '("out"))
+                             (make-flags ''())
                              (system (%current-system))
                              (guile #f)
                              (substitutable? #t)
@@ -156,6 +157,7 @@
                      #:arch ,(system->arch (or target system))
                      #:tests? ,tests?
                      #:outputs %outputs
+                     #:make-flags ,make-flags
                      #:inputs %build-inputs)))
 
   (define guile-for-build
@@ -181,6 +183,7 @@
           target native-drvs target-drvs
           (guile #f)
           (outputs '("out"))
+          (make-flags ''())
           (search-paths '())
           (native-search-paths '())
           (tests? #f)
@@ -228,6 +231,7 @@
                              #:target ,target
                              #:arch ,(system->arch (or target system))
                              #:outputs %outputs
+                             #:make-flags ,make-flags
                              #:inputs %build-target-inputs
                              #:native-inputs %build-host-inputs
                              #:search-paths
diff --git a/guix/build/linux-module-build-system.scm b/guix/build/linux-module-build-system.scm
index 73d6b101f6..d51d76f94b 100644
--- a/guix/build/linux-module-build-system.scm
+++ b/guix/build/linux-module-build-system.scm
@@ -58,12 +58,13 @@
 
 ;; This block was copied from make-linux-libre--only took the "modules_install"
 ;; part.
-(define* (install #:key inputs native-inputs outputs #:allow-other-keys)
+(define* (install #:key make-flags inputs native-inputs outputs
+                  #:allow-other-keys)
   (let* ((out (assoc-ref outputs "out"))
          (moddir (string-append out "/lib/modules")))
     ;; Install kernel modules
     (mkdir-p moddir)
-    (invoke "make" "-C"
+    (apply invoke "make" "-C"
             (string-append (assoc-ref inputs "linux-module-builder")
                            "/lib/modules/build")
             (string-append "M=" (getcwd))
@@ -76,7 +77,8 @@
             (string-append "INSTALL_PATH=" out)
             (string-append "INSTALL_MOD_PATH=" out)
             "INSTALL_MOD_STRIP=1"
-            "modules_install")))
+            "modules_install"
+            (or make-flags '()))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
@@ -84,7 +86,8 @@
     (replace 'build build)
     (replace 'install install)))
 
-(define* (linux-module-build #:key inputs (phases %standard-phases)
+(define* (linux-module-build #:key inputs
+                             (phases %standard-phases)
                              #:allow-other-keys #:rest args)
   "Build the given package, applying all of PHASES in order, with a Linux
 kernel in attendance."
M
M
Mathieu Othacehe wrote on 2 Jun 2020 11:05
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 41643@debbugs.gnu.org)
87zh9lx2gj.fsf@gnu.org
Hello Danny,

Toggle quote (7 lines)
> (string-append "INSTALL_PATH=" out)
> (string-append "INSTALL_MOD_PATH=" out)
> "INSTALL_MOD_STRIP=1"
> - "modules_install")))
> + "modules_install"
> + (or make-flags '()))))

Maybe it would be clearer to have the flags before the make 'target'.

Otherwise this looks ok,

Thanks,

Mathieu
D
D
Danny Milosavljevic wrote on 2 Jun 2020 14:22
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 41643-done@debbugs.gnu.org)
20200602142259.48258e27@scratchpost.org
It only works as the last argument on "apply". Using quasiquote for this would
be a little over-the-top.

Also, almost all the other build system, even the ones using quasiquote, also
pass them at the end of the argument list. Just scons-build-system doesn't at
one single place of multiple, and meson-build-system doesn't with
configure-flags.

I'm not opposed to doing it like you suggest, but let's do it for all the
build systems in an extra patch.

Pushed to guix master as commit f51fd97ec54a98668d63c52d8a6bd75d8dc3292e.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl7WRKMACgkQ5xo1VCww
uqVYdwf/VPMyeTjEo1u6ReUlDW4HU92wAaHtd3e/TP/KEeraK9pKbq+9KaZt/Emm
VD2bEL/HwGyvQtTppBMIo5r8pagztAA48HbaKkkjuTVPE+JKurbO6VvftOM304Pz
re4OpgsmJY5/+/E4HAnU6IHwEH0TtIy1m5RwMHD8XdZQ+mhFDemtpLZbCHMaW1wd
BrKFn5LzQs3JhmiqYnsjaSot7KSg/kFnx5iMlLkIE8gvZCERkG9SQuXE0ac9boqV
Ov1a9oXBaMQI0HunZXpR8ssOhT8D7XaGyV60T4kUX2MRiwq7u8FaRNmTDnE+PGKk
VmS8odoLQA8M1WdbGj8iv43Aj+gQ2w==
=KKWD
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 41643@debbugs.gnu.org