gnu: sway: Update to 1.4
[jackhill/guix/guix.git] / gnu / packages / linux.scm
index f7c42ff..e9fdf94 100644 (file)
@@ -22,7 +22,7 @@
 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
-;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
@@ -42,6 +42,7 @@
 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -63,7 +64,6 @@
   #:use-module (gnu packages acl)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages acl)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
-  #:use-module (gnu packages attr)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
@@ -369,50 +369,50 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
     (sha256 hash)))
 
 
     (sha256 hash)))
 
 
-(define-public linux-libre-5.6-version "5.6.10")
+(define-public linux-libre-5.6-version "5.6.11")
 (define-public linux-libre-5.6-pristine-source
   (let ((version linux-libre-5.6-version)
 (define-public linux-libre-5.6-pristine-source
   (let ((version linux-libre-5.6-version)
-        (hash (base32 "1f81b0icn0r9gww95rckyxs5d4g8bwf4mmqkrmwxxf4xga19dp3v")))
+        (hash (base32 "1ahv4a3mnszqs3qcnwmhbvjgis1jg37anj5jvn70i7s2k6z6rpfn")))
    (make-linux-libre-source version
                             (%upstream-linux-source version hash)
                             deblob-scripts-5.6)))
 
    (make-linux-libre-source version
                             (%upstream-linux-source version hash)
                             deblob-scripts-5.6)))
 
-(define-public linux-libre-5.4-version "5.4.38")
+(define-public linux-libre-5.4-version "5.4.39")
 (define-public linux-libre-5.4-pristine-source
   (let ((version linux-libre-5.4-version)
 (define-public linux-libre-5.4-pristine-source
   (let ((version linux-libre-5.4-version)
-        (hash (base32 "03pks3jx5kk0wnhjkm92wxdbgw8qbdg93sfwchnx88m2wfj9yaz7")))
+        (hash (base32 "1j35yf1nilb9z7lw8w2drpww7q2zy8zfr0ip8hwcbcd7c5d9chai")))
    (make-linux-libre-source version
                             (%upstream-linux-source version hash)
                             deblob-scripts-5.4)))
 
    (make-linux-libre-source version
                             (%upstream-linux-source version hash)
                             deblob-scripts-5.4)))
 
-(define-public linux-libre-4.19-version "4.19.120")
+(define-public linux-libre-4.19-version "4.19.121")
 (define-public linux-libre-4.19-pristine-source
   (let ((version linux-libre-4.19-version)
 (define-public linux-libre-4.19-pristine-source
   (let ((version linux-libre-4.19-version)
-        (hash (base32 "03mjng5ws9y56id99619ysarz73qqyylgc3mlknga1yphbhh16qb")))
+        (hash (base32 "11bhjdaihhc42xhf4qxdkkjznc0i6igh0ahjbzr3fb8bmq9sirgv")))
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.19)))
 
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.19)))
 
-(define-public linux-libre-4.14-version "4.14.178")
+(define-public linux-libre-4.14-version "4.14.179")
 (define-public linux-libre-4.14-pristine-source
   (let ((version linux-libre-4.14-version)
 (define-public linux-libre-4.14-pristine-source
   (let ((version linux-libre-4.14-version)
-        (hash (base32 "1pcqxmq9ir4f963aiw5bab9w2mp4vfiwaq2bk7nksbl2bs3k6b7x")))
+        (hash (base32 "10arrj3ppbxkn15yxqpxlz4k8yp2afzbfpp2nwfy6klhjiffp9sx")))
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.14)))
 
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.14)))
 
-(define-public linux-libre-4.9-version "4.9.221")
+(define-public linux-libre-4.9-version "4.9.222")
 (define-public linux-libre-4.9-pristine-source
   (let ((version linux-libre-4.9-version)
 (define-public linux-libre-4.9-pristine-source
   (let ((version linux-libre-4.9-version)
-        (hash (base32 "1gh1x73xblxkb927igc3shrqnn49lcscwrq2fixmk9n7jb7q2hp6")))
+        (hash (base32 "0aajgflf96bj7chbd83rdmgcdwd025c6mz6li4cwbfx7xcb91kjc")))
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.9)))
 
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.9)))
 
-(define-public linux-libre-4.4-version "4.4.221")
+(define-public linux-libre-4.4-version "4.4.222")
 (define-public linux-libre-4.4-pristine-source
   (let ((version linux-libre-4.4-version)
 (define-public linux-libre-4.4-pristine-source
   (let ((version linux-libre-4.4-version)
-        (hash (base32 "06rpjnvrdp71flz948mfmx7jv8x2vmdg54zz1xpkb2458mwh5hbq")))
+        (hash (base32 "02zxy5vjxgrqs0mkz5aj70v6pazhif7x5cm26rf8zh4idpmhk2zh")))
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.4)))
     (make-linux-libre-source version
                              (%upstream-linux-source version hash)
                              deblob-scripts-4.4)))
@@ -579,11 +579,11 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
 
 ;; The following package is used in the early bootstrap, and thus must be kept
 ;; stable and with minimal build requirements.
 
 ;; The following package is used in the early bootstrap, and thus must be kept
 ;; stable and with minimal build requirements.
-(define-public linux-libre-headers-4.19.56
-  (make-linux-libre-headers "4.19.56"
-                            "1zqiic55viy065lhnkmhn33sz3bbbr2ykbm5f92yzd8lpc9zl7yx"))
+(define-public linux-libre-headers-5.4.20
+  (make-linux-libre-headers "5.4.20"
+                            "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
 
 
-(define-public linux-libre-headers linux-libre-headers-4.19.56)
+(define-public linux-libre-headers linux-libre-headers-5.4.20)
 
 \f
 ;;;
 
 \f
 ;;;
@@ -711,27 +711,6 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration."
              #t))
          (replace 'configure
            (lambda* (#:key inputs native-inputs target #:allow-other-keys)
              #t))
          (replace 'configure
            (lambda* (#:key inputs native-inputs target #:allow-other-keys)
-             ;; On AArch64 (at least), we need to remove glibc headers from
-             ;; CPATH (they are still available as "system headers"), so that
-             ;; the kernel can override uint64_t.  See
-             ;; <https://bugs.gnu.org/37593>. This is also true when
-             ;; cross-compiling, except in that case, cross-libc must be
-             ;; removed from CROSS_CPATH.
-             (let ((var ,(if (%current-target-system)
-                             "CROSS_CPATH"
-                             "CPATH"))
-                   (libc ,(if (%current-target-system)
-                              "cross-libc"
-                              "libc")))
-               (setenv var
-                       (string-join
-                        (remove
-                         (cut string-prefix? (assoc-ref inputs libc) <>)
-                         (string-split (getenv var) #\:))
-                        ":"))
-               (format #t "environment variable `~a' changed to `~a'~%"
-                       var (getenv var)))
-
              ;; Avoid introducing timestamps
              (setenv "KCONFIG_NOTIMESTAMP" "1")
              (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
              ;; Avoid introducing timestamps
              (setenv "KCONFIG_NOTIMESTAMP" "1")
              (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
@@ -965,51 +944,47 @@ It has been modified to remove all non-free binary blobs.")
 ;;;
 
 (define-public acpi-call-linux-module
 ;;;
 
 (define-public acpi-call-linux-module
-  (package
-    (name "acpi-call-linux-module")
-    (version "3.17")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/teleshoes/acpi_call.git")
-             (commit version)))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
-    (build-system linux-module-build-system)
-    (arguments
-     `(#:tests? #f                      ; no tests
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-for-linux-4.12
-           (lambda _
-             (substitute* "acpi_call.c"
-               (("asm/uaccess\\.h")
-                "linux/uaccess.h"))
-             #t))
-         (add-after 'install 'install-documentation
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (doc (string-append out "/share/doc/" ,name "-" ,version)))
-               (for-each (lambda (file)
-                           (let ((target (string-append doc "/" file)))
-                             (mkdir-p (dirname target))
-                             (copy-recursively file target)))
-                         (list "README.md" "examples"))
-               #t))))))
-    (home-page "https://github.com/teleshoes/acpi_call")
-    (synopsis "Linux kernel module to perform ACPI method calls")
-    (description
-     "This simple Linux kernel module allows calls from user space to any
+  (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
+        (revision "0"))
+    (package
+      (name "acpi-call-linux-module")
+      (version (git-version "3.17" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/teleshoes/acpi_call.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
+      (build-system linux-module-build-system)
+      (arguments
+       `(#:tests? #f                    ; no tests
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'install 'install-documentation
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (doc (string-append out "/share/doc/" ,name "-" ,version)))
+                 (for-each (lambda (file)
+                             (let ((target (string-append doc "/" file)))
+                               (mkdir-p (dirname target))
+                               (copy-recursively file target)))
+                           (list "README.md" "examples"))
+                 #t))))))
+      (home-page "https://github.com/teleshoes/acpi_call")
+      (synopsis "Linux kernel module to perform ACPI method calls")
+      (description
+       "This simple Linux kernel module allows calls from user space to any
 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
 your computer's firmware, by writing to @file{/proc/acpi/call}.  You can pass
 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
 your computer's firmware, by writing to @file{/proc/acpi/call}.  You can pass
-any number of parameters of types @code{ACPI_INTEGER},  @code{ACPI_STRING},
+any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
 and @code{ACPI_BUFFER}.
 
 It grants direct and undocumented access to your hardware that may cause damage
 and should be used with caution, especially on untested models.")
 and @code{ACPI_BUFFER}.
 
 It grants direct and undocumented access to your hardware that may cause damage
 and should be used with caution, especially on untested models.")
-    (license license:gpl3+)))           ; see README.md (no licence headers)
+      (license license:gpl3+))))        ; see README.md (no licence headers)
 
 (define-public rtl8812au-aircrack-ng-linux-module
   (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
 
 (define-public rtl8812au-aircrack-ng-linux-module
   (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
@@ -1057,6 +1032,40 @@ and frame injection.  It provides a @code{88XXau} kernel module that supports
 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
       (license license:gpl2+))))
 
 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
       (license license:gpl2+))))
 
+(define-public rtl8821ce-linux-module
+  (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
+        (revision "0"))
+    (package
+      (name "rtl8821ce-linux-module")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/tomaspinho/rtl8821ce.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
+      (build-system linux-module-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (replace 'build
+             (lambda* (#:key (make-flags '()) inputs #:allow-other-keys)
+               (setenv "CC" "gcc")
+               (invoke "make"
+                       (string-append "KSRC="
+                                      (assoc-ref inputs "linux-module-builder")
+                                      "/lib/modules/build")))))
+         #:tests? #f))
+      (home-page "https://github.com/tomaspinho/rtl8821ce")
+      (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
+      (description "This is Realtek's RTL8821CE Linux driver for wireless
+network adapters.")
+      (license license:gpl2))))
+
 (define-public vhba-module
   (package
     (name "vhba-module")
 (define-public vhba-module
   (package
     (name "vhba-module")
@@ -1199,6 +1208,53 @@ at login.  Local and dynamic reconfiguration are its key features.")
 ;;; Miscellaneous.
 ;;;
 
 ;;; Miscellaneous.
 ;;;
 
+(define-public powerstat
+  (package
+    (name "powerstat")
+    (version "0.02.22")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
+                           "powerstat/powerstat-" version ".tar.gz"))
+       (sha256
+        (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (let* ((target ,(%current-target-system)))
+         (list (string-append "CC=" (if target
+                                        (string-append target "-gcc")
+                                        "gcc"))
+               (string-append "prefix=" (assoc-ref %outputs "out"))))
+       #:tests? #f                      ; no test suite
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'respect-$prefix
+           ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
+           (lambda _
+             (substitute* "Makefile"
+               (("DIR=/usr/") "DIR=$(prefix)/"))
+             #t))
+         (delete 'configure))))         ; no configure script
+    (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
+    (synopsis "Measure system power consumption")
+    (description
+     "Powerstat measures and reports your computer's power consumption in real
+time.  On mobile PCs, it uses ACPI battery information to measure the power
+drain of the entire system.
+
+Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
+domain measurements.  These are available only on some hardware such as Intel
+Sandybridge and newer, and cover only part of the machine's components such as
+CPU, DRAM, and graphics.  However, they provide accurate and immediate readings
+and don't require a battery at all.
+
+The output is like @command{vmstat} but also shows power consumption statistics:
+at the end of a run, @command{powerstat} will calculate the average, standard
+deviation, and minimum and maximum values.  It can show a nice histogram too.")
+    (license license:gpl2)))
+
 (define-public psmisc
   (package
     (name "psmisc")
 (define-public psmisc
   (package
     (name "psmisc")
@@ -1230,7 +1286,7 @@ providing the system administrator with some help in common tasks.")
 (define-public util-linux
   (package
     (name "util-linux")
 (define-public util-linux
   (package
     (name "util-linux")
-    (version "2.34")
+    (version "2.35.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://kernel.org/linux/utils/"
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://kernel.org/linux/utils/"
@@ -1238,7 +1294,7 @@ providing the system administrator with some help in common tasks.")
                                   "util-linux-" version ".tar.xz"))
               (sha256
                (base32
                                   "util-linux-" version ".tar.xz"))
               (sha256
                (base32
-                "1db2kydkwjmvgd1glkcba3adhidxw0f1x735dcjdpdjjf869sgvl"))
+                "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
               (patches (search-patches "util-linux-tests.patch"))
               (modules '((guix build utils)))
               (snippet
               (patches (search-patches "util-linux-tests.patch"))
               (modules '((guix build utils)))
               (snippet
@@ -1251,19 +1307,33 @@ providing the system administrator with some help in common tasks.")
                     (("build_kill=yes") "build_kill=no"))
                   #t))))
     (build-system gnu-build-system)
                     (("build_kill=yes") "build_kill=no"))
                   #t))))
     (build-system gnu-build-system)
-    (outputs '("out"
-               "static"))               ;>2 MiB of static .a libraries
+    (outputs '("out"            ;6.4 MiB executables and documentation
+               "lib"            ;8.8 MiB shared libraries, headers and locales
+               "static"))       ;2.9 MiB static .a libraries
     (arguments
      `(#:configure-flags (list "--disable-use-tty-group"
                                "--enable-fs-paths-default=/run/current-system/profile/sbin"
                                ;; Don't try to chown root:root mount and umount
                                "--disable-makeinstall-chown"
     (arguments
      `(#:configure-flags (list "--disable-use-tty-group"
                                "--enable-fs-paths-default=/run/current-system/profile/sbin"
                                ;; Don't try to chown root:root mount and umount
                                "--disable-makeinstall-chown"
+                               "--localstatedir=/var"
+                               (string-append "--localedir="
+                                              (assoc-ref %outputs "lib")
+                                              "/share/locale")
                                ;; Install completions where our
                                ;; bash-completion package expects them.
                                (string-append "--with-bashcompletiondir="
                                               (assoc-ref %outputs "out")
                                               "/etc/bash_completion.d"))
        #:phases (modify-phases %standard-phases
                                ;; Install completions where our
                                ;; bash-completion package expects them.
                                (string-append "--with-bashcompletiondir="
                                               (assoc-ref %outputs "out")
                                               "/etc/bash_completion.d"))
        #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'patch-build-scripts
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (substitute* "configure"
+                        ;; The build system assumes that we want to install
+                        ;; libraries below $exec_prefix when $libdir does not
+                        ;; match any of the "usual" locations.  Fix that.
+                        (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
+                         "usrlib_execdir=$libdir"))
+                      #t))
                   (add-before 'build 'set-umount-file-name
                     (lambda* (#:key outputs #:allow-other-keys)
                       ;; Tell 'eject' the right file name of 'umount'.
                   (add-before 'build 'set-umount-file-name
                     (lambda* (#:key outputs #:allow-other-keys)
                       ;; Tell 'eject' the right file name of 'umount'.
@@ -1280,13 +1350,34 @@ providing the system administrator with some help in common tasks.")
                         (substitute* "tests/ts/misc/mcookie"
                           (("/etc/services")
                            (string-append net "/etc/services")))
                         (substitute* "tests/ts/misc/mcookie"
                           (("/etc/services")
                            (string-append net "/etc/services")))
+
+                        ;; The C.UTF-8 locale does not exist in our libc.
+                        (substitute* "tests/ts/column/invalid-multibyte"
+                          (("C\\.UTF-8") "en_US.utf8"))
                         #t)))
                         #t)))
+                  ;; TODO: Remove the conditional on the next rebuild cycle.
+                  ,@(if (string-prefix? "arm" (%current-system))
+                        '((add-before 'check 'disable-setarch-test
+                            (lambda _
+                              ;; The setarch tests are unreliable in QEMU's
+                              ;; user-mode emulation, which is our primary
+                              ;; method of building ARMv7 packages.
+                              ;; <https://github.com/karelzak/util-linux/issues/601>
+                              (substitute* "tests/ts/misc/setarch"
+                                (("ts_init_subtest.*" all)
+                                 (string-append
+                                  all "\n"
+                                  "ts_skip \"setarch tests are unreliable under QEMU\"")))
+                              #t)))
+                        '())
                   (add-after 'install 'move-static-libraries
                     (lambda* (#:key outputs #:allow-other-keys)
                   (add-after 'install 'move-static-libraries
                     (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((out    (assoc-ref outputs "out"))
+                      (let ((lib    (assoc-ref outputs "lib"))
                             (static (assoc-ref outputs "static")))
                             (static (assoc-ref outputs "static")))
+
+                        ;; Move static libraries to the "static" output.
                         (mkdir-p (string-append static "/lib"))
                         (mkdir-p (string-append static "/lib"))
-                        (with-directory-excursion out
+                        (with-directory-excursion lib
                           (for-each (lambda (file)
                                       (rename-file file
                                                    (string-append static "/"
                           (for-each (lambda (file)
                                       (rename-file file
                                                    (string-append static "/"
@@ -1299,7 +1390,16 @@ providing the system administrator with some help in common tasks.")
                           (substitute* (find-files "lib" "\\.la$")
                             (("old_library=.*") "old_library=''\n")))
 
                           (substitute* (find-files "lib" "\\.la$")
                             (("old_library=.*") "old_library=''\n")))
 
-                        #t))))))
+                        #t)))
+                  (add-after 'install 'adjust-pkg-config-files
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((lib (assoc-ref outputs "lib")))
+                        ;; Drop the unused "prefix=" and "exec_prefix=" variables from
+                        ;; the pkg-config files to avoid a cyclic reference on "out".
+                        (substitute* (find-files (string-append lib "/lib/pkgconfig")
+                                                 "\\.pc$")
+                          (("^(exec_)?prefix=.*") "")))
+                        #t)))))
     (inputs `(("zlib" ,zlib)
               ("ncurses" ,ncurses)
 
     (inputs `(("zlib" ,zlib)
               ("ncurses" ,ncurses)
 
@@ -1423,10 +1523,16 @@ parameters.")
                 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
     (build-system gnu-build-system)
     (arguments
                 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:modules ((guix build utils)
+     `(#:modules ((guix build utils)
                   (guix build gnu-build-system)
                   (srfi srfi-1)
                   (srfi srfi-26))
                   (guix build gnu-build-system)
                   (srfi srfi-1)
                   (srfi srfi-26))
+       ,@(if (%current-target-system)
+             '(#:configure-flags
+               (list
+                "ac_cv_func_malloc_0_nonnull=yes"
+                "ac_cv_func_realloc_0_nonnull=yes"))
+             '())
        #:phases
        (modify-phases %standard-phases
          (add-after
        #:phases
        (modify-phases %standard-phases
          (add-after
@@ -1516,7 +1622,7 @@ slabtop, and skill.")
               (base32
                "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
     (build-system gnu-build-system)
               (base32
                "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
     (build-system gnu-build-system)
-    (inputs `(("util-linux" ,util-linux)))
+    (inputs `(("util-linux" ,util-linux "lib")))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("texinfo" ,texinfo)       ;for the libext2fs Info manual
 
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("texinfo" ,texinfo)       ;for the libext2fs Info manual
 
@@ -1800,12 +1906,13 @@ MIDI functionality to the Linux-based operating system.")
                (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
                 "true\n"))
              #t)))))
                (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
                 "true\n"))
              #t)))))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)))
     (inputs
      `(("libsamplerate" ,libsamplerate)
        ("ncurses" ,ncurses)
        ("alsa-lib" ,alsa-lib)
     (inputs
      `(("libsamplerate" ,libsamplerate)
        ("ncurses" ,ncurses)
        ("alsa-lib" ,alsa-lib)
-       ("xmlto" ,xmlto)
-       ("gettext" ,gettext-minimal)))
+       ("xmlto" ,xmlto)))
     (home-page "http://www.alsa-project.org/")
     (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
     (description
     (home-page "http://www.alsa-project.org/")
     (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
     (description
@@ -2092,6 +2199,7 @@ inadequately in modern network environments, and both should be deprecated.")
                               (string-append "mandir=/share/man")))))
       (native-inputs `(("gettext" ,gettext-minimal)
                        ("unzip" ,unzip)))
                               (string-append "mandir=/share/man")))))
       (native-inputs `(("gettext" ,gettext-minimal)
                        ("unzip" ,unzip)))
+      (supported-systems (delete "i586-gnu" %supported-systems))
       (synopsis "Tools for controlling the network subsystem in Linux")
       (description
        "This package includes the important tools for controlling the network
       (synopsis "Tools for controlling the network subsystem in Linux")
       (description
        "This package includes the important tools for controlling the network
@@ -2104,7 +2212,7 @@ configuration (iptunnel, ipmaddr).")
 (define-public libcap
   (package
     (name "libcap")
 (define-public libcap
   (package
     (name "libcap")
-    (version "2.27")
+    (version "2.31")
     (source (origin
              (method url-fetch)
              (uri (string-append
     (source (origin
              (method url-fetch)
              (uri (string-append
@@ -2112,7 +2220,7 @@ configuration (iptunnel, ipmaddr).")
                    "libcap2/libcap-" version ".tar.xz"))
              (sha256
               (base32
                    "libcap2/libcap-" version ".tar.xz"))
              (sha256
               (base32
-               "0sj8kidl7qgf2qwxcbw1vadnlb30y4zvjzxswsmfdghq04npkhfs"))))
+               "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
     (build-system gnu-build-system)
     (arguments '(#:phases
                  (modify-phases %standard-phases
     (build-system gnu-build-system)
     (arguments '(#:phases
                  (modify-phases %standard-phases
@@ -2124,13 +2232,13 @@ configuration (iptunnel, ipmaddr).")
                                  (string-append "LDFLAGS := -Wl,-rpath="
                                                 %output "/lib")))
                               #t)))
                                  (string-append "LDFLAGS := -Wl,-rpath="
                                                 %output "/lib")))
                               #t)))
-                 #:tests? #f                      ; no 'check' target
+                 #:test-target "test"
                  #:make-flags (list "lib=lib"
                                     (string-append "prefix="
                                                    (assoc-ref %outputs "out"))
                                     "RAISE_SETFCAP=no")))
     (native-inputs `(("perl" ,perl)))
                  #:make-flags (list "lib=lib"
                                     (string-append "prefix="
                                                    (assoc-ref %outputs "out"))
                                     "RAISE_SETFCAP=no")))
     (native-inputs `(("perl" ,perl)))
-    (inputs `(("attr" ,attr)))
+    (supported-systems (delete "i586-gnu" %supported-systems))
     (home-page "https://sites.google.com/site/fullycapable/")
     (synopsis "Library for working with POSIX capabilities")
     (description
     (home-page "https://sites.google.com/site/fullycapable/")
     (synopsis "Library for working with POSIX capabilities")
     (description
@@ -2140,6 +2248,21 @@ Linux-based operating systems.")
     ;; License is BSD-3 or GPLv2, at the user's choice.
     (license license:gpl2)))
 
     ;; License is BSD-3 or GPLv2, at the user's choice.
     (license license:gpl2)))
 
+;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
+;; To be merged with libcap on the next rebuild cycle.
+(define-public libcap/next
+  (package
+    (inherit libcap)
+    (version "2.34")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://kernel.org/linux/libs/security/linux-privs/"
+                    "libcap2/libcap-" version ".tar.xz"))
+              (sha256
+               (base32
+                "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
+
 (define-public bridge-utils
   (package
     (name "bridge-utils")
 (define-public bridge-utils
   (package
     (name "bridge-utils")
@@ -2213,35 +2336,18 @@ transparently through a bridge.")
                  "/libnl-doc-" version ".tar.gz"))
            (sha256
             (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
                  "/libnl-doc-" version ".tar.gz"))
            (sha256
             (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
-    (inputs
-     `(("python-2" ,python-2)
-       ("python-3" ,python-3)))
-    (outputs '("out" "doc" "python2" "python3"))
+    (outputs `("out" "doc"))
     (arguments
     (arguments
-     `(#:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (srfi srfi-1))
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
        (modify-phases %standard-phases
-         (add-after 'install 'install-python
-           (lambda* (#:key outputs #:allow-other-keys)
-             (define (python-inst python)
-               (invoke python "setup.py" "build")
-               (invoke python "setup.py" "install"
-                       (string-append "--prefix="
-                                      (assoc-ref %outputs python)))
-               (invoke python "setup.py" "clean"))
-             (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
-                                       (assoc-ref %outputs "out")))
-             (with-directory-excursion "./python"
-               (for-each python-inst '("python2" "python3")))
-             #t))
          (add-after 'install 'install-doc
          (add-after 'install 'install-doc
-           (lambda* (#:key inputs outputs #:allow-other-keys)
+           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
              (let ((dest (string-append (assoc-ref outputs "doc")
                                         "/share/doc/libnl")))
                (mkdir-p dest)
              (let ((dest (string-append (assoc-ref outputs "doc")
                                         "/share/doc/libnl")))
                (mkdir-p dest)
-               (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
+               (invoke "tar" "xf" (assoc-ref
+                                   (or native-inputs inputs)
+                                   "libnl3-doc")
                        "--strip-components=1" "-C" dest)))))))
     (home-page "https://www.infradead.org/~tgr/libnl/")
     (synopsis "NetLink protocol library suite")
                        "--strip-components=1" "-C" dest)))))))
     (home-page "https://www.infradead.org/~tgr/libnl/")
     (synopsis "NetLink protocol library suite")
@@ -2256,6 +2362,43 @@ configuration and monitoring interfaces.")
     ;; 'nl-addr-add.c'), so the result is GPLv2-only.
     (license license:gpl2)))
 
     ;; 'nl-addr-add.c'), so the result is GPLv2-only.
     (license license:gpl2)))
 
+;; libnl python extensions used to be outputs of libnl. However, as
+;; cross-compiling python extensions is currently broken, create separate
+;; packages for libnl python extensions.
+(define (libnl-python-package python)
+  (let ((name (string-append "libnl-" python)))
+    (package
+      (inherit libnl)
+      (name name)
+      (inputs `(,@(cond
+                   ((string=? python "python2")
+                    `(("python-2" ,python-2)))
+                   ((string=? python "python3")
+                    `(("python-3" ,python-3))))))
+      (propagated-inputs `(("libnl" ,libnl)))
+      (outputs '("out"))
+      (arguments
+       `(#:modules ((guix build gnu-build-system)
+                    (guix build utils)
+                    (srfi srfi-1))
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (define (python-inst python)
+                 (invoke python "setup.py" "build")
+                 (invoke python "setup.py" "install"
+                         (string-append "--prefix="
+                                        (assoc-ref %outputs "out")))
+                 (invoke python "setup.py" "clean"))
+               (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
+                                         (assoc-ref inputs "libnl")))
+               (with-directory-excursion "./python" (python-inst ,python))
+               #t))))))))
+
+(define-public libnl-python2 (libnl-python-package "python2"))
+(define-public libnl-python3 (libnl-python-package "python3"))
+
 (define-public iw
   (package
     (name "iw")
 (define-public iw
   (package
     (name "iw")
@@ -2295,14 +2438,14 @@ devices.  It replaces @code{iwconfig}, which is deprecated.")
 (define-public powertop
   (package
     (name "powertop")
 (define-public powertop
   (package
     (name "powertop")
-    (version "2.11")
+    (version "2.12")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://01.org/sites/default/files/downloads/"
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://01.org/sites/default/files/downloads/"
-                           "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
+                           "powertop-" version ".tar.gz"))
        (sha256
        (sha256
-        (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
+        (base32 "1kiiwa5p2r7h1lzcf53xq61ckaa4wk565s9fs6vw4bfk84y3mfsw"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases
     (build-system gnu-build-system)
     (arguments
      '(#:phases
@@ -2442,6 +2585,7 @@ processes currently causing I/O.")
                (("-DFUSERMOUNT_DIR=[[:graph:]]+")
                 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
              #t)))))
                (("-DFUSERMOUNT_DIR=[[:graph:]]+")
                 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
              #t)))))
+    (supported-systems (delete "i586-gnu" %supported-systems))
     (home-page "https://github.com/libfuse/libfuse")
     (synopsis "Support file systems implemented in user space")
     (description
     (home-page "https://github.com/libfuse/libfuse")
     (synopsis "Support file systems implemented in user space")
     (description
@@ -2824,6 +2968,7 @@ to use Linux' inotify mechanism, which allows file accesses to be monitored.")
                          '("insmod" "rmmod" "lsmod" "modprobe"
                            "modinfo" "depmod"))
                #t))))))
                          '("insmod" "rmmod" "lsmod" "modprobe"
                            "modinfo" "depmod"))
                #t))))))
+    (supported-systems (delete "i586-gnu" %supported-systems))
     (home-page "https://www.kernel.org/")
     (synopsis "Kernel module tools")
     (description "Kmod is a set of tools to handle common tasks with Linux
     (home-page "https://www.kernel.org/")
     (synopsis "Kernel module tools")
     (description "Kmod is a set of tools to handle common tasks with Linux
@@ -2895,7 +3040,7 @@ to the in-kernel OOM killer.")
               (patches (search-patches "eudev-rules-directory.patch"))))
     (build-system gnu-build-system)
     (arguments
               (patches (search-patches "eudev-rules-directory.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'make-source-writable
            (lambda _
        (modify-phases %standard-phases
          (add-after 'unpack 'make-source-writable
            (lambda _
@@ -2904,12 +3049,23 @@ to the in-kernel OOM killer.")
              (for-each make-file-writable (find-files "."))
              #t))
          (add-before 'bootstrap 'patch-file-names
              (for-each make-file-writable (find-files "."))
              #t))
          (add-before 'bootstrap 'patch-file-names
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key inputs native-inputs #:allow-other-keys)
             (substitute* "man/make.sh"
               (("/usr/bin/xsltproc")
             (substitute* "man/make.sh"
               (("/usr/bin/xsltproc")
-                (string-append (assoc-ref inputs "xsltproc")
+               (string-append (assoc-ref
+                               (or native-inputs inputs) "xsltproc")
                                "/bin/xsltproc")))
             #t))
                                "/bin/xsltproc")))
             #t))
+         (add-before 'configure 'patch-bindir-in-btrfs-rules
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; The "@bindir@" substitution incorrectly expands to a literal
+             ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>).  Work
+             ;; around it.
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "rules/64-btrfs.rules.in"
+                 (("@bindir@")
+                  (string-append out "/bin")))
+               #t)))
          (add-after 'install 'move-static-library
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
          (add-after 'install 'move-static-library
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -2929,9 +3085,14 @@ to the in-kernel OOM killer.")
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
              ;; similar tools to display product names.
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
              ;; similar tools to display product names.
+             ;;
+             ;; XXX: This can't be done when cross-compiling. Find another way
+             ;; to generate hwdb.bin for cross-built systems.
              (let ((out (assoc-ref outputs "out")))
              (let ((out (assoc-ref outputs "out")))
-               (invoke (string-append out "/bin/udevadm")
-                       "hwdb" "--update")))))
+               ,@(if (%current-target-system)
+                     '(#t)
+                     '((invoke (string-append out "/bin/udevadm")
+                               "hwdb" "--update")))))))
        #:configure-flags (list "--enable-manpages")))
     (native-inputs
      `(("autoconf" ,autoconf)
        #:configure-flags (list "--enable-manpages")))
     (native-inputs
      `(("autoconf" ,autoconf)
@@ -2951,7 +3112,7 @@ to the in-kernel OOM killer.")
      ;; When linked against libblkid, eudev can populate /dev/disk/by-label
      ;; and similar; it also installs the '60-persistent-storage.rules' file,
      ;; which contains the rules to do that.
      ;; When linked against libblkid, eudev can populate /dev/disk/by-label
      ;; and similar; it also installs the '60-persistent-storage.rules' file,
      ;; which contains the rules to do that.
-     `(("util-linux" ,util-linux)                 ;for blkid
+     `(("util-linux" ,util-linux "lib")           ;for blkid
        ("kmod" ,kmod)))
     (outputs '("out" "static"))
     (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
        ("kmod" ,kmod)))
     (outputs '("out" "static"))
     (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
@@ -2961,26 +3122,6 @@ device nodes from /dev/, handles hotplug events and loads drivers at boot
 time.")
     (license license:gpl2+)))
 
 time.")
     (license license:gpl2+)))
 
-;; TODO: Merge with eudev on the next rebuild cycle.
-(define-public eudev/btrfs-fix
-  (package/inherit
-   eudev
-   (version (string-append (package-version eudev) "-1"))
-   (arguments
-    (substitute-keyword-arguments (package-arguments eudev)
-      ((#:phases phases '%standard-phases)
-       `(modify-phases ,phases
-          (add-before 'configure 'patch-bindir-in-btrfs-rules
-            (lambda* (#:key outputs #:allow-other-keys)
-              ;; The "@bindir@" substitution incorrectly expands to a literal
-              ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>).  Work
-              ;; around it.
-              (let ((out (assoc-ref outputs "out")))
-                (substitute* "rules/64-btrfs.rules.in"
-                  (("@bindir@")
-                   (string-append out "/bin")))
-                #t)))))))))
-
 (define-public python-evdev
   (package
     (name "python-evdev")
 (define-public python-evdev
   (package
     (name "python-evdev")
@@ -3052,7 +3193,7 @@ devices that can inject events directly into the input subsystem.")
      `(("libaio" ,libaio)
        ("udev" ,eudev)))
     (arguments
      `(("libaio" ,libaio)
        ("udev" ,eudev)))
     (arguments
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'configure 'set-makefile-shell
            (lambda _
        (modify-phases %standard-phases
          (add-after 'configure 'set-makefile-shell
            (lambda _
@@ -3079,10 +3220,16 @@ devices that can inject events directly into the input subsystem.")
                                               (assoc-ref %outputs "out")
                                               "/lib,-rpath="
                                               (assoc-ref %outputs "out")
                                               (assoc-ref %outputs "out")
                                               "/lib,-rpath="
                                               (assoc-ref %outputs "out")
-                                              "/lib/device-mapper"))
+                                              "/lib/device-mapper")
+                               ;; This is needed when cross-compiling.
+                               ,@(if (%current-target-system)
+                                     '("ac_cv_func_malloc_0_nonnull=yes"
+                                       "ac_cv_func_realloc_0_nonnull=yes")
+                                     '()))
 
        ;; The tests use 'mknod', which requires root access.
        #:tests? #f))
 
        ;; The tests use 'mknod', which requires root access.
        #:tests? #f))
+    (supported-systems (delete "i586-gnu" %supported-systems))
     (home-page "https://sourceware.org/lvm2/")
     (synopsis "Logical volume management for Linux")
     (description
     (home-page "https://sourceware.org/lvm2/")
     (synopsis "Logical volume management for Linux")
     (description
@@ -3193,13 +3340,23 @@ interface.")
               (patches (search-patches "crda-optional-gcrypt.patch"))))
     (build-system gnu-build-system)
     (arguments
               (patches (search-patches "crda-optional-gcrypt.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
+     `(#:phases (modify-phases %standard-phases
                   (delete 'configure)
                   (add-after 'unpack 'gzip-determinism
                     (lambda _
                       (substitute* "Makefile"
                         (("gzip") "gzip --no-name"))
                       #t))
                   (delete 'configure)
                   (add-after 'unpack 'gzip-determinism
                     (lambda _
                       (substitute* "Makefile"
                         (("gzip") "gzip --no-name"))
                       #t))
+                  ,@(if (%current-target-system)
+                        '((add-after
+                            'unpack 'fix-pkg-config
+                            (lambda* (#:key target #:allow-other-keys)
+                                     (substitute*
+                                       "Makefile"
+                                       (("pkg-config")
+                                        (string-append target "-pkg-config")))
+                                     #t)))
+                        '())
                   (add-before
                    'build 'no-werror-no-ldconfig
                    (lambda _
                   (add-before
                    'build 'no-werror-no-ldconfig
                    (lambda _
@@ -3209,37 +3366,44 @@ interface.")
                      #t))
                   (add-before
                    'build 'set-regulator-db-file-name
                      #t))
                   (add-before
                    'build 'set-regulator-db-file-name
-                   (lambda* (#:key inputs #:allow-other-keys)
+                   (lambda* (#:key native-inputs inputs #:allow-other-keys)
                      ;; Tell CRDA where to find our database.
                      ;; Tell CRDA where to find our database.
-                     (let ((regdb (assoc-ref inputs "wireless-regdb")))
+                     (let ((regdb (assoc-ref (or native-inputs inputs)
+                                             "wireless-regdb")))
                        (substitute* "crda.c"
                          (("\"/lib/crda/regulatory.bin\"")
                           (string-append "\"" regdb
                                          "/lib/crda/regulatory.bin\"")))
                        #t))))
        #:test-target "verify"
                        (substitute* "crda.c"
                          (("\"/lib/crda/regulatory.bin\"")
                           (string-append "\"" regdb
                                          "/lib/crda/regulatory.bin\"")))
                        #t))))
        #:test-target "verify"
-       #:make-flags (let ((out   (assoc-ref %outputs "out"))
-                          (regdb (assoc-ref %build-inputs "wireless-regdb")))
-                      (list "CC=gcc" "V=1"
-
-                            ;; Disable signature-checking on 'regulatory.bin'.
-                            ;; The reason is that this simplifies maintenance
-                            ;; on our side (no need to manage a distro key
-                            ;; pair), and we can guarantee integrity of
-                            ;; 'regulatory.bin' by other means anyway, such as
-                            ;; 'guix gc --verify'.  See
-                            ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
-                            ;; for a discssion.
-                            "USE_OPENSSL=0"
-
-                            (string-append "PREFIX=" out)
-                            (string-append "SBINDIR=" out "/sbin/")
-                            (string-append "UDEV_RULE_DIR="
-                                           out "/lib/udev/rules.d")
-                            (string-append "LDFLAGS=-Wl,-rpath="
-                                           out "/lib -L.")
-                            (string-append "REG_BIN=" regdb
-                                           "/lib/crda/regulatory.bin")))))
+       #:make-flags (let ((out     (assoc-ref %outputs "out"))
+                          (regdb   (assoc-ref %build-inputs "wireless-regdb"))
+                          (target ,(%current-target-system)))
+                      (list
+                       (string-append
+                        "CC=" (if target
+                                  (string-append target "-gcc") "gcc"))
+                       "V=1"
+
+                       ;; Disable signature-checking on 'regulatory.bin'.
+                       ;; The reason is that this simplifies maintenance
+                       ;; on our side (no need to manage a distro key
+                       ;; pair), and we can guarantee integrity of
+                       ;; 'regulatory.bin' by other means anyway, such as
+                       ;; 'guix gc --verify'.  See
+                       ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
+                       ;; for a discssion.
+                       "USE_OPENSSL=0"
+
+                       (string-append "PREFIX=" out)
+                       (string-append "SBINDIR=" out "/sbin/")
+                       (string-append "UDEV_RULE_DIR="
+                                      out "/lib/udev/rules.d")
+                       (string-append "LDFLAGS=-Wl,-rpath="
+                                      out "/lib -L.")
+                       (string-append "REG_BIN=" regdb
+                                      "/lib/crda/regulatory.bin")
+                       "all_noverify"))))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("wireless-regdb" ,wireless-regdb)))
     (inputs `(("libnl" ,libnl)))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("wireless-regdb" ,wireless-regdb)))
     (inputs `(("libnl" ,libnl)))
@@ -3960,8 +4124,9 @@ MPEG-2 and audio over Linux IEEE 1394.")
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'patch-program-paths
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'patch-program-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((coreutils (assoc-ref inputs "coreutils")))
+           (lambda* (#:key native-inputs inputs #:allow-other-keys)
+             (let ((coreutils (assoc-ref (or native-inputs inputs)
+                                         "coreutils")))
                (substitute* "udev-md-raid-arrays.rules"
                  (("/usr/bin/(readlink|basename)" all program)
                   (string-append coreutils "/bin/" program))))
                (substitute* "udev-md-raid-arrays.rules"
                  (("/usr/bin/(readlink|basename)" all program)
                   (string-append coreutils "/bin/" program))))
@@ -3976,6 +4141,7 @@ MPEG-2 and audio over Linux IEEE 1394.")
          (delete 'configure))
        ;;tests must be done as root
        #:tests? #f))
          (delete 'configure))
        ;;tests must be done as root
        #:tests? #f))
+    (supported-systems (delete "i586-gnu" %supported-systems))
     (home-page "http://neil.brown.name/blog/mdadm")
     (synopsis "Tool for managing Linux Software RAID arrays")
     (description
     (home-page "http://neil.brown.name/blog/mdadm")
     (synopsis "Tool for managing Linux Software RAID arrays")
     (description
@@ -4042,12 +4208,6 @@ arrays when needed.")
                           (string-append "DESTDIR="
                                          (assoc-ref %outputs "out"))
                           "SYSTEMDPATH=lib"
                           (string-append "DESTDIR="
                                          (assoc-ref %outputs "out"))
                           "SYSTEMDPATH=lib"
-                          ;; Add the libaio headers to GCCs system header
-                          ;; search path to suppress -Werror=cast-qual on
-                          ;; the included headers.
-                          (string-append "C_INCLUDE_PATH="
-                                         (assoc-ref %build-inputs "libaio")
-                                         "/include")
                           (string-append "LDFLAGS=-Wl,-rpath="
                                          (assoc-ref %outputs "out")
                                          "/lib"))
                           (string-append "LDFLAGS=-Wl,-rpath="
                                          (assoc-ref %outputs "out")
                                          "/lib"))
@@ -4109,8 +4269,14 @@ Linux Device Mapper multipathing driver:
                 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
     (build-system gnu-build-system)
     (arguments
                 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:make-flags
-       (list "CC=gcc" (string-append "prefix=" %output))
+     `(#:make-flags
+       (let ((target ,(%current-target-system)))
+         (list (string-append "prefix=" %output)
+               (string-append
+                "CC=" (if target
+                          (string-append (assoc-ref %build-inputs "cross-gcc")
+                                         "/bin/" target "-gcc")
+                          "gcc"))))
        #:test-target "partcheck" ; need root for a full 'check'
        #:phases
        (modify-phases %standard-phases (delete 'configure)))) ; no configure script
        #:test-target "partcheck" ; need root for a full 'check'
        #:phases
        (modify-phases %standard-phases (delete 'configure)))) ; no configure script
@@ -4190,13 +4356,13 @@ Bluetooth audio output devices like headphones or loudspeakers.")
 (define-public bluez
   (package
     (name "bluez")
 (define-public bluez
   (package
     (name "bluez")
-    (replacement bluez/fixed)
     (version "5.53")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "mirror://kernel.org/linux/bluetooth/bluez-"
                     version ".tar.xz"))
     (version "5.53")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "mirror://kernel.org/linux/bluetooth/bluez-"
                     version ".tar.xz"))
+              (patches (search-patches "bluez-CVE-2020-0556.patch"))
               (sha256
                (base32
                 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
               (sha256
                (base32
                 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
@@ -4256,14 +4422,6 @@ Bluetooth audio output devices like headphones or loudspeakers.")
 is flexible, efficient and uses a modular implementation.")
     (license license:gpl2+)))
 
 is flexible, efficient and uses a modular implementation.")
     (license license:gpl2+)))
 
-(define bluez/fixed
-  (package
-    (inherit bluez)
-    (source (origin
-              (inherit (package-source bluez))
-              (patches (append (origin-patches (package-source bluez))
-                               (search-patches "bluez-CVE-2020-0556.patch")))))))
-
 (define-public fuse-exfat
   (package
     (name "fuse-exfat")
 (define-public fuse-exfat
   (package
     (name "fuse-exfat")
@@ -4404,11 +4562,9 @@ and copy/paste text in the console and in xterm.")
        #:test-target "test"
        #:parallel-tests? #f)) ; tests fail when run in parallel
     (inputs `(("e2fsprogs" ,e2fsprogs)  ; for btrfs-convert
        #:test-target "test"
        #:parallel-tests? #f)) ; tests fail when run in parallel
     (inputs `(("e2fsprogs" ,e2fsprogs)  ; for btrfs-convert
-              ("libblkid" ,util-linux)
-              ("libblkid:static" ,util-linux "static")
-              ("libuuid" ,util-linux)
-              ("libuuid:static" ,util-linux "static")
               ("lzo" ,lzo)
               ("lzo" ,lzo)
+              ("util-linux:lib" ,util-linux "lib")       ;for libblkid and libuuid
+              ("util-linux:static" ,util-linux "static") ;ditto
               ("zlib" ,zlib)
               ("zlib:static" ,zlib "static")
               ("zstd" ,zstd "lib")
               ("zlib" ,zlib)
               ("zlib:static" ,zlib "static")
               ("zstd" ,zstd "lib")
@@ -4574,7 +4730,7 @@ obviously it can be shared with files outside our set).")
        ("libtool" ,libtool)
        ("pkg-config" ,pkg-config)))
     (inputs
        ("libtool" ,libtool)
        ("pkg-config" ,pkg-config)))
     (inputs
-     `(("libuuid" ,util-linux)
+     `(("libuuid" ,util-linux "lib")
        ("libselinux" ,libselinux)))
     (home-page "https://f2fs.wiki.kernel.org/")
     (synopsis "Userland tools for f2fs")
        ("libselinux" ,libselinux)))
     (home-page "https://f2fs.wiki.kernel.org/")
     (synopsis "Userland tools for f2fs")
@@ -4600,7 +4756,7 @@ disks and SD cards.  This package provides the userland utilities.")
                (base32
                 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
     (inputs
                (base32
                 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
     (inputs
-     `(("libuuid" ,util-linux)))))
+     `(("libuuid" ,util-linux "lib")))))
 
 (define-public f2fs-tools/static
   (static-package
 
 (define-public f2fs-tools/static
   (static-package
@@ -4628,10 +4784,17 @@ disks and SD cards.  This package provides the userland utilities.")
              (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
              (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
              (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
              (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
              (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
              (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
-             #t)))))
+             #t))
+          (add-after 'install 'remove-store-references
+            (lambda* (#:key outputs #:allow-other-keys)
+              ;; Work around bug in our util-linux.
+              ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
+              (remove-store-references (string-append (assoc-ref outputs "out")
+                                                      "/sbin/mkfs.f2fs"))
+              #t)))))
      (inputs
       `(("libuuid:static" ,util-linux "static")
      (inputs
       `(("libuuid:static" ,util-linux "static")
-        ("libuuid" ,util-linux)))))) ; for include files
+        ("libuuid" ,util-linux "lib")))))) ; for include files
 
 (define-public f2fs-fsck/static
   (package
 
 (define-public f2fs-fsck/static
   (package
@@ -5332,7 +5495,7 @@ are exceeded.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("acl" ,acl)                     ; extended attributes (xattr)
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("acl" ,acl)                     ; extended attributes (xattr)
-       ("libuuid" ,util-linux)
+       ("libuuid" ,util-linux "lib")
        ("lzo" ,lzo)
        ("openssl" ,openssl)             ; optional crypto support
        ("zlib" ,zlib)
        ("lzo" ,lzo)
        ("openssl" ,openssl)             ; optional crypto support
        ("zlib" ,zlib)
@@ -5440,14 +5603,7 @@ under OpenGL graphics workloads.")
                           (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
        #:phases
        (modify-phases %standard-phases
                           (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before 'build 'kernel-headers-are-system-headers
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
-               ;; Make sure the kernel headers are treated as system headers
-               ;; to suppress a conflict between "util.h" and <linux/fs.h>.
-             (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
-             #t))))))
+         (delete 'configure))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
@@ -5480,12 +5636,7 @@ interface to the variable facility of UEFI boot firmware.")
                           ;; installed (known as OS_VENDOR in the code).
                           ;; GRUB overrides this, as such it's only used if
                           ;; nothing else is specified on the command line.
                           ;; installed (known as OS_VENDOR in the code).
                           ;; GRUB overrides this, as such it's only used if
                           ;; nothing else is specified on the command line.
-                          "EFIDIR=gnu"
-                          ;; Treat kernel headers as system headers to prevent
-                          ;; warnings about conflicting types.
-                          (string-append "C_INCLUDE_PATH="
-                                         (assoc-ref %build-inputs "kernel-headers")
-                                         "/include"))
+                          "EFIDIR=gnu")
        #:phases (modify-phases %standard-phases (delete 'configure))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
        #:phases (modify-phases %standard-phases (delete 'configure))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -6131,7 +6282,7 @@ libraries, which are often integrated directly into libfabric.")
                  "psm-disable-memory-stats.patch"))))
     (build-system gnu-build-system)
     (outputs '("out" "debug"))
                  "psm-disable-memory-stats.patch"))))
     (build-system gnu-build-system)
     (outputs '("out" "debug"))
-    (inputs `(("libuuid" ,util-linux)))
+    (inputs `(("libuuid" ,util-linux "lib")))
     (arguments
      '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
                       ,(string-append "INSTALL_PREFIX=" %output)
     (arguments
      '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
                       ,(string-append "INSTALL_PREFIX=" %output)
@@ -6508,7 +6659,7 @@ IP addresses and routes, and configure IPsec.")
     (native-inputs
      `(("gettext" ,gettext-minimal)))
     (inputs
     (native-inputs
      `(("gettext" ,gettext-minimal)))
     (inputs
-     `(("libuuid" ,util-linux)
+     `(("libuuid" ,util-linux "lib")
        ("python" ,python-wrapper)))
     (home-page "https://xfs.wiki.kernel.org/")
     (synopsis "XFS file system tools")
        ("python" ,python-wrapper)))
     (home-page "https://xfs.wiki.kernel.org/")
     (synopsis "XFS file system tools")
@@ -6606,13 +6757,21 @@ the superuser to make device nodes.")
             ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
             (substitute* "test/compare-tar"
              (("tar -tvf") "tar --numeric-owner -tvf"))
             ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
             (substitute* "test/compare-tar"
              (("tar -tvf") "tar --numeric-owner -tvf"))
+
+            ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
+            ;; of lstat().  fakeroot 1.24 does not support the former, so
+            ;; adjust these tests to use 'test -b' instead of 'ls' to test for
+            ;; block device.  See <https://bugs.gnu.org/41090>.
+            (substitute* '("test/t.mknod" "test/t.chmod_dev")
+              (("ls -ld? \\$tmp/hda3")
+               "test -b $tmp/hda3 && echo block || echo fail"))
             #t)))))
     (native-inputs
      `(("acl" ,acl)
        ("sharutils" ,sharutils) ; for the tests
        ("xz" ,xz))) ; for the tests
     (inputs
             #t)))))
     (native-inputs
      `(("acl" ,acl)
        ("sharutils" ,sharutils) ; for the tests
        ("xz" ,xz))) ; for the tests
     (inputs
-     `(("libcap" ,libcap)
+     `(("libcap" ,libcap/next)
        ("util-linux" ,util-linux)))
     (synopsis "Provides a fake root environment")
     (description "@command{fakeroot} runs a command in an environment where
        ("util-linux" ,util-linux)))
     (synopsis "Provides a fake root environment")
     (description "@command{fakeroot} runs a command in an environment where