Subject: [bug#37466] [PATCH 2/4] gnu: Add heads.

From: Danny Milosavljevic <[email-masked]>
Date: Wed, 25 Sep 2019 02:24:39 +0200

Better version:

diff --git a/gnu/packages/heads.scm b/gnu/packages/heads.scm
index 9128a4f426..01b9eeaa90 100644
--- a/gnu/packages/heads.scm
+++ b/gnu/packages/heads.scm
@@ -202,12 +202,13 @@ done
            (uri "https://www.coreboot.org/releases/coreboot-4.8.1.tar.xz")
            (sha256
             (base32 "08xdd5drk8yd37a3z5hc81qmgsybv6201i28hcggxh980vdz9pgh"))))
-       ("linux"
-        ,(origin
-           (method url-fetch)
-           (uri "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.62.tar.xz")
-           (sha256
-            (base32 "1ar29ikway5im17iw9ag1fxivr7sbj8nhxxw347xqmp1irz4vjji"))))
+;       ("linux"
+;        ,(origin
+;           (method url-fetch)
+;           (uri "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.62.tar.xz")
+;           (sha256
+;            (base32 "1ar29ikway5im17iw9ag1fxivr7sbj8nhxxw347xqmp1irz4vjji"))))
+       ("linux" ,linux-libre-4.14-source)
        ("musl" ; useless
         ,(origin
            (method url-fetch)
@@ -422,13 +423,16 @@ done
                  ;(invoke "tar" "-xf" source-file "-C" "build")
 ))
              (mkdir-p "packages")
+             (setenv "V" "1") ; verbose
              (setenv "GUIX_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
              (setenv "GUIX_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
              (setenv "GUIX_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
              (setenv "GUIX_CPATH" (getenv "CPATH"))
+             (copy-file (assoc-ref inputs "linux")
+                        "packages/linux-4.14.62.tar.xz.tmp")
              (for-each (lambda (name)
                          (install-file* name "packages" ".tmp"))
-                       '("linux" "coreboot-blobs" "coreboot" "busybox" "zlib" "mbedtls" "kexec-tools" "qrencode" "pciutils" "util-linux" "flashrom" "popt" "lvm2" "cryptsetup" "libgpg-error" "libgcrypt" "libksba" "libassuan" "npth" "libusb" "libusb-compat" "dropbear" "pinentry" "gnupg" "slang" "newt" "musl"))
+                       '("coreboot-blobs" "coreboot" "busybox" "zlib" "mbedtls" "kexec-tools" "qrencode" "pciutils" "util-linux" "flashrom" "popt" "lvm2" "cryptsetup" "libgpg-error" "libgcrypt" "libksba" "libassuan" "npth" "libusb" "libusb-compat" "dropbear" "pinentry" "gnupg" "slang" "newt" "musl"))
              (mkdir-p "build")
              (mkdir-p "build/musl-cross-git/tarballs")
              (mkdir-p "build/coreboot-4.8.1/util/crossgcc/tarballs")
@@ -443,6 +447,9 @@ done
              (setenv "MUSL_DIR" (assoc-ref inputs "musl-cross"))
              (setenv "CROSS" (string-append (getenv "MUSL_DIR") "/crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-")) ; Note: Useless
              (substitute* "Makefile"
+              ;; Disable checksum verification--we do it ourselves.
+              (("sha256sum --check")
+               "cat")
               ;; Disable our non-cross toolchain environment.
               (("CROSS_TOOLS_NOCC := ")
                ; CPP=" (getenv "CROSS") "cpp CXXCPP=" (getenv "CROSS") "cpp "
@@ -461,11 +468,13 @@ done
                               "CC_FOR_BUILD = $(HOSTCC)\n" ; for libgpg-error
                               "BUILD_CC = $(HOSTCC)\n")) ; for kexec-tools
               ;; Disable git, patch shebangs, and selectively re-enable host compiler.
+              ;; (Note: $HOSTCC is too complicated for bash, for example
+              ;;  HOSTCC="a=b c=d gcc", then issuing $HOSTCC won't work).
               (("(git clone.*)." _ tar)
 " "true" (assoc-ref inputs "bash") (assoc-ref inputs "bash") (assoc-ref inputs "bash")))
               (("(tar -xf.*)." _ tar)
 " tar (assoc-ref inputs "bash") (assoc-ref inputs "bash") (assoc-ref inputs "bash"))))
              ;(substitute* "modules/musl-cross"
              ; (("/bin/echo") "echo"))
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 59874b097c..5b234a1ba9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -194,7 +194,7 @@ defconfig.  Return the appropriate make target if applicable, otherwise return
 
 (define deblob-scripts-4.14
   (linux-libre-deblob-scripts
-   "4.14.140"
+   "4.14.62"
    (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
    (base32 "0x9nd3hnyrm753cbgdqmy92mbnyw86w64g4hvyibnkpq5n7s3z9n")))
 
@@ -366,10 +366,10 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.19)))
 
-(define-public linux-libre-4.14-version "4.14.142")
+(define-public linux-libre-4.14-version "4.14.62")
 (define-public linux-libre-4.14-pristine-source
   (let ((version linux-libre-4.14-version)
-        (hash (base32 "1wwhnm1n1b6yzsd2zzzf9i3n4hlvgnph70p67cwahw0ik4ssayz6")))
+        (hash (base32 "1ar29ikway5im17iw9ag1fxivr7sbj8nhxxw347xqmp1irz4vjji")))
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.14)))