You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

5184 lines
212 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
;;; 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 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2017 nee <nee-git@hidamari.blue>
;;; Copyright © 2017 Dave Love <fx@gnu.org>
;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
;;; Copyright © 2018 Brendan Tildesley <brendan.tildesley@openmailbox.org>
;;; Copyright © 2018 Manuel Graf <graf@init.at>
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages linux)
#:use-module (gnu packages)
#: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 base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages calendar)
#:use-module (gnu packages check)
#:use-module (gnu packages crypto)
#:use-module (gnu packages cryptsetup)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
#:use-module (gnu packages datastructures)
#:use-module (gnu packages docbook)
#:use-module (gnu packages documentation)
#:use-module (gnu packages elf)
#:use-module (gnu packages flex)
#:use-module (gnu packages file)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnuzilla)
#:use-module (gnu packages gperf)
#:use-module (gnu packages gtk)
#:use-module (gnu packages libunwind)
#:use-module (gnu packages libusb)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages netpbm)
#:use-module (gnu packages nettle)
#:use-module (gnu packages networking)
#:use-module (gnu packages ninja)
#:use-module (gnu packages perl)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages popt)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages python)
#:use-module (gnu packages readline)
#:use-module (gnu packages rrdtool)
#:use-module (gnu packages samba)
#:use-module (gnu packages serialization)
#:use-module (gnu packages slang)
#:use-module (gnu packages storage)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages tls)
#:use-module (gnu packages valgrind)
#:use-module (gnu packages video)
#:use-module (gnu packages web)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xml)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg)
#:use-module (gnu packages groff)
#:use-module (gnu packages selinux)
#:use-module (gnu packages swig)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match))
(define-public (system->linux-architecture arch)
"Return the Linux architecture name for ARCH, a Guix system name such as
\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
(let ((arch (car (string-split arch #\-))))
(cond ((string=? arch "i686") "i386")
((string-prefix? "mips" arch) "mips")
((string-prefix? "arm" arch) "arm")
((string-prefix? "aarch64" arch) "arm64")
((string-prefix? "alpha" arch) "alpha")
((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
((string-prefix? "s390" arch) "s390")
(else arch))))
(define-public (system->defconfig system)
"Some systems (notably powerpc-linux) require a special target for kernel
defconfig. Return the appropriate make target if applicable, otherwise return
\"defconfig\"."
(cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
(else "defconfig")))
(define (linux-libre-urls version)
"Return a list of URLs for Linux-Libre VERSION."
(list (string-append
"https://linux-libre.fsfla.org/pub/linux-libre/releases/"
version "-gnu/linux-libre-" version "-gnu.tar.xz")
;; XXX: Work around <http://bugs.gnu.org/14851>.
(string-append
"ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
version "-gnu.tar.xz")
;; Maybe this URL will become valid eventually.
(string-append
"mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
version "-gnu.tar.xz")))
(define-public linux-libre-headers
(package
(name "linux-libre-headers")
(version "4.14.67")
(source (origin
(method url-fetch)
(uri (linux-libre-urls version))
(sha256
(base32
"050zvdxjy6sc64q75pr1gxsmh49chwav2pwxz8xlif39bvahnrpg"))))
(build-system gnu-build-system)
(native-inputs `(("perl" ,perl)))
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))
#:phases
(modify-phases %standard-phases
(delete 'configure)
(replace 'build
(lambda _
(let ((arch ,(system->linux-architecture
(or (%current-target-system)
(%current-system))))
(defconfig ,(system->defconfig
(or (%current-target-system)
(%current-system)))))
(setenv "ARCH" arch)
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
(invoke "make" defconfig)
(invoke "make" "mrproper" "headers_check"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(invoke "make"
(string-append "INSTALL_HDR_PATH=" out)
"headers_install")
(mkdir (string-append out "/include/config"))
(call-with-output-file
(string-append out
"/include/config/kernel.release")
(lambda (p)
(format p "~a-default~%" ,version)))
;; Remove the '.install' and '..install.cmd' files; the
;; latter contains store paths, which pulls in bootstrap
;; binaries in the build environment, and prevents bit
;; reproducibility for the bootstrap binaries.
(for-each delete-file (find-files out "\\.install"))
#t))))
#:allowed-references ()
#:tests? #f))
(home-page "https://www.gnu.org/software/linux-libre/")
(synopsis "GNU Linux-Libre kernel headers")
(description "Headers of the Linux-Libre kernel.")
(license license:gpl2)))
(define %boot-logo-patch
;; Linux-Libre boot logo featuring Freedo and a gnu.
(origin
(method url-fetch)
(uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
"lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
(sha256
(base32
"1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
(define %linux-libre-arm-export-__sync_icache_dcache-patch
(origin
(method url-fetch)
(uri (string-append
"https://salsa.debian.org/kernel-team/linux"
"/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
"/debian/patches/bugfix/arm/"
"arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
(file-name "linux-libre-4.19-arm-export-__sync_icache_dcache.patch")
(sha256
(base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
(define* (kernel-config arch #:key variant)
"Return the absolute file name of the Linux-Libre build configuration file
for ARCH and optionally VARIANT, or #f if there is no such configuration."
(let* ((name (string-append (if variant (string-append variant "-") "")
(if (string=? "i386" arch) "i686" arch) ".conf"))
(file (string-append "linux-libre/" name)))
(search-auxiliary-file file)))
(define %default-extra-linux-options
`(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
;; Modules required for initrd:
("CONFIG_NET_9P" . m)
("CONFIG_NET_9P_VIRTIO" . m)
("CONFIG_VIRTIO_BLK" . m)
("CONFIG_VIRTIO_NET" . m)
("CONFIG_VIRTIO_PCI" . m)
("CONFIG_VIRTIO_BALLOON" . m)
("CONFIG_VIRTIO_MMIO" . m)
("CONFIG_FUSE_FS" . m)
("CONFIG_CIFS" . m)
("CONFIG_9P_FS" . m)))
(define (config->string options)
(string-join (map (match-lambda
((option . 'm)
(string-append option "=m"))
((option . #t)
(string-append option "=y"))
((option . #f)
(string-append option "=n")))
options)
"\n"))
(define* (make-linux-libre version hash supported-systems
#:key
;; A function that takes an arch and a variant.
;; See kernel-config for an example.
(extra-version #f)
(configuration-file #f)
(defconfig "defconfig")
(extra-options %default-extra-linux-options)
(patches (list %boot-logo-patch)))
(package
(name (if extra-version
(string-append "linux-libre-" extra-version)
"linux-libre"))
(version version)
(source (origin
(method url-fetch)
(uri (linux-libre-urls version))
(sha256 (base32 hash))
(patches patches)))
(supported-systems supported-systems)
(build-system gnu-build-system)
(native-inputs
`(("perl" ,perl)
("bc" ,bc)
("openssl" ,openssl)
("kmod" ,kmod)
("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
("flex" ,flex)
("bison" ,bison)
;; Build with GCC-7 for full retpoline support.
;; FIXME: Remove this when our default compiler has retpoline support.
("gcc" ,gcc-7)
;; These are needed to compile the GCC plugins.
("gmp" ,gmp)
("mpfr" ,mpfr)
("mpc" ,mpc)
,@(match (and configuration-file
(configuration-file
(system->linux-architecture
(or (%current-target-system) (%current-system)))
#:variant (version-major+minor version)))
(#f ;no config for this platform
'())
((? string? config)
`(("kconfig" ,config))))))
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(ice-9 match))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-/bin/pwd
(lambda _
(substitute* (find-files "." "^Makefile(\\.include)?$")
(("/bin/pwd") "pwd"))
#t))
(add-before 'configure 'work-around-gcc-7-include-path-issue
(lambda _
(unsetenv "C_INCLUDE_PATH")
(unsetenv "CPLUS_INCLUDE_PATH")
#t))
(replace 'configure
(lambda* (#:key inputs native-inputs target #:allow-other-keys)
;; Avoid introducing timestamps
(setenv "KCONFIG_NOTIMESTAMP" "1")
(setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
;; Set ARCH and CROSS_COMPILE
(let ((arch ,(system->linux-architecture
(or (%current-target-system)
(%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"))))
(setenv "EXTRA_VERSION" ,extra-version)
(let ((build (assoc-ref %standard-phases 'build))
(config (assoc-ref (or native-inputs inputs) "kconfig")))
;; Use a custom kernel configuration file or a default
;; configuration file.
(if config
(begin
(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 outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(moddir (string-append out "/lib/modules"))
(dtbdir (string-append out "/lib/dtbs"))
(kmod (assoc-ref (or native-inputs inputs) "kmod")))
;; Install kernel image, kernel configuration and link map.
(for-each (lambda (file) (install-file file out))
(find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
;; Install device tree files
(unless (null? (find-files "." "\\.dtb$"))
(mkdir-p dtbdir)
(invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
"dtbs_install"))
;; Install kernel modules
(mkdir-p moddir)
(invoke "make"
(string-append "DEPMOD=" kmod "/bin/depmod")
(string-append "MODULE_DIR=" moddir)
(string-append "INSTALL_PATH=" out)
(string-append "INSTALL_MOD_PATH=" out)
"INSTALL_MOD_STRIP=1"
"modules_install")))))
#:tests? #f))
(home-page "https://www.gnu.org/software/linux-libre/")
(synopsis "100% free redistribution of a cleaned Linux kernel")
(description
"GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
It has been modified to remove all non-free binary blobs.")
(license license:gpl2)))
(define %linux-libre-version "5.0")
(define %linux-libre-hash "18gs0kl5xvbmh725m7crg6iyqw3p8qq421aql7z0nlk035fh5xbx")
(define %linux-libre-5.0-patches
(list %boot-logo-patch
%linux-libre-arm-export-__sync_icache_dcache-patch))
(define-public linux-libre
(make-linux-libre %linux-libre-version
%linux-libre-hash
'("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
#:patches %linux-libre-5.0-patches
#:configuration-file kernel-config))
(define %linux-libre-4.19-version "4.19.27")
(define %linux-libre-4.19-hash "055n4s4yrkcrwkdsxbf1q1zyxmpabf7kba8d0phpfadian3wr4s0")
(define %linux-libre-4.19-patches
(list %boot-logo-patch
%linux-libre-arm-export-__sync_icache_dcache-patch))
(define-public linux-libre-4.19
(make-linux-libre %linux-libre-4.19-version
%linux-libre-4.19-hash
'("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
#:patches %linux-libre-4.19-patches
#:configuration-file kernel-config))
(define %linux-libre-4.14-version "4.14.105")
(define %linux-libre-4.14-hash "06pp13d2g0j2v8jy8fh20b4ismzg9wn3i7bnx2hpyvslz256rrgg")
(define-public linux-libre-4.14
(make-linux-libre %linux-libre-4.14-version
%linux-libre-4.14-hash
'("x86_64-linux" "i686-linux" "armhf-linux")
#:configuration-file kernel-config))
(define-public linux-libre-4.9
(make-linux-libre "4.9.162"
"07swv6xvjsl5nv5y3sc2nfdnmqdz9gjy8hgrjvi0bljwzf1fbxmy"
'("x86_64-linux" "i686-linux")
#:configuration-file kernel-config))
(define-public linux-libre-4.4
(make-linux-libre "4.4.176"
"0c300zqmsadahs2fpzxh6cn7q3h7jxq69msd17rh8v3wnvql8vzx"
'("x86_64-linux" "i686-linux")
#:configuration-file kernel-config))
(define-public linux-libre-arm-generic
(make-linux-libre %linux-libre-version
%linux-libre-hash
'("armhf-linux")
#:patches %linux-libre-5.0-patches
#:defconfig "multi_v7_defconfig"
#:extra-version "arm-generic"))
(define-public linux-libre-arm-generic-4.19
(make-linux-libre %linux-libre-4.19-version
%linux-libre-4.19-hash
'("armhf-linux")
#:patches %linux-libre-4.19-patches
#:defconfig "multi_v7_defconfig"
#:extra-version "arm-generic"))
(define-public linux-libre-arm-generic-4.14
(make-linux-libre %linux-libre-4.14-version
%linux-libre-4.14-hash
'("armhf-linux")
#:defconfig "multi_v7_defconfig"
#:extra-version "arm-generic"))
(define-public linux-libre-arm-omap2plus
(make-linux-libre %linux-libre-version
%linux-libre-hash
'("armhf-linux")
#:patches %linux-libre-5.0-patches
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
(define-public linux-libre-arm-omap2plus-4.19
(make-linux-libre %linux-libre-4.19-version
%linux-libre-4.19-hash
'("armhf-linux")
#:patches %linux-libre-4.19-patches
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
(define-public linux-libre-arm-omap2plus-4.14
(make-linux-libre %linux-libre-4.14-version
%linux-libre-4.14-hash
'("armhf-linux")
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
;;;
;;; Pluggable authentication modules (PAM).
;;;
(define-public linux-pam
(package
(name "linux-pam")
(version "1.3.1")
(source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/linux-pam/linux-pam/releases/download/v"
version "/Linux-PAM-" version ".tar.xz"))
(sha256
(base32
"1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
(patches (search-patches "linux-pam-no-setfsuid.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("flex" ,flex)
;; TODO: optional dependencies
;; ("libxcrypt" ,libxcrypt)
;; ("cracklib" ,cracklib)
))
(arguments
`(;; Most users, such as `shadow', expect the headers to be under
;; `security'.
#:configure-flags (list (string-append "--includedir="
(assoc-ref %outputs "out")
"/include/security")
;; XXX: <rpc/rpc.h> is missing from glibc when
;; cross-compiling, so we have to disable NIS
;; support altogether.
,@(if (%current-target-system)
'("--disable-nis")
'()))
;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
;; isn't available.
#:tests? #f))
(home-page "http://www.linux-pam.org/")
(synopsis "Pluggable authentication modules for Linux")
(description
"A *Free* project to implement OSF's RFC 86.0.
Pluggable authentication modules are small shared object files that can
be used through the PAM API to perform tasks, like authenticating a user
at login. Local and dynamic reconfiguration are its key features.")
(license license:bsd-3)))
(define-public linux-pam-1.2
(package
(inherit linux-pam)
(version "1.2.1")
(source
(origin
(method url-fetch)
(uri (string-append
"http://www.linux-pam.org/library/"
"Linux-PAM-" version ".tar.bz2"))
(sha256
(base32
"1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
(patches (search-patches "linux-pam-no-setfsuid.patch"))))))
;;;
;;; Miscellaneous.
;;;
(define-public psmisc
(package
(name "psmisc")
(version "23.2")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/psmisc/psmisc devel/psmisc-"
version ".tar.xz"))
(sha256
(base32
"0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))
(build-system gnu-build-system)
(inputs `(("ncurses" ,ncurses)))
(home-page "https://gitlab.com/psmisc/psmisc")
(synopsis
"Small utilities that use the proc file system")
(description
"This PSmisc package is a set of some small useful utilities that
use the proc file system. We're not about changing the world, but
providing the system administrator with some help in common tasks.")
(license license:gpl2+)))
(define-public util-linux
(package
(name "util-linux")
(version "2.32.1")
(source (origin
(method url-fetch)
(uri (string-append "mirror://kernel.org/linux/utils/"
name "/v" (version-major+minor version) "/"
name "-" version ".tar.xz"))
(sha256
(base32
"1ck7d8srw5szpjq7v0gpmjahnjs6wgqzm311ki4gazww6xx71rl6"))
(patches (search-patches "util-linux-tests.patch"))
(modules '((guix build utils)))
(snippet
;; We take 'nologin' from Shadow, the 'logger' program from
;; GNU Inetutils and 'kill' from GNU Coreutils.
'(begin
(substitute* "configure"
(("build_nologin=yes") "build_nologin=no")
(("build_logger=yes") "build_logger=no")
(("build_kill=yes") "build_kill=no"))
#t))))
(build-system gnu-build-system)
(outputs '("out"
"static")) ; >2 MiB of 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"
;; 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
'build 'set-umount-file-name
(lambda* (#:key outputs #:allow-other-keys)
;; Tell 'eject' the right file name of 'umount'.
(let ((out (assoc-ref outputs "out")))
(substitute* "sys-utils/eject.c"
(("\"/bin/umount\"")
(string-append "\"" out "/bin/umount\"")))
#t)))
(add-before
'check 'pre-check
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(net (assoc-ref inputs "net-base")))
;; Change the test to refer to the right file.
(substitute* "tests/ts/misc/mcookie"
(("/etc/services")
(string-append net "/etc/services")))
#t)))
(add-after
'install 'move-static-libraries
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(static (assoc-ref outputs "static")))
(mkdir-p (string-append static "/lib"))
(with-directory-excursion out
(for-each (lambda (file)
(rename-file file
(string-append static "/"
file)))
(find-files "lib" "\\.a$"))
;; Remove references to the static library from the '.la'
;; files so that Libtool does the right thing when both
;; the shared and static library is available.
(substitute* (find-files "lib" "\\.la$")
(("old_library=.*") "old_library=''\n")))
#t))))))
(inputs `(("zlib" ,zlib)
("ncurses" ,ncurses)
;; XXX: This is so that the 'pre-check' phase can find it.
,@(if (%current-target-system)
`(("net-base" ,net-base))
'())))
(native-inputs
`(("perl" ,perl)
("net-base" ,net-base))) ;for tests
(home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
(synopsis "Collection of utilities for the Linux kernel")
(description "Util-linux is a diverse collection of Linux kernel
utilities. It provides dmesg and includes tools for working with file systems,
block devices, UUIDs, TTYs, and many other tools.")
;; Note that util-linux doesn't use the same license for all the
;; code. GPLv2+ is the default license for a code without an
;; explicitly defined license.
(license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
license:bsd-4 license:public-domain))))
(define-public ddate
(package
(name "ddate")
(version "0.2.2")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/bo0ts/ddate/archive/v"
version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
(build-system cmake-build-system)
(arguments '(#:tests? #f))
(home-page "https://github.com/bo0ts/ddate")
(synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
(description
"ddate displays the Discordian date and holidays of a given date.
The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
by Robert Shea and Robert Anton Wilson.")
(license license:public-domain)))
(define-public procps
(package
(name "procps")
(version "3.3.15")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/procps-ng/Production/"
"procps-ng-" version ".tar.xz"))
(sha256
(base32
"0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
(build-system gnu-build-system)
(arguments
'(#:modules ((guix build utils)
(guix build gnu-build-system)
(srfi srfi-1)
(srfi srfi-26))
#:phases
(modify-phases %standard-phases
(add-after
'install 'post-install
;; Remove commands and man pages redudant with
;; Coreutils.
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(dup (append-map (cut find-files out <>)
'("^kill" "^uptime"))))
(for-each delete-file dup)
#t))))))
(inputs `(("ncurses" ,ncurses)))
(home-page "https://gitlab.com/procps-ng/procps/")
(synopsis "Utilities that give information about processes")
(description
"Procps is the package that has a bunch of small useful utilities
that give information about processes using the Linux /proc file system.
The package includes the programs ps, top, vmstat, w, kill, free,
slabtop, and skill.")
(license license:gpl2)))
(define-public usbutils
(package
(name "usbutils")
(version "010")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
"usbutils-" version ".tar.xz"))
(sha256
(base32
"06aag4jfgsfjxk563xsp9ik9nadihmasrr37a1gb0vwqni5kdiv1"))))
(build-system gnu-build-system)
(inputs
`(("libusb" ,libusb)
("eudev" ,eudev)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(home-page "http://www.linux-usb.org/")
(synopsis
"Tools for working with USB devices, such as lsusb")
(description
"Tools for working with USB devices, such as lsusb.")
(license license:gpl2+)))
(define-public e2fsprogs
(package
(name "e2fsprogs")
(version "1.44.5")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://kernel.org/linux/kernel/people/tytso/"
name "/v" version "/"
name "-" version ".tar.xz"))
(sha256
(base32
"1ff56h6h1h17sj2zvlddv5c88nmbx46p1fcbh6b0s5k9kl3b6pms"))))
(build-system gnu-build-system)
(inputs `(("util-linux" ,util-linux)))
(native-inputs `(("pkg-config" ,pkg-config)
("texinfo" ,texinfo) ;for the libext2fs Info manual
;; For tests.
("perl" ,perl)
("procps" ,procps)))
(arguments
'(;; util-linux is the preferred source for some of the libraries and
;; commands, so disable them (see, e.g.,
;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
#:configure-flags (list "--disable-libblkid"
"--disable-libuuid" "--disable-uuidd"
"--disable-fsck"
;; Use symlinks instead of hard links for
;; 'fsck.extN' etc. This makes the resulting nar
;; smaller and is preserved across copies.
"--enable-symlink-install"
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out")
"/lib")
;; Install libext2fs et al.
"--enable-elf-shlibs")
#:phases
(modify-phases %standard-phases
(add-before 'configure 'patch-shells
(lambda _
(substitute* "configure"
(("/bin/sh (.*)parse-types.sh" _ dir)
(string-append (which "sh") " " dir
"parse-types.sh")))
(substitute* "MCONFIG.in"
(("INSTALL_SYMLINK = /bin/sh")
"INSTALL_SYMLINK = sh"))
(substitute* (find-files "." "^Makefile.in$")
(("#!/bin/sh")
(string-append "#!" (which "sh"))))
#t))
(add-after 'install 'install-libs
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(lib (string-append out "/lib")))
(invoke "make" "install-libs")
;; Make the .a writable so that 'strip' works.
;; Failing to do that, due to debug symbols, we
;; retain a reference to the final
;; linux-libre-headers, which refer to the
;; bootstrap binaries.
(let ((archives (find-files lib "\\.a$")))
(for-each (lambda (file)
(chmod file #o666))
archives))
#t))))))
(home-page "http://e2fsprogs.sourceforge.net/")
(synopsis "Creating and checking ext2/ext3/ext4 file systems")
(description
"This package provides tools for manipulating ext2/ext3/ext4 file systems.")
(license (list license:gpl2 ;programs
license:lgpl2.0 ;libext2fs
license:x11)))) ;libuuid
(define e2fsprogs/static
(static-package
(package (inherit e2fsprogs)
(arguments
;; Do not build shared libraries.
(substitute-keyword-arguments (package-arguments e2fsprogs)
((#:configure-flags _)
'(list "--disable-blkid"))
((#:make-flags _)
'(list)))))))
(define-public e2fsck/static
(package
(name "e2fsck-static")
(version (package-version e2fsprogs))
(build-system trivial-build-system)
(source #f)
(inputs
`(("e2fsprogs" ,e2fsprogs/static)))
(arguments
`(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils)
(ice-9 ftw)
(srfi srfi-26))
(let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
"/sbin/e2fsck"))
(bin (string-append (assoc-ref %outputs "out") "/sbin")))
(mkdir-p bin)
(with-directory-excursion bin
(copy-file e2fsck "e2fsck")
(remove-store-references "e2fsck")
(chmod "e2fsck" #o555))
#t))))
(home-page (package-home-page e2fsprogs))
(synopsis "Statically-linked e2fsck command from e2fsprogs")
(description "This package provides statically-linked e2fsck command taken
from the e2fsprogs package. It is meant to be used in initrds.")
(license (package-license e2fsprogs))))
(define-public extundelete
(package
(name "extundelete")
(version "0.2.4")
(source
(origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/extundelete/"
"extundelete/" version "/extundelete-"
version ".tar.bz2"))
(sha256
(base32
"1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
(patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
(build-system gnu-build-system)
(inputs `(("e2fsprogs" ,e2fsprogs)))
(home-page "http://extundelete.sourceforge.net/")
(synopsis "Recover deleted files from ext2/3/4 partitions")
(description
"Extundelete is a set of tools that can recover deleted files from an
ext3 or ext4 partition.")
(license license:gpl2)))
(define-public zerofree
(package
(name "zerofree")
(version "1.1.1")
(home-page "https://frippery.org/uml/")
(source (origin
(method url-fetch)
(uri (string-append home-page name "-" version
".tgz"))
(sha256
(base32
"0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configure script
(replace 'install
;; The Makefile lacks an ‘install’ target.
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(chmod "zerofree" #o555)
(install-file "zerofree" bin)
#t))))
#:tests? #f)) ; no tests
(inputs `(("libext2fs" ,e2fsprogs)))
(synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
(description
"Zerofree finds the unallocated blocks with non-zero value content in an
ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
This is a simple way to make disk images more compressible.
Zerofree requires the file system to be unmounted or mounted read-only.")
(license license:gpl2)))
(define-public strace
(package
(name "strace")
(version "4.26")
(home-page "https://strace.io")
(source (origin
(method url-fetch)
(uri (string-append home-page "/files/" version
"/strace-" version ".tar.xz"))
(sha256
(base32
"070yz8xii8gnb4psiz628zwm5srh266sfb06f7f1qzagxzz2ykbw"))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-/bin/sh
(lambda _
(substitute* "strace.c"
(("/bin/sh") (which "sh")))
#t)))
;; Don't fail if the architecture doesn't support different personalities.
#:configure-flags '("--enable-mpers=check")
;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
#:parallel-tests? #f)) ; undeterministic failures
(native-inputs `(("perl" ,perl)))
(synopsis "System call tracer for Linux")
(description
"strace is a system call tracer, i.e. a debugging tool which prints out a
trace of all the system calls made by a another process/program.")
(license license:lgpl2.1+)))
(define-public ltrace
(package
(name "ltrace")
(version "0.7.3")
(source (origin
(method url-fetch)
(uri (string-append "http://www.ltrace.org/ltrace_" version
".orig.tar.bz2"))
(sha256
(base32
"00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
(build-system gnu-build-system)
(inputs `(("libelf" ,libelf)))
(arguments
;; Compilation uses -Werror by default, but it fails.
'(#:configure-flags '("--disable-werror")))
(home-page "https://www.ltrace.org/")
(synopsis "Library call tracer for Linux")
(description
"ltrace intercepts and records dynamic library calls which are called by
an executed process and the signals received by that process. It can also
intercept and print the system calls executed by the program.")
(license license:gpl2+)))
(define-public alsa-lib
(package
(name "alsa-lib")
(version "1.1.7")
(source (origin
(method url-fetch)
(uri (string-append
"ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
version ".tar.bz2"))
(sha256
(base32
"02fw7dw202mjid49w9ki3dsfcyvid5fj488561bdzcm3haw00q4x"))))
(build-system gnu-build-system)
(home-page "https://www.alsa-project.org/")
(synopsis "The Advanced Linux Sound Architecture libraries")
(description
"The Advanced Linux Sound Architecture (ALSA) provides audio and
MIDI functionality to the Linux-based operating system.")
(license license:lgpl2.1+)))
(define-public alsa-utils
(package
(name "alsa-utils")
(version "1.1.7")
(source (origin
(method url-fetch)
(uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
name "-" version ".tar.bz2"))
(sha256
(base32
"02jlw6a22j2rr7inggfgk2hzx3w0fjhvhs0dn1afpzdp9aspzchx"))))
(build-system gnu-build-system)
(arguments
;; XXX: Disable man page creation until we have DocBook.
'(#:configure-flags (list "--disable-xmlto"
;; The udev rule is responsible for restoring
;; the volume.
(string-append "--with-udev-rules-dir="
(assoc-ref %outputs "out")
"/lib/udev/rules.d"))
#:phases
(modify-phases %standard-phases
(add-before
'install 'pre-install
(lambda _
;; Don't try to mkdir /var/lib/alsa.
(substitute* "Makefile"
(("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
"true\n"))
#t)))))
(inputs
`(("libsamplerate" ,libsamplerate)
("ncurses" ,ncurses)
("alsa-lib" ,alsa-lib)
("xmlto" ,xmlto)
("gettext" ,gettext-minimal)))
(home-page "http://www.alsa-project.org/")
(synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
(description
"The Advanced Linux Sound Architecture (ALSA) provides audio and
MIDI functionality to the Linux-based operating system.")
;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
;; GPLv2-only.
(license license:gpl2)))
(define-public alsa-plugins
(package
(name "alsa-plugins")
(version "1.1.7")
(source (origin
(method url-fetch)
(uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
name "-" version ".tar.bz2"))
(sha256
(base32
"0iys4zl1davzyg3mn9lvil1n3k1ifrg3v1caj3k4dqyrnrd40jx7"))))
(build-system gnu-build-system)
;; TODO: Split libavcodec and speex if possible. It looks like they can not
;; be split, there are references to both in files.
;; TODO: Remove OSS related plugins, they add support to run native
;; ALSA applications on OSS however we do not offer OSS and OSS is
;; obsolete.
(outputs '("out" "pulseaudio" "jack"))
(arguments
`(#:configure-flags '(;; Do not install a "local" configuration targeted
;; for /etc/alsa. On GuixSD plugins are loaded from
;; the ALSA service, and other distributions likely
;; won't use these files.
"--with-alsalconfdir=/tmp/noop")
#:phases
(modify-phases %standard-phases
(add-after 'install 'split
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Distribute the binaries to the various outputs.
(let* ((out (assoc-ref outputs "out"))
(jack (assoc-ref outputs "jack"))
(jacklib (string-append jack "/lib/alsa-lib"))
(pua (assoc-ref outputs "pulseaudio"))
(pualib (string-append pua "/lib/alsa-lib")))
;; For jack.
(mkdir-p jacklib)
(for-each (lambda (file)
(rename-file file (string-append jacklib "/" (basename file))))
(find-files out ".*jack\\.(la|so)"))
;; For pulseaudio.
(mkdir-p pualib)
(for-each (lambda (file)
(rename-file file (string-append pualib "/" (basename file))))
(find-files out ".*pulse\\.(la|so)"))
#t))))))
(inputs
`(("alsa-lib" ,alsa-lib)
("jack" ,jack-1)
("speex" ,speex) ; libspeexdsp resampling plugin
("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
(native-inputs
`(("pkg-config" ,pkg-config)))
(home-page "http://www.alsa-project.org/")
(synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
(description
"The Advanced Linux Sound Architecture (ALSA) provides audio and
MIDI functionality to the Linux-based operating system. This package enhances ALSA
by providing additional plugins which include: upmixing, downmixing, jackd and
pulseaudio support for native alsa applications, format conversion (s16 to a52), and
external rate conversion.")
(license (list license:gpl2+
;; `rate/rate_samplerate.c': LGPL v2.1 or later.
license:lgpl2.1+))))
(define-public iptables
(package
(name "iptables")
(version "1.6.2")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://netfilter.org/iptables/iptables-"
version ".tar.bz2"))
(sha256
(base32
"0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
("flex" ,flex)
("bison" ,bison)))
(inputs
`(("libmnl" ,libmnl)
("libnftnl" ,libnftnl)))
(arguments
'(#:tests? #f ; no test suite
#:configure-flags ; add $libdir to the RUNPATH of executables
(list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
(home-page "https://www.netfilter.org/projects/iptables/index.html")
(synopsis "Programs to configure Linux IP packet filtering rules")
(description
"@command{iptables} is the user-space command line program used to
configure the Linux 2.4.x and later IPv4 packet filtering ruleset
(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
This package also includes @command{ip6tables}, which is used to configure the
IPv6 packet filter.
Both commands are targeted at system administrators.")
(license license:gpl2+)))
(define-public ebtables
(package
(name "ebtables")
(version "2.0.10-4")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://netfilter.org/ebtables/ebtables-v"
version ".tar.gz"))
(sha256
(base32
"0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
(build-system gnu-build-system)
(arguments
'(#:tests? #f ; no test suite
#:make-flags
(let* ((out (assoc-ref %outputs "out"))
(bin (string-append out "/sbin"))
(lib (string-append out "/lib"))
(man (string-append out "/share/man"))
(iptables (assoc-ref %build-inputs "iptables"))
(ethertypes (string-append iptables "/etc/ethertypes")))
(list (string-append "LIBDIR=" lib)
(string-append "MANDIR=" man)
(string-append "BINDIR=" bin)
(string-append "ETHERTYPESFILE=" ethertypes)
;; With the default CFLAGS, it falis with:
;; communication.c:259:58: error: variable ‘ret’ set but not
;; used [-Werror=unused-but-set-variable]
"CFLAGS=-Wall"))
#:phases
(modify-phases %standard-phases
(replace 'configure
;; no configure script
(lambda _
(substitute* "Makefile"
;; Remove user and group options from install commands,
;; otherwise it fails with: invalid user 'root'.
(("-o root -g root") "")
;; Remove 'ethertypes' from the install target.
(("install: .*")
"install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
#t)))))
(inputs
`(("perl" ,perl)
("iptables" ,iptables)))
(synopsis "Ethernet bridge frame table administration")
(home-page "http://ebtables.netfilter.org/")
(description
"ebtables is an application program used to set up and maintain the
tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
analogous to the iptables application, but less complicated, due to the fact
that the Ethernet protocol is much simpler than the IP protocol.")
(license license:gpl2+)))
(define-public iproute
(package
(name "iproute2")
(version "4.20.0")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
version ".tar.xz"))
(sha256
(base32
"1a7xyvqjxfnm7rk21amm0xgxa38clg7q7cmc4dmlg27q81mambf8"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no test suite
#:make-flags (let ((out (assoc-ref %outputs "out")))
(list "DESTDIR="
(string-append "BASH_COMPDIR=" out
"/etc/bash_completion.d")
(string-append "LIBDIR=" out "/lib")
(string-append "HDRDIR=" out "/include")
(string-append "SBINDIR=" out "/sbin")
(string-append "CONFDIR=" out "/etc")
(string-append "DOCDIR=" out "/share/doc/"
,name "-" ,version)
(string-append "MANDIR=" out "/share/man")))
#:phases (modify-phases %standard-phases
(add-before 'install 'pre-install
(lambda _
;; Don't attempt to create /var/lib/arpd.
(substitute* "Makefile"
(("^.*ARPDDIR.*$") ""))
#t)))))
(inputs
`(("iptables" ,iptables)
("db4" ,bdb)))
(native-inputs
`(("pkg-config" ,pkg-config)
("flex" ,flex)
("bison" ,bison)))
(home-page
"https://wiki.linuxfoundation.org/networking/iproute2")
(synopsis
"Utilities for controlling TCP/IP networking and traffic in Linux")
(description
"Iproute2 is a collection of utilities for controlling TCP/IP networking
and traffic with the Linux kernel. The most important of these are
@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
control.
Most network configuration manuals still refer to ifconfig and route as the
primary network configuration tools, but ifconfig is known to behave
inadequately in modern network environments, and both should be deprecated.")
(license license:gpl2+)))
(define-public net-tools
;; XXX: This package is basically unmaintained, but it provides a few
;; commands not yet provided by Inetutils, such as 'route', so we have to
;; live with it.
(let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
(revision "0"))
(package
(name "net-tools")
(version (string-append "1.60-" revision "." (string-take commit 7)))
(source (origin
(method url-fetch)
(uri (string-append "https://sourceforge.net/code-snapshots/git/"
"n/ne/net-tools/code.git/net-tools-code-"
commit ".zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
(base32
"0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
(home-page "http://net-tools.sourceforge.net/")
(build-system gnu-build-system)
(arguments
'(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(srfi srfi-26))
#:phases
(modify-phases %standard-phases
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(mkdir-p (string-append out "/bin"))
(mkdir-p (string-append out "/sbin"))
;; Pretend we have everything...
(system "yes | make config")
;; ... except for the things we don't have.
;; HAVE_AFDECnet requires libdnet, which we don't have.
;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
;; that have been removed.
;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
;; think about adding them later.
(substitute* '("config.make" "config.h")
(("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
""))
#t)))
(add-after 'install 'remove-redundant-commands
(lambda* (#:key outputs #:allow-other-keys)
;; Remove commands and man pages redundant with Inetutils.
(let* ((out (assoc-ref outputs "out"))
(dup (append-map (cut find-files out <>)
'("^hostname"
"^(yp|nis|dns)?domainname"))))
(for-each delete-file dup)
#t))))
;; Binaries that depend on libnet-tools.a don't declare that
;; dependency, making it parallel-unsafe.
#:parallel-build? #f
#:tests? #f ; no test suite
#:make-flags (let ((out (assoc-ref %outputs "out")))
(list "CC=gcc"
(string-append "BASEDIR=" out)
(string-append "INSTALLNLSDIR=" out "/share/locale")
(string-append "mandir=/share/man")))))
(native-inputs `(("gettext" ,gettext-minimal)
("unzip" ,unzip)))
(synopsis "Tools for controlling the network subsystem in Linux")
(description
"This package includes the important tools for controlling the network
subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
route. Additionally, this package contains utilities relating to particular
network hardware types (plipconfig, slattach) and advanced aspects of IP
configuration (iptunnel, ipmaddr).")
(license license:gpl2+))))
(define-public libcap
(package
(name "libcap")
(version "2.25")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://kernel.org/linux/libs/security/linux-privs/"
"libcap2/libcap-" version ".tar.xz"))
(sha256
(base32
"0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
(build-system gnu-build-system)
(arguments '(#:phases
(modify-phases %standard-phases
(replace 'configure
;; Add $libdir to the RUNPATH of executables.
(lambda _
(substitute* "Make.Rules"
(("LDFLAGS := #-g")
(string-append "LDFLAGS := -Wl,-rpath="
%output "/lib")))
#t)))
#:tests? #f ; no 'check' target
#:make-flags (list "lib=lib"
(string-append "prefix="
(assoc-ref %outputs "out"))
"RAISE_SETFCAP=no")))
(native-inputs `(("perl" ,perl)))
(inputs `(("attr" ,attr)))
(home-page "https://sites.google.com/site/fullycapable/")
(synopsis "Library for working with POSIX capabilities")
(description
"Libcap2 provides a programming interface to POSIX capabilities on
Linux-based operating systems.")
;; License is BSD-3 or GPLv2, at the user's choice.
(license license:gpl2)))
(define-public bridge-utils
(package
(name "bridge-utils")
(version "1.5")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/bridge/bridge/"
"bridge-utils-" version ".tar.gz"))
(sha256
(base32
"12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
(build-system gnu-build-system)
;; The tarball lacks all the generated files.
(native-inputs `(("autoconf" ,autoconf)
("automake" ,automake)))
(arguments
'(#:phases
(modify-phases %standard-phases
(add-before 'bootstrap 'patch-stuff
(lambda _
;; Fix "field ‘ip6’ has incomplete type" errors.
(substitute* "libbridge/libbridge.h"
(("#include <linux/if_bridge.h>")
"#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
;; Ensure that the entire build fails if one of the
;; sub-Makefiles fails.
(substitute* "Makefile.in"
(("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
"$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
#t)))
#:tests? #f)) ; no 'check' target
(home-page
"http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
(synopsis "Manipulate Ethernet bridges")
(description
"Utilities for Linux's Ethernet bridging facilities. A bridge is a way
to connect two Ethernet segments together in a protocol independent way.
Packets are forwarded based on Ethernet address, rather than IP address (like
a router). Since forwarding is done at Layer 2, all protocols can go
transparently through a bridge.")
(license license:gpl2+)))
(define-public libnl
(package
(name "libnl")
(version "3.4.0")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/thom311/libnl/releases/download/"
"libnl" (string-join (string-split version #\.) "_")
"/libnl-" version ".tar.gz"))
(sha256
(base32
"1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
(build-system gnu-build-system)
(native-inputs
`(("bison" ,bison)
("flex" ,flex)
("pkg-config" ,pkg-config)
("swig" ,swig)
("libnl3-doc"
,(origin
(method url-fetch)
(uri (string-append
"https://github.com/thom311/libnl/releases/download/libnl"
(string-join (string-split version #\.) "_")
"/libnl-doc-" version ".tar.gz"))
(sha256
(base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
(inputs
`(("python-2" ,python-2)
("python-3" ,python-3)))
(outputs '("out" "doc" "python2" "python3"))
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))
#: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
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((dest (string-append (assoc-ref outputs "doc")
"/share/doc/libnl")))
(mkdir-p dest)
(invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
"--strip-components=1" "-C" dest)))))))
(home-page "https://www.infradead.org/~tgr/libnl/")
(synopsis "NetLink protocol library suite")
(description
"The libnl suite is a collection of libraries providing APIs to netlink
protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
between the kernel and user space processes. It was designed to be a more
flexible successor to ioctl to provide mainly networking related kernel
configuration and monitoring interfaces.")
;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
;; 'nl-addr-add.c'), so the result is GPLv2-only.
(license license:gpl2)))
(define-public iw
(package
(name "iw")
(version "4.14")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://kernel.org/software/network/iw/iw-"
version ".tar.xz"))
(sha256
(base32
"12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
(build-system gnu-build-system)
(native-inputs `(("pkg-config" ,pkg-config)))
(inputs `(("libnl" ,libnl)))
(arguments
`(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
"CC=gcc")
#:phases (modify-phases %standard-phases (delete 'configure))))
(home-page "https://wireless.wiki.kernel.org/")
(synopsis "Tool for configuring wireless devices")
(description
"iw is a new nl80211 based CLI configuration utility for wireless
devices. It replaces @code{iwconfig}, which is deprecated.")
(license license:isc)))
(define-public powertop
(package
(name "powertop")
(version "2.10")
(source
(origin
(method url-fetch)
(uri (string-append "https://01.org/sites/default/files/downloads/"
"powertop-v" version ".tar.gz"))
(sha256
(base32 "0xaazqccyd42v2q532dxx40nqhb9sfsa6cyx8641rl57mfg4bdyk"))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
;; allow calibrating the network interface in GuixSD.
(add-after 'unpack 'patch-absolute-file-names
(lambda* (#:key inputs #:allow-other-keys)
(let ((kmod (assoc-ref inputs "kmod")))
(substitute* (find-files "src" "\\.cpp$")
;; Give the right 'modprobe' file name so that essential
;; modules such as msr.ko can be loaded.
(("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
;; These programs are only needed to calibrate, so using
;; relative file names avoids adding extra inputs. When they
;; are missing powertop gracefully handles it.
(("/usr/bin/hcitool") "hcitool")
(("/usr/bin/xset") "xset")
(("/usr/sbin/hciconfig") "hciconfig"))
#t))))))
(inputs
`(("kmod" ,kmod)
("libnl" ,libnl)
("ncurses" ,ncurses)
("pciutils" ,pciutils)
("zlib" ,zlib)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(home-page "https://01.org/powertop/")
(synopsis "Analyze power consumption on Intel-based laptops")
(description
"PowerTOP is a Linux tool to diagnose issues with power consumption and
power management. In addition to being a diagnostic tool, PowerTOP also has
an interactive mode where the user can experiment various power management
settings for cases where the operating system has not enabled these
settings.")
(license license:gpl2)))
(define-public aumix
(package
(name "aumix")
(version "2.9.1")
(source (origin
(method url-fetch)
(uri (string-append
"http://www.jpj.net/~trevor/aumix/releases/aumix-"
version ".tar.bz2"))
(sha256
(base32
"0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
(build-system gnu-build-system)
(inputs `(("ncurses" ,ncurses)))
(home-page "http://www.jpj.net/~trevor/aumix.html")
(synopsis "Audio mixer for X and the console")
(description
"Aumix adjusts an audio mixer from X, the console, a terminal,
the command line or a script.")
(license license:gpl2+)))
(define-public iotop
(package
(name "iotop")
(version "0.6")
(source
(origin
(method url-fetch)
(uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
version ".tar.gz"))
(sha256 (base32
"1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
(build-system python-build-system)
(arguments
;; The setup.py script expects python-2.
`(#:python ,python-2
;; There are currently no checks in the package.
#:tests? #f))
(native-inputs `(("python" ,python-2)))
(home-page "http://guichaz.free.fr/iotop/")
(synopsis
"Displays the IO activity of running processes")
(description
"Iotop is a Python program with a top like user interface to show the
processes currently causing I/O.")
(license license:gpl2+)))
(define-public fuse
(package
(name "fuse")
(version "2.9.8")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/libfuse/libfuse/releases/"
"download/fuse-" version
"/fuse-" version ".tar.gz"))
(sha256
(base32
"1qxg1r1mgysfq6qakmvid2njph3lr00w0swvydsfl9ymilfzi12y"))
(patches (search-patches "fuse-overlapping-headers.patch"))))
(build-system gnu-build-system)
(inputs `(("util-linux" ,util-linux)))
(arguments
'(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
(assoc-ref %outputs "out")
"/sbin")
(string-append "INIT_D_PATH="
(assoc-ref %outputs "out")
"/etc/init.d")
;; The rule makes /dev/fuse 666.
(string-append "UDEV_RULES_PATH="
(assoc-ref %outputs "out")
"/lib/udev/rules.d"))
#:phases
(modify-phases %standard-phases
(add-before 'build 'set-file-names
(lambda* (#:key inputs #:allow-other-keys)
;; libfuse calls out to mount(8) and umount(8). Make sure
;; it refers to the right ones.
(substitute* '("lib/mount_util.c" "util/mount_util.c")
(("/bin/(u?)mount" _ maybe-u)
(string-append (assoc-ref inputs "util-linux")
"/bin/" maybe-u "mount")))
(substitute* '("util/mount.fuse.c")
(("/bin/sh")
(which "sh")))
;; This hack leads libfuse to search for 'fusermount' in
;; $PATH, where it may find a setuid-root binary, instead of
;; trying solely $out/sbin/fusermount and failing because
;; it's not setuid.
(substitute* "lib/Makefile"
(("-DFUSERMOUNT_DIR=[[:graph:]]+")
"-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
#t)))))
(home-page "https://github.com/libfuse/libfuse")
(synopsis "Support file systems implemented in user space")
(description
"As a consequence of its monolithic design, file system code for Linux
normally goes into the kernel itself---which is not only a robustness issue,
but also an impediment to system extensibility. FUSE, for \"file systems in
user space\", is a kernel module and user-space library that tries to address
part of this problem by allowing users to run file system implementations as
user-space processes.")
(license (list license:lgpl2.1 ;library
license:gpl2+)))) ;command-line utilities
(define-public unionfs-fuse
(package
(name "unionfs-fuse")
(version "2.0")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/rpodgorny/unionfs-fuse/archive/v"
version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
(build-system cmake-build-system)
(native-inputs
`(("python" ,python)))
(inputs `(("fuse" ,fuse)))
(arguments
;; The tests were never actually run ("collected 0 items"), but in recent
;; versions of pytest that causes an error.
'(#:tests? #f))
(home-page "https://github.com/rpodgorny/unionfs-fuse")
(synopsis "User-space union file system")
(description
"UnionFS-FUSE is a flexible union file system implementation in user
space, using the FUSE library. Mounting a union file system allows you to
\"aggregate\" the contents of several directories into a single mount point.
UnionFS-FUSE additionally supports copy-on-write.")
(license license:bsd-3)))
(define fuse-static
(package (inherit fuse)
(name "fuse-static")
(source (origin (inherit (package-source fuse))
(modules '((guix build utils)))
(snippet
'(begin
;; Normally libfuse invokes mount(8) so that /etc/mtab is
;; updated. Change calls to 'mtab_needs_update' to 0 so
;; that it doesn't do that, allowing us to remove the
;; dependency on util-linux (something that is useful in
;; initrds.)
(substitute* '("lib/mount_util.c"
"util/mount_util.c")
(("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
"0")
(("/bin/")
""))
#t))))))
(define-public unionfs-fuse/static
(package (inherit unionfs-fuse)
(synopsis "User-space union file system (statically linked)")
(name (string-append (package-name unionfs-fuse) "-static"))
(source (origin (inherit (package-source unionfs-fuse))
(modules '((guix build utils)))
(snippet
'(begin
;; Add -ldl to the libraries, because libfuse.a needs that.
(substitute* "src/CMakeLists.txt"
(("target_link_libraries(.*)\\)" _ libs)
(string-append "target_link_libraries"
libs " dl)")))
#t))))
(arguments
'(#:tests? #f
#:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
#:phases
(modify-phases %standard-phases
(add-after 'install 'post-install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(exe (string-append out "/bin/unionfs")))
;; By default, 'unionfs' keeps references to
;; $glibc/share/locale and similar stuff. Remove them.
(remove-store-references exe)
;; 'unionfsctl' has references to glibc as well. Since
;; we don't need it, remove it.
(delete-file (string-append out "/bin/unionfsctl"))
#t))))))
(inputs `(("fuse" ,fuse-static)))))
(define-public sshfs
(package
(name "sshfs")
(version "2.10")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/libfuse/sshfs/releases/"
"download/sshfs-" version "/sshfs-" version
".tar.gz"))
(sha256
(base32
"00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
(build-system gnu-build-system)
(inputs
`(("fuse" ,fuse)
("glib" ,glib)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(home-page "https://github.com/libfuse/sshfs")
(synopsis "Mount remote file systems over SSH")
(description
"This is a file system client based on the SSH File Transfer Protocol.
Since most SSH servers already support this protocol it is very easy to set
up: on the server side there's nothing to do; on the client side mounting the
file system is as easy as logging into the server with an SSH client.")
(license license:gpl2+)))
(define-public sshfs-fuse
(package (inherit sshfs)
(name "sshfs-fuse")
(properties `((superseded . ,sshfs)))))
(define-public archivemount
(package
(name "archivemount")
(version "0.8.12")
(source
(origin
(method url-fetch)
(uri (string-append "https://www.cybernoia.de/software/archivemount/"
"archivemount-" version ".tar.gz"))
(sha256
(base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
(build-system gnu-build-system)
(inputs `(("fuse" ,fuse)
("libarchive" ,libarchive)))
(native-inputs `(("pkg-config" ,pkg-config)))
(home-page "https://www.cybernoia.de/software/archivemount.html")
(synopsis "Tool for mounting archive files with FUSE")
(description "archivemount is a FUSE-based file system for Unix variants,
including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
mount point where it can be read from or written to as with any other file
system. This makes accessing the contents of the archive, which may be
compressed, transparent to other programs, without decompressing them.")
(license license:lgpl2.0+)))
(define-public numactl
(package
(name "numactl")
(version "2.0.12")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/numactl/numactl/releases/download/v"
version "/" name "-" version ".tar.gz"))
(sha256
(base32
"0ad7mpi3vacbfnx3aqxnvgsj64yp3mav9yxnaz8ancjv7wvdmfsm"))))
(build-system gnu-build-system)
(arguments
'(;; There's a 'test' target, but it requires NUMA support in the kernel
;; to run, which we can't assume to have.
#:tests? #f))
;; NUMA is apparently not supported on armhf, see
;; http://www.spinics.net/lists/linux-numa/msg01157.html
(supported-systems (delete "armhf-linux" %supported-systems))
(home-page "https://github.com/numactl/numactl")
(synopsis "Tools for non-uniform memory access (NUMA) machines")
(description
"NUMA stands for Non-Uniform Memory Access, in other words a system whose
memory is not all in one place. The numactl program allows you to run your
application program on specific CPU's and memory nodes. It does this by
supplying a NUMA memory policy to the operating system before running your
program.
The package contains other commands, such as numademo, numastat and memhog.
The numademo command provides a quick overview of NUMA performance on your
system.")
(license (list license:gpl2 ;programs
license:lgpl2.1)))) ;library
(define-public kbd-neo
(package
(name "kbd-neo")
(version "2486")
(source
(origin
(method url-fetch)
(uri (string-append "https://svn.neo-layout.org/!svn/bc/"
version "/linux/console/neo.map"))
(file-name (string-append name "-" version ".map"))
(sha256
(base32
"19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
(build-system trivial-build-system)
(arguments
`(#:modules ((guix build utils))
#:builder (begin
(use-modules (guix build utils))
(let ((out (string-append %output "/share/keymaps"))
(source (assoc-ref %build-inputs "source")))
(mkdir-p out)
(copy-file source (string-append out "/neo.map"))
#t))))
(home-page "https://neo-layout.org")
(synopsis "Neo2 console layout")
(description
"Kbd-neo provides the Neo2 keyboard layout for use with
@command{loadkeys(1)} from @code{kbd(4)}.")
;; The file is located in an svn directory, the entire content of
;; the directory is licensed as GPL3.
(license license:gpl3+)))
(define-public kbd
(package
(name "kbd")
(version "2.0.4")
(source (origin
(method url-fetch)
(uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
version ".tar.xz"))
(sha256
(base32
"124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
(modules '((guix build utils)))
(snippet
'(begin
(substitute* "tests/Makefile.in"
;; The '%: %.in' rule incorrectly uses @VERSION@.
(("@VERSION@")
"[@]VERSION[@]"))
(substitute* '("src/unicode_start" "src/unicode_stop")
;; Assume the Coreutils are in $PATH.
(("/usr/bin/tty")
"tty"))
#t))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-before 'build 'pre-build
(lambda* (#:key inputs #:allow-other-keys)
(let ((gzip (assoc-ref %build-inputs "gzip"))
(bzip2 (assoc-ref %build-inputs "bzip2")))
(substitute* "src/libkeymap/findfile.c"
(("gzip")
(string-append gzip "/bin/gzip"))
(("bzip2")
(string-append bzip2 "/bin/bzip2")))
#t)))
(add-after 'install 'post-install
(lambda* (#:key outputs #:allow-other-keys)
;; Make sure these programs find their comrades.
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(for-each (lambda (prog)
(wrap-program (string-append bin "/" prog)
`("PATH" ":" prefix (,bin))))
'("unicode_start" "unicode_stop"))
#t))))))
(inputs `(("check" ,check)
("gzip" ,gzip)
("bzip2" ,bzip2)
("pam" ,linux-pam)))
(native-search-paths
(list (search-path-specification
(variable "LOADKEYS_KEYMAP_PATH")
;; Append ‘/**’ to recursively search all directories. One can then
;; run (for example) ‘loadkeys en-latin9’ instead of having to find
;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
(files (list "share/keymaps/**")))))
(native-inputs `(("pkg-config" ,pkg-config)))
(home-page "http://kbd-project.org/")
(synopsis "Linux keyboard utilities and keyboard maps")
(description
"This package contains keytable files and keyboard utilities compatible
for systems using the Linux kernel. This includes commands such as
'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
(license license:gpl2+)))
(define-public inotify-tools
(package
(name "inotify-tools")
(version "3.20.1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/rvoicilas/inotify-tools.git")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
(build-system gnu-build-system)
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
("libtool" ,libtool)))
(home-page "https://github.com/rvoicilas/inotify-tools/wiki")
(synopsis "Monitor file accesses")
(description
"The inotify-tools packages provides a C library and command-line tools
to use Linux' inotify mechanism, which allows file accesses to be monitored.")
(license license:gpl2+)))
(define-public kmod
(package
(name "kmod")
(version "25")
(source (origin
(method url-fetch)
(uri
(string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
"kmod-" version ".tar.xz"))
(sha256
(base32
"1kgixs4m3jvwk7fb3d18n6j77qhgi9qfv4csj35rs5ancr4ycrbi"))
(patches (search-patches "kmod-module-directory.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("xz" ,xz)
("zlib" ,zlib)))
(arguments
`(#:tests? #f ; FIXME: Investigate test failures
#:configure-flags '("--with-xz" "--with-zlib")
#:phases
(modify-phases %standard-phases
(add-after 'install 'install-modprobe&co
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(for-each (lambda (tool)
(symlink "kmod"
(string-append bin "/" tool)))
'("insmod" "rmmod" "lsmod" "modprobe"
"modinfo" "depmod"))
#t))))))
(home-page "https://www.kernel.org/")
(synopsis "Kernel module tools")
(description "Kmod is a set of tools to handle common tasks with Linux
kernel modules like insert, remove, list, check properties, resolve
dependencies and aliases.
These tools are designed on top of libkmod, a library that is shipped with
kmod. The aim is to be compatible with tools, configurations and indices
from the module-init-tools project.")
(license license:gpl2+))) ; library under lgpl2.1+
(define-public eudev
;; The post-systemd fork, maintained by Gentoo.
(package
(name "eudev")
(version "3.2.7")
(source (origin
(method git-fetch)
(uri (git-reference (url "https://github.com/gentoo/eudev")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1la7x7v7yqb84wnc7w0kj53sa0an0m9xp6wn01ypi8drh02wjjy2"))
(patches (search-patches "eudev-rules-directory.patch"))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'make-source-writable
(lambda _
;; XXX: Git checkouts are read-only, but this package needs to
;; modify some of its files.
(for-each make-file-writable (find-files "."))
#t))
(add-before 'bootstrap 'patch-file-names
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "man/make.sh"
(("/usr/bin/xsltproc")
(string-append (assoc-ref inputs "xsltproc")
"/bin/xsltproc")))
#t))
(add-after 'install 'build-hwdb
(lambda* (#:key outputs #:allow-other-keys)
;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
;; similar tools to display product names.
(let ((out (assoc-ref outputs "out")))
(invoke (string-append out "/bin/udevadm")
"hwdb" "--update")))))
#:configure-flags (list "--enable-manpages")))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
("gperf" ,gperf)
("libtool" ,libtool)
("pkg-config" ,pkg-config)
;; For tests.
("perl" ,perl)
("python" ,python-wrapper)
;; For documentation.
("docbook-xml" ,docbook-xml-4.2)
("docbook-xsl" ,docbook-xsl)
("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
("xsltproc" ,libxslt)))
(inputs
;; 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
("kmod" ,kmod)))
(home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
(synopsis "Userspace device management")
(description "Udev is a daemon which dynamically creates and removes
device nodes from /dev/, handles hotplug events and loads drivers at boot
time.")
(license license:gpl2+)))
(define-public eudev-with-hwdb
(deprecated-package "eudev-with-hwdb" eudev))
(define-public lvm2
(package
(name "lvm2")
(version "2.02.177")
(source (origin
(method url-fetch)
(uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
version ".tgz"))
(sha256
(base32
"1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
(modules '((guix build utils)))
(snippet
'(begin
(use-modules (guix build utils))
;; Honor sysconfdir.
(substitute* "make.tmpl.in"
(("confdir = .*$")
"confdir = @sysconfdir@\n")
(("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
"DEFAULT_SYS_DIR = @sysconfdir@"))
#t))
(patches (search-patches "lvm2-static-link.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
("procps" ,procps))) ;tests use 'pgrep'
(inputs
`(("udev" ,eudev)))
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'configure 'set-makefile-shell
(lambda _
;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
;; expected.
(setenv "SHELL" (which "sh"))
;; Replace /bin/sh with the right file name.
(patch-makefile-SHELL "make.tmpl")
#t)))
#:configure-flags (list (string-append "--sysconfdir="
(assoc-ref %outputs "out")
"/etc/lvm")
"--enable-udev_sync"
"--enable-udev_rules"
"--enable-pkgconfig"
"--enable-cmdlib"
"--enable-dmeventd" ; Requires '--enable-cmdlib'.
;; Make sure programs such as 'dmsetup' can
;; find libdevmapper.so.
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out")
"/lib,-rpath="
(assoc-ref %outputs "out")
"/lib/device-mapper")
;; TODO: Patch make.tmpl.in to take LDFLAGS
;; into account so that we don't need to also
;; set CLDFLAGS.
(string-append "CLDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out")
"/lib,-rpath="
(assoc-ref %outputs "out")
"/lib/device-mapper"))
;; The tests use 'mknod', which requires root access.
#:tests? #f))
(home-page "https://sourceware.org/lvm2/")
(synopsis "Logical volume management for Linux")
(description
"LVM2 is the logical volume management tool set for Linux-based systems.
This package includes the user-space libraries and tools, including the device
mapper. Kernel components are part of Linux-libre.")
;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
;; Command-line tools are GPLv2.
(license (list license:gpl2 license:lgpl2.1))))
(define-public lvm2-static
(package
(inherit lvm2)
(name "lvm2-static")
;; Propagate udev because libdevmapper.a depends on libudev.
(inputs (alist-delete "udev" (package-inputs lvm2)))
(propagated-inputs `(("udev" ,eudev)))
(arguments
(substitute-keyword-arguments (package-arguments lvm2)
((#:configure-flags flags '())
;; LVM2 doesn't use Libtool, hence the custom option.
`(cons "--enable-static_link" ,flags))))
(synopsis "Logical volume management for Linux (statically linked)")))
(define-public wireless-tools
(package
(name "wireless-tools")
(version "30.pre9")
(source (origin
(method url-fetch)
(uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
version ".tar.gz"))
(sha256
(base32
"0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
(snippet
'(begin
;; Remove the older header files that are not free software.
(for-each (lambda (n)
(delete-file (format #f "wireless.~a.h" n)))
'(10 11 12 13 14 15 16 17 18 19 20))
#t))))
(build-system gnu-build-system)
(arguments
`(#:make-flags
(list (string-append "PREFIX=" %output)
(string-append "INSTALL_MAN=" %output "/share/man")
(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
"BUILD_STATIC=")
#:phases (modify-phases %standard-phases
(delete 'configure))
#:tests? #f))
(synopsis "Tools for manipulating Linux Wireless Extensions")
(description "Wireless Tools are used to manipulate the now-deprecated
Linux Wireless Extensions; consider using 'iw' instead. The Wireless
Extension was an interface allowing you to set Wireless LAN specific
parameters and get the specific stats. It is deprecated in favor the nl80211
interface.")
(home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
;; other files are distributed under gpl2.
(license (list license:gpl2 license:lgpl2.1+))))
(define-public crda
(package
(name "crda")
(version "3.18")
(source (origin
(method url-fetch)
(uri (string-append "mirror://kernel.org/software/network/crda/"
"crda-" version ".tar.xz"))
(sha256
(base32
"1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
(patches (search-patches "crda-optional-gcrypt.patch"))))
(build-system gnu-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'gzip-determinism
(lambda _
(substitute* "Makefile"
(("gzip") "gzip --no-name"))
#t))
(add-before
'build 'no-werror-no-ldconfig
(lambda _
(substitute* "Makefile"
(("-Werror") "")
(("ldconfig") "true"))
#t))
(add-before
'build 'set-regulator-db-file-name
(lambda* (#:key inputs #:allow-other-keys)
;; Tell CRDA where to find our database.
(let ((regdb (assoc-ref inputs "wireless-regdb")))
(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")))))
(native-inputs `(("pkg-config" ,pkg-config)
("python" ,python-2)
("wireless-regdb" ,wireless-regdb)))
(inputs `(("libnl" ,libnl)))
(home-page
"https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
(synopsis "Central regulatory domain agent (CRDA) for WiFi")
(description
"The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
communication between the kernel Linux and user space for regulatory
compliance.")
(license license:copyleft-next)))
(define-public wireless-regdb
(package
(name "wireless-regdb")
(version "2017.03.07")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://kernel.org/software/network/wireless-regdb/"
"wireless-regdb-" version ".tar.xz"))
(sha256
(base32
"1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
;; We're building 'regulatory.bin' by ourselves.
(snippet '(begin
(delete-file "regulatory.bin")
#t))))
(build-system gnu-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
(add-after 'unpack 'gzip-determinism
(lambda _
(substitute* "Makefile"
(("gzip") "gzip --no-name"))
#t))
(delete 'configure))
;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
;; is computed and can be equal to 'maintainer-clean'; when that
;; happens, we can end up deleting the 'regulatory.bin' file that we
;; just built. Thus, build things sequentially.
#:parallel-build? #f
#:tests? #f ;no tests
#:make-flags (let ((out (assoc-ref %outputs "out")))
(list (string-append "PREFIX=" out)
(string-append "LSB_ID=GuixSD")
(string-append "DISTRO_PUBKEY=/dev/null")
(string-append "DISTRO_PRIVKEY=/dev/null")
(string-append "REGDB_PUBKEY=/dev/null")
;; Leave that empty so that db2bin.py doesn't try
;; to sign 'regulatory.bin'. This allows us to
;; avoid managing a key pair for the whole distro.
(string-append "REGDB_PRIVKEY=")))))
(native-inputs `(("python" ,python-2)))
(home-page
"https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
(synopsis "Wireless regulatory database")
(description
"This package contains the wireless regulatory database Central
Regulatory Database Agent (CRDA) daemon. The database contains information on
country-specific regulations for the wireless spectrum.")
(license license:isc)))
(define-public lm-sensors
(package
(name "lm-sensors")
(version "3.4.0")
(source (origin
(method url-fetch)
(uri (list (string-append
"https://github.com/groeck/lm-sensors/archive/V"
(string-join (string-split version #\.) "-")
".tar.gz")))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
(patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
(build-system gnu-build-system)
(inputs `(("rrdtool" ,rrdtool)
("perl" ,perl)
("kmod" ,kmod)
("gnuplot" ,gnuplot)))
(native-inputs `(("pkg-config" ,pkg-config)
("flex" ,flex)
("bison" ,bison)
("which" ,which)))
(outputs '("lib" ;avoid perl in closure
"out"))
(arguments
`(#:tests? #f ; no 'check' target
#:make-flags (list (string-append "PREFIX=" %output)
(string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
(string-append "INCLUDEDIR="
(assoc-ref %outputs "lib") "/include")
(string-append "MANDIR=" %output "/share/man")
(string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
#:phases
(modify-phases %standard-phases
(delete 'configure)
(add-before 'build 'patch-exec-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* "prog/detect/sensors-detect"
(("`uname")
(string-append "`" (assoc-ref inputs "coreutils")
"/bin/uname"))
(("(`|\")modprobe" all open-quote)
(string-append open-quote
(assoc-ref inputs "kmod")
"/bin/modprobe")))
(substitute* '("prog/pwm/pwmconfig"
"prog/pwm/fancontrol")
(("gnuplot")
(string-append (assoc-ref inputs "gnuplot")
"/bin/gnuplot"))
(("cat ")
(string-append (assoc-ref inputs "coreutils")
"/bin/cat "))
(("egrep ")
(string-append (assoc-ref inputs "grep")
"/bin/egrep "))
(("sed -e")
(string-append (assoc-ref inputs "sed")
"/bin/sed -e"))
(("cut -d")
(string-append (assoc-ref inputs "coreutils")
"/bin/cut -d"))
(("sleep ")
(string-append (assoc-ref inputs "coreutils")
"/bin/sleep "))
(("readlink -f")
(string-append (assoc-ref inputs "coreutils")
"/bin/readlink -f")))
#t)))))
(home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
(synopsis "Utilities to read temperature/voltage/fan sensors")
(description
"Lm-sensors is a hardware health monitoring package for Linux. It allows
you to access information from temperature, voltage, and fan speed sensors.
It works with most newer systems.")
(license license:gpl2+)))
(define-public iucode-tool
(package
(name "iucode-tool")
(version "2.3.1")
(source (origin
(method url-fetch)
(uri (string-append "https://gitlab.com/iucode-tool/releases"
"/raw/latest/iucode-tool_" version ".tar.xz"))
(sha256
(base32
"159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
(build-system gnu-build-system)
(home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
(synopsis "Manipulate Intel microcode bundles")
(description
"@command{iucode_tool} is a utility to work with microcode packages for
Intel processors. It can convert between formats, extract specific versions,
create a firmware image suitable for the Linux kernel, and more.")
;; cpuid.h is available for i686, x86_64, and ia64.
(supported-systems '("i686-linux" "x86_64-linux"))
(license license:gpl2+)))
(define-public i2c-tools
(package
(name "i2c-tools")
(version "3.1.1")
(source (origin
(method url-fetch)
(uri (string-append
"http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
version ".tar.bz2"))
(sha256
(base32
"000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no 'check' target
#:make-flags (list (string-append "prefix=" %output)
"CC=gcc")
;; no configure script
#:phases (modify-phases %standard-phases (delete 'configure))))
(inputs
`(("perl" ,perl)))
(home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
(synopsis "I2C tools for Linux")
(description
"The i2c-tools package contains a heterogeneous set of I2C tools for
Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
EEPROM decoding scripts, EEPROM programming tools, and a python module for
SMBus access.")
(license license:gpl2+)))
(define-public xsensors
(package
(name "xsensors")
(version "0.70")
(source (origin
(method url-fetch)
(uri (string-append
"http://www.linuxhardware.org/xsensors/xsensors-"
version ".tar.gz"))
(sha256
(base32
"1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
(build-system gnu-build-system)
(inputs `(("lm-sensors" ,lm-sensors "lib")
("gtk" ,gtk+-2)))
(native-inputs `(("pkg-config" ,pkg-config)))
(arguments
`(#:phases
(modify-phases %standard-phases
(add-before 'configure 'enable-deprecated
(lambda _
(substitute* "src/Makefile.in"
(("-DGDK_DISABLE_DEPRECATED") "")
(("-DGTK_DISABLE_DEPRECATED") ""))
#t))
(add-before 'configure 'remove-Werror
(lambda _
(substitute* '("configure" "src/Makefile.in")
(("-Werror") ""))
#t)))))
(home-page "http://www.linuxhardware.org/xsensors/")
(synopsis "Hardware health information viewer")
(description
"Xsensors reads data from the libsensors library regarding hardware
health such as temperature, voltage and fan speed and displays the information
in a digital read-out.")
(license license:gpl2+)))
(define-public perf
(package
(name "perf")
(version (package-version linux-libre))
(source (package-source linux-libre))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(replace 'configure
(lambda* (#:key inputs #:allow-other-keys)
(setenv "SHELL_PATH" (which "bash"))
(chdir "tools/perf")
#t)))
#:make-flags (list (string-append "prefix="
(assoc-ref %outputs "out"))
"WERROR=0"
;; By default, 'config/Makefile' uses lib64 on
;; x86_64. Work around that.
"lib=lib")
#:tests? #f)) ;no tests
(native-inputs
`(("pkg-config" ,pkg-config)
("bison" ,bison)
("flex" ,flex)
;; There are build scripts written in these languages.
("perl" ,perl)
("python" ,python-2)))
(inputs
`(("slang" ,slang) ;for the interactive TUI
;; ("newt" ,newt)
("python" ,python-2) ;'perf' links against libpython
("elfutils" ,elfutils)
("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
("libunwind" ,libunwind) ;better stack walking
("numactl" ,numactl) ;for 'perf bench numa mem'
;; Documentation.
("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
("docbook-xsl" ,docbook-xsl)
("xmlto" ,xmlto)
("asciidoc" ,asciidoc)))
(home-page "https://perf.wiki.kernel.org/")
(synopsis "Linux profiling with performance counters")
(description
"perf is a tool suite for profiling using hardware performance counters,
with support in the Linux kernel. perf can instrument CPU performance
counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
of lightweight profiling. This package contains the user-land tools and in
particular the 'perf' command.")
(license (package-license linux-libre))))
(define-public pflask
(package
(name "pflask")
(version "0.2")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/ghedo/pflask/archive/v"
version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
(build-system cmake-build-system)
(arguments
'(#:tests? #f)) ; no tests
(home-page "https://ghedo.github.io/pflask/")
(synopsis "Simple tool for creating Linux namespace containers")
(description "pflask is a simple tool for creating Linux namespace
containers. It can be used for running a command or even booting an OS inside
an isolated container, created with the help of Linux namespaces. It is
similar in functionality to chroot, although pflask provides better isolation
thanks to the use of namespaces.")
(license license:bsd-2)))
(define-public singularity
(package
(name "singularity")
(version "2.6.1")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/singularityware/singularity/"
"releases/download/" version
"/singularity-" version ".tar.gz"))
(sha256
(base32
"1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
(modules '((guix build utils)))
(snippet
'(begin
;; Do not create directories in /var.
(substitute* "Makefile.in"
(("\\$\\(MAKE\\) .*install-data-hook") ""))
;; The original source overrides PATH so that it points to
;; /bin, /usr/local/bin, etc., which obviously doesn't work
;; on Guix System. Leave PATH unchanged so we refer to the
;; installed Coreutils, grep, etc.
(substitute* "bin/singularity.in"
(("^PATH=.*" all)
(string-append "#" all "\n")))
#t))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags
(list "--disable-suid"
"--localstatedir=/var")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-reference-to-squashfs-tools
(lambda _
(substitute* "libexec/cli/build.exec"
(("if ! singularity_which mksquashfs") "if 0")
(("if ! mksquashfs")
(string-append "if ! " (which "mksquashfs"))))
#t)))))
(inputs
`(("libarchive" ,libarchive)
("python" ,python-wrapper)
("nettle" ,nettle)
("zlib" ,zlib)
("squashfs-tools" ,squashfs-tools)))
(home-page "https://singularity.lbl.gov/")
(synopsis "Container platform")
(description "Singularity is a container platform supporting a number of
container image formats. It can build SquashFS container images or import
existing Docker images. Singularity requires kernel support for container
isolation or root privileges.")
(license license:bsd-3)))
(define-public hdparm
(package
(name "hdparm")
(version "9.58")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/hdparm/hdparm/"
"hdparm-" version ".tar.gz"))
(sha256
(base32
"03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags (let ((out (assoc-ref %outputs "out")))
(list (string-append "binprefix=" out)
(string-append "manprefix=" out)
"CC=gcc"))
#:phases
(modify-phases %standard-phases
(delete 'configure)) ; no configure script
#:tests? #f)) ; no test suite
(home-page "https://sourceforge.net/projects/hdparm/")
(synopsis "View and tune ATA disk drive parameters")
(description
"@command{hdparm} is a command-line utility to control ATA controllers and
disk drives. It can increase performance and/or reliability by careful tuning
of hardware settings like power and acoustic management, DMA modes, and caching.
It can also display detailed device information, or be used as a simple
performance benchmarking tool.
@command{hdparm} provides a command line interface to various Linux kernel
interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
Translation (@dfn{SAT}) are also supported.")
(license (license:non-copyleft "file://LICENSE.TXT"))))
(define-public rfkill
(package
(name "rfkill")
(version "0.5")
(source (origin
(method url-fetch)
(uri (string-append "mirror://kernel.org/software/network/"
name "/" name "-" version ".tar.xz"))
(sha256
(base32
"0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags (list "CC=gcc"
(string-append "PREFIX=" %output))
#:phases (modify-phases %standard-phases
(delete 'configure))
#:tests? #f))
(home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
(synopsis "Tool for enabling and disabling wireless devices")
(description
"rfkill is a simple tool for accessing the rfkill device interface,
which is used to enable and disable wireless networking devices, typically
WLAN, Bluetooth and mobile broadband.")
(license (license:non-copyleft "file://COPYING"
"See COPYING in the distribution."))
;; rfkill is part of util-linux as of 2.31.
(properties `((superseded . ,util-linux)))))
(define-public acpi
(package
(name "acpi")
(version "1.7")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
version "/" name "-" version ".tar.gz"))
(sha256
(base32
"01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
(build-system gnu-build-system)
(home-page "http://acpiclient.sourceforge.net")
(synopsis "Display information on ACPI devices")
(description "@code{acpi} attempts to replicate the functionality of the
\"old\" @code{apm} command on ACPI systems, including battery and thermal
information. It does not support ACPI suspending, only displays information
about ACPI devices.")
(license license:gpl2+)))
(define-public acpid
(package
(name "acpid")
(version "2.0.31")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/acpid2/acpid-"
version ".tar.xz"))
(sha256
(base32
"1hrc0xm6q12knbgzhq0i8g2rfrkwcvh1asd7k9rs3nc5xmlwd7gw"))))
(build-system gnu-build-system)
(home-page "https://sourceforge.net/projects/acpid2/")
(synopsis "Daemon for delivering ACPI events to user-space programs")
(description
"acpid is designed to notify user-space programs of Advanced
Configuration and Power Interface (ACPI) events. acpid should be started
during the system boot, and will run as a background process. When an ACPI
event is received from the kernel, acpid will examine the list of rules
specified in /etc/acpi/events and execute the rules that match the event.")
(license license:gpl2+)))
(define-public sysfsutils
(package
(name "sysfsutils")
(version "2.1.0")
(source
(origin
(method url-fetch)
(uri
(string-append
"mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
version ".tar.gz"))
(sha256
(base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
(build-system gnu-build-system)
(home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
(synopsis "System utilities based on Linux sysfs")
(description
"These are a set of utilities built upon sysfs, a virtual file system in
Linux kernel versions 2.5+ that exposes a system's device tree. The package
also contains the libsysfs library.")
;; The library is under lgpl2.1+ (all files say "or any later version").
;; The rest is mostly gpl2, with a few files indicating gpl2+.
(license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
(define-public sysfsutils-1
(package
(inherit sysfsutils)
(version "1.3.0")