unofficial mirror of guix-patches@gnu.org 
 help / color / Atom feed
* [bug#41643] [PATCH] build-system: linux-module: Allow passing #:make-flags argument.
@ 2020-06-01 12:59 Danny Milosavljevic
  2020-06-02  9:05 ` Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Danny Milosavljevic @ 2020-06-01 12:59 UTC (permalink / raw)
  To: 41643; +Cc: Danny Milosavljevic

* 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(-)

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."




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#41643] [PATCH] build-system: linux-module: Allow passing #:make-flags argument.
  2020-06-01 12:59 [bug#41643] [PATCH] build-system: linux-module: Allow passing #:make-flags argument Danny Milosavljevic
@ 2020-06-02  9:05 ` Mathieu Othacehe
  2020-06-02 12:22   ` bug#41643: " Danny Milosavljevic
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2020-06-02  9:05 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 41643


Hello Danny,

>              (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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#41643: [PATCH] build-system: linux-module: Allow passing #:make-flags argument.
  2020-06-02  9:05 ` Mathieu Othacehe
@ 2020-06-02 12:22   ` Danny Milosavljevic
  0 siblings, 0 replies; 3+ messages in thread
From: Danny Milosavljevic @ 2020-06-02 12:22 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 41643-done

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 12:59 [bug#41643] [PATCH] build-system: linux-module: Allow passing #:make-flags argument Danny Milosavljevic
2020-06-02  9:05 ` Mathieu Othacehe
2020-06-02 12:22   ` bug#41643: " Danny Milosavljevic

unofficial mirror of guix-patches@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-patches/1 guix-patches/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-patches guix-patches/ https://yhetil.org/guix-patches \
		guix-patches@gnu.org
	public-inbox-index guix-patches

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.patches


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git