guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 07/17] gnu: linux-libre: Use make-linux-libre.


From: David Craven
Subject: [PATCH 07/17] gnu: linux-libre: Use make-linux-libre.
Date: Fri, 9 Sep 2016 14:34:16 +0200

* gnu/packages/linux.scm (linux-libre, linux-libre-4.4,
  linux-libre-4.1): Use make-linux-libre.
  (make-linux-libre): New variable.
---
 gnu/packages/linux.scm | 78 ++++++++++++++++++++++----------------------------
 1 file changed, 34 insertions(+), 44 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ce714c6..ab20f6e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -257,16 +257,17 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
              (file (string-append "gnu/packages/" name)))
     (search-path %load-path file)))
 
-(define-public linux-libre
+(define* (make-linux-libre version hash
+                           #:key
+                           (configuration-file #f)
+                           (defconfig "defconfig"))
   (package
     (name "linux-libre")
-    (version "4.7.2")
+    (version version)
     (source (origin
               (method url-fetch)
               (uri (linux-libre-urls version))
-              (sha256
-               (base32
-                "1rp09y2hv0hvdybm2n2im9717kzxmklpgzs8k1bmdfzqxyg8cb85"))
+              (sha256 (base32 hash))
               (patches (origin-patches %boot-logo-patch))))
     (build-system gnu-build-system)
     (supported-systems '("x86_64-linux" "i686-linux"))
@@ -275,14 +276,7 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
        ("bc" ,bc)
        ("openssl" ,openssl)
        ("module-init-tools" ,module-init-tools)
-
-       ,@(let ((conf (kernel-config
-                      (or (%current-target-system)
-                          (%current-system))
-                      #:variant (version-major+minor version))))
-           (if conf
-               `(("kconfig" ,conf))
-               '()))))
+       ,@(if configuration-file `(("kconfig" ,configuration-file)) '())))
     (arguments
      `(#:modules ((guix build gnu-build-system)
                   (guix build utils)
@@ -316,7 +310,7 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
                    (begin
                      (copy-file config ".config")
                      (chmod ".config" #o666))
-                   (system* "make" "defconfig"))
+                   (system* "make" ,defconfig))
 
                ;; Appending works even when the option wasn't in the
                ;; file.  The last one prevails if duplicated.
@@ -363,39 +357,35 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
 It has been modified to remove all non-free binary blobs.")
     (license license:gpl2)))
 
+(define-public linux-libre
+  (let* ((version "4.7.2")
+         (conf (kernel-config
+                (or (%current-target-system)
+                    (%current-system))
+                #:variant (version-major+minor version))))
+    (make-linux-libre version
+                      "1rp09y2hv0hvdybm2n2im9717kzxmklpgzs8k1bmdfzqxyg8cb85"
+                      #:configuration-file conf)))
+
 (define-public linux-libre-4.4
-  (package
-    (inherit linux-libre)
-    (version "4.4.19")
-    (source (origin
-              (method url-fetch)
-              (uri (linux-libre-urls version))
-              (sha256
-               (base32
-                "0nddjs7prmb0g7g3w2k4qfyq02a9szm5nvsgflxcaarbq1slibb5"))))
-    (native-inputs
-     (let ((conf (kernel-config (or (%current-target-system)
-                                    (%current-system))
-                                #:variant "4.4")))
-       `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
-         ("kconfig" ,conf))))))
+  (let* ((version "4.4.19")
+         (conf (kernel-config
+                (or (%current-target-system)
+                    (%current-system))
+                #:variant (version-major+minor version))))
+    (make-linux-libre version
+                      "0nddjs7prmb0g7g3w2k4qfyq02a9szm5nvsgflxcaarbq1slibb5"
+                      #:configuration-file conf)))
 
 (define-public linux-libre-4.1
-  (package
-    (inherit linux-libre)
-    (version "4.1.31")
-    (source (origin
-              (method url-fetch)
-              (uri (linux-libre-urls version))
-              (sha256
-               (base32
-                "0grffah921k136w1qwcswxv6m810s8q54nr2rk7kyqka3a1b81yw"))))
-    (native-inputs
-     (let ((conf (kernel-config (or (%current-target-system)
-                                    (%current-system))
-                                #:variant "4.1")))
-       `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
-         ("kconfig" ,conf))))))
+  (let* ((version "4.1.31")
+         (conf (kernel-config
+                (or (%current-target-system)
+                    (%current-system))
+                #:variant (version-major+minor version))))
+    (make-linux-libre version
+                      "0grffah921k136w1qwcswxv6m810s8q54nr2rk7kyqka3a1b81yw"
+                      #:configuration-file conf)))
 
 
 ;;;
-- 
2.9.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]