;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
+;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module ((guix licenses)
#:hide (zlib))
#:use-module (gnu packages)
- #:use-module ((gnu packages compression)
- #:renamer (symbol-prefix-proc 'guix:))
+ #:use-module ((gnu packages compression) #:prefix guix:)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages flex)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages gperf)
#:use-module (gnu packages libusb)
#:use-module (gnu packages ncurses)
- #:use-module (gnu packages bdb)
+ #:use-module (gnu packages pciutils)
+ #:use-module (gnu packages databases)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages algebra)
#:use-module (gnu packages gettext)
+ #:use-module (gnu packages glib)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages attr)
#:use-module (gnu packages xml)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages texinfo)
+ #:use-module (gnu packages check)
+ #:use-module (gnu packages maths)
+ #:use-module (gnu packages which)
+ #:use-module (gnu packages rrdtool)
+ #:use-module (gnu packages elf)
+ #:use-module (gnu packages gtk)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system cmake)
- #:use-module (guix build-system python))
+ #:use-module (guix build-system python)
+ #:use-module (guix build-system trivial)
+ #: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
version ".tar.bz2"))
(sha256
(base32
- "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))))
+ "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
+ (patches
+ (list (search-patch "module-init-tools-moduledir.patch")))))
(build-system gnu-build-system)
(arguments
;; FIXME: The upstream tarball lacks man pages, and building them would
`insmod', `lsmod', and more.")
(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 (kernel-config system)
+ "Return the absolute file name of the Linux-Libre build configuration file
+for SYSTEM, or #f if there is no configuration for SYSTEM."
+ (define (lookup file)
+ (let ((file (string-append "gnu/packages/" file)))
+ (search-path %load-path file)))
+
+ (match system
+ ("i686-linux"
+ (lookup "linux-libre-i686.conf"))
+ ("x86_64-linux"
+ (lookup "linux-libre-x86_64.conf"))
+ (_
+ #f)))
+
(define-public linux-libre
- (let* ((version "3.13")
+ (let* ((version "3.18.2")
(build-phase
- '(lambda* (#:key system #:allow-other-keys #:rest args)
+ '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
+ ;; Apply the neat patch.
+ (system* "patch" "-p1" "--batch"
+ "-i" (assoc-ref inputs "patch/freedo+gnu"))
+
(let ((arch (car (string-split system #\-))))
(setenv "ARCH"
(cond ((string=? arch "i686") "i386")
(else arch)))
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
- (let ((build (assoc-ref %standard-phases 'build)))
- (and (zero? (system* "make" "defconfig"))
- (begin
- (format #t "enabling additional modules...~%")
- (substitute* ".config"
- (("^# CONFIG_CIFS.*$")
- "CONFIG_CIFS=m\n")
- (("^# CONFIG_FUSE_FS.*$")
- "CONFIG_FUSE_FS=m\n")
- (("^# CONFIG_([[:graph:]]*)VIRTIO([[:graph:]]*) .*$"
- _ before after)
- (string-append "CONFIG_" before "VIRTIO"
- after "=m\n")))
-
- ;; XXX: For some reason, some virtio modules need to be
- ;; explicitly added.
- (let ((port (open-file ".config" "a")))
- (display (string-append "CONFIG_NET_9P_VIRTIO=m\n"
- "CONFIG_NET_9P=m\n"
- "CONFIG_9P_FS=m\n"
- "CONFIG_VIRTIO_NET=m\n"
- "CONFIG_VIRTIO_BLK=m\n"
- "CONFIG_VIRTIO_BALLOON=m\n")
- port)
- (close-port port))
-
- (zero? (system* "make" "oldconfig")))
-
- ;; Call the default `build' phase so `-j' is correctly
- ;; passed.
- (apply build #:make-flags "all" args)))))
+ (let ((build (assoc-ref %standard-phases 'build))
+ (config (assoc-ref inputs "kconfig")))
+
+ ;; Use the architecture-specific config if available, and
+ ;; 'defconfig' otherwise.
+ (if config
+ (begin
+ (copy-file config ".config")
+ (chmod ".config" #o666))
+ (system* "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")))
+ (display (string-append "CONFIG_NET_9P=m\n"
+ "CONFIG_NET_9P_VIRTIO=m\n"
+ "CONFIG_VIRTIO_BLK=m\n"
+ "CONFIG_VIRTIO_NET=m\n"
+ ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
+ "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
+ "CONFIG_VIRTIO_PCI=m\n"
+ "CONFIG_VIRTIO_BALLOON=m\n"
+ "CONFIG_VIRTIO_MMIO=m\n"
+ "CONFIG_FUSE_FS=m\n"
+ "CONFIG_CIFS=m\n"
+ "CONFIG_9P_FS=m\n")
+ port)
+ (close-port port))
+
+ (zero? (system* "make" "oldconfig"))
+
+ ;; Call the default `build' phase so `-j' is correctly
+ ;; passed.
+ (apply build #:make-flags "all" args))))
(install-phase
`(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(string-append "MODULE_DIR=" moddir)
(string-append "INSTALL_PATH=" out)
(string-append "INSTALL_MOD_PATH=" out)
+ "INSTALL_MOD_STRIP=1"
"modules_install"))))))
(package
(name "linux-libre")
(uri (linux-libre-urls version))
(sha256
(base32
- "15pdizzxnnvpxmdb1lbi01kpingmdvj17b01vzbyjymi4vwfws3f"))))
+ "0wji58x0zci13a499v6kbz3pyhs2gk6wsbv3fia8valxgbcppyhp"))))
(build-system gnu-build-system)
(native-inputs `(("perl" ,perl)
("bc" ,bc)
- ("module-init-tools" ,module-init-tools)))
+ ("module-init-tools" ,module-init-tools)
+ ("patch/freedo+gnu" ,%boot-logo-patch)
+
+ ,@(let ((conf (kernel-config (or (%current-target-system)
+ (%current-system)))))
+ (if conf
+ `(("kconfig" ,conf))
+ '()))))
+
+ ;; XXX: Work around an ICE with our patched GCC 4.8.3 while compiling
+ ;; 'drivers/staging/vt6656/michael.o': <http://hydra.gnu.org/build/96389/>.
+ (inputs `(("gcc" ,gcc-4.9)))
+
(arguments
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(inputs `(("ncurses" ,ncurses)))
(home-page "http://psmisc.sourceforge.net/")
(synopsis
- "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
+ "Small utilities that use the proc filesystem")
(description
"This PSmisc package is a set of some small useful utilities that
-use the proc filesystem. We're not about changing the world, but
+use the proc filesystem. We're not about changing the world, but
providing the system administrator with some help in common tasks.")
(license gpl2+)))
(package
(name "util-linux")
(version "2.21")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "mirror://kernel.org/linux/utils/"
- name "/v" version "/"
- name "-" version ".2" ".tar.xz"))
- (sha256
- (base32
- "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://kernel.org/linux/utils/"
+ name "/v" version "/"
+ name "-" version ".2" ".tar.xz"))
+ (sha256
+ (base32
+ "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
+ (patches (list (search-patch "util-linux-perl.patch")))
+ (modules '((guix build utils)))
+ (snippet
+ ;; We take the 'logger' program from GNU Inetutils, so remove
+ ;; it from here.
+ '(substitute* "misc-utils/Makefile.in"
+ (("PROGRAMS =(.*) logger(.*)" _ before after)
+ (string-append "PROGRAMS =" before " " after))
+ (("MANS =(.*) logger\\.1(.*)" _ before after)
+ (string-append "MANS =" before " " after))))))
(build-system gnu-build-system)
(arguments
- `(#:configure-flags '("--disable-use-tty-group")
+ `(#:configure-flags '("--disable-use-tty-group"
+ "--enable-ddate")
#:phases (alist-cons-after
'install 'patch-chkdupexe
(lambda* (#:key outputs #:allow-other-keys)
(home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
(synopsis "Collection of utilities for the Linux kernel")
(description
- "util-linux is a random collection of utilities for the Linux kernel.")
+ "Util-linux is a random collection of utilities for the Linux kernel.")
;; Note that util-linux doesn't use the same license for all the
;; code. GPLv2+ is the default license for a code without an
(home-page "http://procps.sourceforge.net/")
(synopsis "Utilities that give information about processes")
(description
- "procps is the package that has a bunch of small useful utilities
+ "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.")
"0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
(build-system gnu-build-system)
(inputs `(("util-linux" ,util-linux)))
- (native-inputs `(("pkg-config" ,pkg-config)))
+ (native-inputs `(("pkg-config" ,pkg-config)
+ ("texinfo" ,texinfo))) ; for the libext2fs Info manual
(arguments
- '(#:phases (alist-cons-before
+ '(;; The 'blkid' command and library are already provided by util-linux,
+ ;; which is the preferred source for them (see, e.g.,
+ ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
+ #:configure-flags '("--disable-blkid")
+
+ #:phases (alist-cons-before
'configure 'patch-shells
(lambda _
(substitute* "configure"
lgpl2.0 ; libext2fs
x11)))) ; libuuid
+(define-public e2fsck/static
+ (package
+ (name "e2fsck-static")
+ (version (package-version e2fsprogs))
+ (build-system trivial-build-system)
+ (source #f)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils)
+ (ice-9 ftw)
+ (srfi srfi-26))
+
+ (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
+ "/sbin"))
+ (bin (string-append (assoc-ref %outputs "out") "/sbin")))
+ (mkdir-p bin)
+ (with-directory-excursion bin
+ (for-each (lambda (file)
+ (copy-file (string-append source "/" file)
+ file)
+ (remove-store-references file)
+ (chmod file #o555))
+ (scandir source (cut string-prefix? "fsck." <>))))))))
+ (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
+ (synopsis "Statically-linked fsck.* commands from e2fsprogs")
+ (description
+ "This package provides statically-linked command of fsck.ext[234] taken
+from the e2fsprogs package. It is meant to be used in initrds.")
+ (home-page (package-home-page e2fsprogs))
+ (license (package-license e2fsprogs))))
+
(define-public strace
(package
(name "strace")
(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"))
(home-page
"http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
(synopsis
- "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
+ "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.
version ".tar.bz2"))
(sha256
(base32
- "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
+ "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
+ (patches
+ (list (search-patch "net-tools-bitrot.patch")))))
(build-system gnu-build-system)
(arguments
'(#:phases (alist-cons-after
#:parallel-build? #f
#:tests? #f ; no test suite
- #:make-flags (list "CC=gcc"
- (string-append "BASEDIR="
- (assoc-ref %outputs "out")))))
+ #: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")))))
;; Use the big Debian patch set (the thing does not even compile out of
;; the box.)
(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
+ "Libcap2 provides a programming interface to POSIX capabilities on
Linux-based operating systems.")
;; License is BSD-3 or GPLv2, at the user's choice.
(define-public libnl
(package
(name "libnl")
- (version "3.2.13")
+ (version "3.2.25")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(sha256
(base32
- "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
+ "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
(build-system gnu-build-system)
(native-inputs `(("flex" ,flex) ("bison" ,bison)))
(home-page "http://www.infradead.org/~tgr/libnl/")
;; 'nl-addr-add.c'), so the result is GPLv2-only.
(license gpl2)))
+(define-public iw
+ (package
+ (name "iw")
+ (version "3.17")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://www.kernel.org/pub/software/network/iw/iw-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
+ (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 (alist-delete 'configure %standard-phases)))
+ (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
+ (synopsis "Tool for configuring wireless devices")
+ (description
+ "iw is a new nl80211 based CLI configuration utility for wireless
+devices. It replaces 'iwconfig', which is deprecated.")
+ (license isc)))
+
(define-public powertop
(package
(name "powertop")
(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")
- "/etc/udev"))
+ "/lib/udev/rules.d"))
#:phases (alist-cons-before
'build 'set-file-names
(lambda* (#:key inputs #:allow-other-keys)
"/bin/" maybe-u "mount")))
(substitute* '("util/mount.fuse.c")
(("/bin/sh")
- (which "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\\\"")))
%standard-phases)))
(home-page "http://fuse.sourceforge.net/")
(synopsis "Support file systems implemented in user space")
UnionFS-FUSE additionally supports copy-on-write.")
(license bsd-3)))
+(define fuse-static
+ (package (inherit fuse)
+ (name "fuse-static")
+ (source (origin (inherit (package-source fuse))
+ (modules '((guix build utils)))
+ (snippet
+ ;; 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/")
+ "")))))))
+
(define-public unionfs-fuse/static
(package (inherit unionfs-fuse)
(synopsis "User-space union file system (statically linked)")
libs " dl)"))))))
(arguments
'(#:tests? #f
- #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")))))
+ #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
+ #:phases (alist-cons-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)))
+ %standard-phases)))
+ (inputs `(("fuse" ,fuse-static)))))
+
+(define-public sshfs-fuse
+ (package
+ (name "sshfs-fuse")
+ (version "2.5")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("fuse" ,fuse)
+ ("glib" ,glib)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (home-page "http://fuse.sourceforge.net/sshfs.html")
+ (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 gpl2+)))
+
+(define-public numactl
+ (package
+ (name "numactl")
+ (version "2.0.9")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
+ version
+ ".tar.gz"))
+ (sha256
+ (base32
+ "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:phases (alist-replace
+ 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; There's no 'configure' script, just a raw makefile.
+ (substitute* "Makefile"
+ (("^prefix := .*$")
+ (string-append "prefix := " (assoc-ref outputs "out")
+ "\n"))
+ (("^libdir := .*$")
+ ;; By default the thing tries to install under
+ ;; $prefix/lib64 when on a 64-bit platform.
+ (string-append "libdir := $(prefix)/lib\n"))))
+ %standard-phases)
+
+ #:make-flags (list
+ ;; By default the thing tries to use 'cc'.
+ "CC=gcc"
+
+ ;; Make sure programs have an RPATH so they can find
+ ;; libnuma.so.
+ (string-append "LDLIBS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib"))
+
+ ;; There's a 'test' target, but it requires NUMA support in the kernel
+ ;; to run, which we can't assume to have.
+ #:tests? #f))
+ (home-page "http://oss.sgi.com/projects/libnuma/")
+ (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 gpl2 ; programs
+ lgpl2.1)))) ; library
+
+(define-public kbd
+ (package
+ (name "kbd")
+ (version "2.0.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
+ (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"))))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:phases (alist-cons-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")))))
+ (alist-cons-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"))))
+ %standard-phases))))
+ (inputs `(("check" ,check)
+ ("gzip" ,guix:gzip)
+ ("bzip2" ,guix:bzip2)
+ ("pam" ,linux-pam)))
+ (native-inputs `(("pkg-config" ,pkg-config)))
+ (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
+ (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 gpl2+)))
+
+(define-public inotify-tools
+ (package
+ (name "inotify-tools")
+ (version "3.13")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://sourceforge/inotify-tools/inotify-tools/"
+ version "/inotify-tools-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
+ (build-system gnu-build-system)
+ (home-page "http://inotify-tools.sourceforge.net/")
+ (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 gpl2+)))
+
+(define-public kmod
+ (package
+ (name "kmod")
+ (version "17")
+ (source (origin
+ (method url-fetch)
+ (uri
+ (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
+ "kmod-" version ".tar.xz"))
+ (sha256
+ (base32
+ "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
+ (patches (list (search-patch "kmod-module-directory.patch")))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("xz" ,guix:xz)
+ ("zlib" ,guix:zlib)))
+ (arguments
+ `(#:tests? #f ; FIXME: Investigate test failures
+ #:configure-flags '("--with-xz" "--with-zlib")
+ #:phases (alist-cons-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"))))
+ %standard-phases)))
+ (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 gpl2+))) ; library under lgpl2.1+
+
+(define-public udev
+ ;; The last pre-systemd version.
+ (package
+ (name "udev")
+ (version "182")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
+ (patches (list (search-patch "udev-gir-libtool.patch")))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags (list (string-append
+ "--with-pci-ids-path="
+ (assoc-ref %build-inputs "pciutils")
+ "/share/pci.ids.gz")
+
+ "--with-firmware-path=/no/firmware"
+
+ ;; Work around undefined reference to
+ ;; 'mq_getattr' in sc-daemon.c.
+ "LDFLAGS=-lrt")))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("gperf" ,gperf)
+ ("glib" ,glib "bin") ; glib-genmarshal, etc.
+ ("perl" ,perl) ; for the tests
+ ("python" ,python-2))) ; ditto
+ (inputs
+ `(("kmod" ,kmod)
+ ("pciutils" ,pciutils)
+ ("usbutils" ,usbutils)
+ ("util-linux" ,util-linux)
+ ("glib" ,glib)
+ ("gobject-introspection" ,gobject-introspection)))
+ (home-page "http://www.freedesktop.org/software/systemd/libudev/")
+ (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 gpl2+))) ; libudev is under lgpl2.1+
+
+(define-public eudev
+ ;; The post-systemd fork, maintained by Gentoo.
+ (package (inherit udev)
+ (name "eudev")
+ (version "1.10")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://dev.gentoo.org/~blueness/eudev/eudev-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1l907bvz6dcykvaq8d4iklvfpb9fyrnh1a29g3c28gkx2hlyn7j0"))
+ (patches (list (search-patch "eudev-rules-directory.patch")))
+ (modules '((guix build utils)))
+ (snippet
+ ;; 'configure' checks uses <linux/btrfs.h> as an indication of
+ ;; whether Linux headers are available, but it doesn't actually
+ ;; use it, and our 'linux-libre-headers' package doesn't
+ ;; provide it. So just remove that.
+ '(substitute* "configure"
+ (("linux/btrfs\\.h")
+ "")))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments udev)
+ ((#:configure-flags flags)
+ `(cons "--enable-libkmod" ,flags))))
+ (home-page "http://www.gentoo.org/proj/en/eudev/")))
+
+(define-public lvm2
+ (package
+ (name "lvm2")
+ (version "2.02.109")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
+ version ".tgz"))
+ (sha256
+ (base32
+ "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
+ (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@"))))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("procps" ,procps))) ;tests use 'pgrep'
+ (inputs
+ `(("udev" ,udev)))
+ (arguments
+ '(#:phases (alist-cons-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"))
+ %standard-phases)
+
+ #:configure-flags (list (string-append "--sysconfdir="
+ (assoc-ref %outputs "out")
+ "/etc/lvm")
+ "--enable-udev_sync"
+ "--enable-udev_rules"
+
+ ;; Make sure programs such as 'dmsetup' can
+ ;; find libdevmapper.so.
+ (string-append "LDFLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out")
+ "/lib"))
+
+ ;; The tests use 'mknod', which requires root access.
+ #:tests? #f))
+ (home-page "http://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 gpl2 lgpl2.1))))
+
+(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"))
+ (modules '((guix build utils)))
+ (snippet
+ ;; Install the manual pages in the right place.
+ '(substitute* "Makefile"
+ (("INSTALL_MAN= .*")
+ "INSTALL_MAN= $(PREFIX)/share/man")))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases (alist-replace
+ 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (setenv "PREFIX" (assoc-ref outputs "out")))
+ %standard-phases)
+ #:tests? #f))
+ (synopsis "Tools for manipulating Linux Wireless Extensions")
+ (description "Wireless Tools are used to manipulate the Linux Wireless
+Extensions. The Wireless Extension is an interface allowing you to set
+Wireless LAN specific parameters and get the specific stats.")
+ (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
+ (license gpl2+)))
+
+(define-public lm-sensors
+ (package
+ (name "lm-sensors")
+ (version "3.3.5")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
+ version ".tar.bz2"))
+ (sha256
+ (base32
+ "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
+ (patches (list (search-patch "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)))
+ (arguments
+ `(#:tests? #f ; no 'check' target
+ #:make-flags (list (string-append "PREFIX=" %output)
+ (string-append "ETCDIR=" %output "/etc")
+ (string-append "MANDIR=" %output "/share/man"))
+ #:phases
+ (alist-delete
+ 'configure
+ (alist-cons-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"))))
+ %standard-phases))))
+ (home-page "http://www.lm-sensors.org/")
+ (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 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)
+ ("gtk" ,gtk+-2)))
+ (native-inputs `(("pkg-config" ,pkg-config)))
+ (arguments
+ `(#:phases (alist-cons-before
+ 'configure 'enable-deprecated
+ (lambda _
+ (substitute* "src/Makefile.in"
+ (("-DGDK_DISABLE_DEPRECATED") "")
+ (("-DGTK_DISABLE_DEPRECATED") "")))
+ (alist-cons-before
+ 'configure 'remove-Werror
+ (lambda _
+ (substitute* '("configure" "src/Makefile.in")
+ (("-Werror") "")))
+ %standard-phases))))
+ (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 gpl2+)))
+
+(define-public perf
+ (package
+ (name "perf")
+ (version (package-version linux-libre))
+ (source (package-source linux-libre))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:phases (alist-replace
+ 'configure
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "SHELL_PATH" (which "bash"))
+ (chdir "tools/perf"))
+ %standard-phases)
+ #:make-flags (list (string-append "DESTDIR="
+ (assoc-ref %outputs "out"))
+ "WERROR=0")
+ #: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)
+ ;; ("newt" ,newt)
+ ("elfutils" ,elfutils)
+
+ ;; FIXME: Documentation.
+ ;; ("libxslt" ,libxslt)
+ ;; ("docbook-xml" ,docbook-xml)
+ ;; ("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"))
+ (sha256
+ (base32
+ "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:tests? #f)) ; no tests
+ (home-page "http://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 bsd-2)))