summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorStefan <stefan-guix@vodafonemail.de>2022-11-30 19:53:12 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-12-01 10:53:48 -0500
commitad9d0f8e58414749d52c2eb2c6998a0926b74388 (patch)
tree93501d732ab98f6afbd28df3a44abc0b4bd06860 /gnu
parent0823fd1aa9e63b6021eb04d0d41d5c55ad328ebf (diff)
downloadguix-ad9d0f8e58414749d52c2eb2c6998a0926b74388.tar.gz
gnu: linux: Fix the extra-version parameter in make-linux-libre*.
* gnu/packages/linux.scm (make-linux-libre*)

[phases] {configure}: Remove now extraneous INPUTS argument and Move code
setting environment variables to...
{set-environment}: ... this new phase.  Patch the Makefile to accept
EXTRAVERSION from the environment.  Fix the usage of an empty extra-version
string.
{install}: Remove extraneous NATIVE-INPUTS argument.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/linux.scm20
1 files changed, 11 insertions, 9 deletions
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 8086980901..5dde319361 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -67,6 +67,7 @@
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2022 Hunter Jozwiak <hunter.t.joz@gmail.com>
 ;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
+;;; Copyright © 2022 Stefan <stefan-guix@vodafonemail.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -846,8 +847,8 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
                                   (string-append "infodir=" #$output
                                                  "/share/info"))))))
                  #~())
-          (replace 'configure
-            (lambda* (#:key inputs target #:allow-other-keys)
+          (add-before 'configure 'set-environment
+            (lambda* (#:key target #:allow-other-keys)
               ;; Avoid introducing timestamps.
               (setenv "KCONFIG_NOTIMESTAMP" "1")
               (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
@@ -863,18 +864,21 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
                                   (%current-system))))))
                 (setenv "ARCH" arch)
                 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
-
                 (when target
                   (setenv "CROSS_COMPILE" (string-append target "-"))
                   (format #t "`CROSS_COMPILE' set to `~a'~%"
                           (getenv "CROSS_COMPILE"))))
 
+              ;; Allow EXTRAVERSION to be set via the environment.
+              (substitute* "Makefile"
+                (("^ *EXTRAVERSION[[:blank:]]*=")
+                 "EXTRAVERSION ?="))
               (setenv "EXTRAVERSION"
                       #$(and extra-version
-                             (string-append "-" extra-version)))
-
+                             (string-append "-" extra-version)))))
+          (replace 'configure
+            (lambda* (#:key inputs #:allow-other-keys)
               (let ((config (assoc-ref inputs "kconfig")))
-
                 ;; Use a custom kernel configuration file or a default
                 ;; configuration file.
                 (if config
@@ -882,17 +886,15 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
                       (copy-file config ".config")
                       (chmod ".config" #o666))
                     (invoke "make" #$defconfig))
-
                 ;; Appending works even when the option wasn't in the
                 ;; file.  The last one prevails if duplicated.
                 (let ((port (open-file ".config" "a"))
                       (extra-configuration #$(config->string extra-options)))
                   (display extra-configuration port)
                   (close-port port))
-
                 (invoke "make" "oldconfig"))))
           (replace 'install
-            (lambda* (#:key inputs native-inputs #:allow-other-keys)
+            (lambda* (#:key inputs #:allow-other-keys)
               (let ((moddir (string-append #$output "/lib/modules"))
                     (dtbdir (string-append #$output "/lib/dtbs")))
                 ;; Install kernel image, kernel configuration and link map.