gnu: Add i2c-tools.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
index 2c74ff8..f88be6d 100644 (file)
@@ -3,6 +3,8 @@
 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +29,7 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages ncurses)
@@ -195,7 +198,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM."
      #f)))
 
 (define-public linux-libre
-  (let* ((version "3.18.3")
+  (let* ((version "3.18.7")
          (build-phase
           '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
              ;; Apply the neat patch.
@@ -268,7 +271,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM."
              (uri (linux-libre-urls version))
              (sha256
               (base32
-               "1qw8b4kc18s7qy314cm4mbg6hmyfpya10awxda78fa7g830pay8h"))))
+               "113r2dzmiwlchp5b3hyjyx91jysx5j4hhxjw45gaky5nj9pax2rh"))))
     (build-system gnu-build-system)
     (native-inputs `(("perl" ,perl)
                      ("bc" ,bc)
@@ -380,41 +383,43 @@ providing the system administrator with some help in common tasks.")
 (define-public util-linux
   (package
     (name "util-linux")
-    (version "2.21")
+    (version "2.25.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://kernel.org/linux/utils/"
-                                  name "/v" version "/"
-                                  name "-" version ".2" ".tar.xz"))
+                                  name "/v" (version-major+minor version) "/"
+                                  name "-" version ".tar.xz"))
               (sha256
                (base32
-                "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
-              (patches (list (search-patch "util-linux-perl.patch")))
+                "1miwwdq1zwvhf0smrxx3fjddq3mz22s8rc5cw54s7x3kbdqpyig0"))
+              (patches (list (search-patch "util-linux-tests.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))))))
+               ;; We take the 'logger' program from GNU Inetutils and 'kill'
+               ;; from GNU Coreutils.
+               '(substitute* "configure"
+                  (("build_logger=yes") "build_logger=no")
+                  (("build_kill=yes") "build_kill=no")))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags '("--disable-use-tty-group"
                            "--enable-ddate")
-       #:phases (alist-cons-after
-                 'install 'patch-chkdupexe
-                 (lambda* (#:key outputs #:allow-other-keys)
-                   (let ((out (assoc-ref outputs "out")))
-                     (substitute* (string-append out "/bin/chkdupexe")
-                       ;; Allow 'patch-shebang' to do its work.
-                       (("@PERL@") "/bin/perl"))))
+       #:phases (alist-cons-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))
                  %standard-phases)))
     (inputs `(("zlib" ,guix:zlib)
               ("ncurses" ,ncurses)))
     (native-inputs
-     `(("perl" ,perl)))
+     `(("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
@@ -441,7 +446,11 @@ providing the system administrator with some help in common tasks.")
     (build-system gnu-build-system)
     (inputs `(("ncurses" ,ncurses)))
     (arguments
-     '(#:phases (alist-replace
+     '(#:modules ((guix build utils)
+                  (guix build gnu-build-system)
+                  (srfi srfi-1)
+                  (srfi srfi-26))
+       #:phases (alist-replace
                  'configure
                  (lambda* (#:key outputs #:allow-other-keys)
                    ;; No `configure', just a single Makefile.
@@ -463,6 +472,13 @@ providing the system administrator with some help in common tasks.")
                             (system* "make" "install"
                                      (string-append "DESTDIR=" out)))
 
+                           ;; Remove commands and man pages redundant with
+                           ;; Coreutils.
+                           (let ((dup (append-map (cut find-files out <>)
+                                                  '("^kill" "^uptime"))))
+                             (for-each delete-file dup)
+                             #t)
+
                            ;; Sanity check.
                            (zero?
                             (system* (string-append out "/bin/ps")
@@ -525,10 +541,12 @@ slabtop, and skill.")
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("texinfo" ,texinfo)))     ;for the libext2fs Info manual
     (arguments
-     '(;; The 'blkid' command and library are already provided by util-linux,
-       ;; which is the preferred source for them (see, e.g.,
+     '(;; util-linux is not the preferred source for some of the libraries and
+       ;; commands, so disable them (see, e.g.,
        ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
-       #:configure-flags '("--disable-blkid"
+       #:configure-flags '("--disable-libblkid"
+                           "--disable-libuuid" "--disable-uuidd"
+                           "--disable-fsck"
 
                            ;; Install libext2fs et al.
                            "--enable-elf-shlibs")
@@ -664,6 +682,30 @@ images more compressible.")
 trace of all the system calls made by a another process/program.")
     (license bsd-3)))
 
+(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 "http://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 gpl2+)))
+
 (define-public alsa-lib
   (package
     (name "alsa-lib")
@@ -835,7 +877,11 @@ manpages.")
               (list (search-patch "net-tools-bitrot.patch")))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases (alist-cons-after
+     '(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (srfi srfi-1)
+                  (srfi srfi-26))
+       #:phases (alist-cons-after
                  'unpack 'patch
                  (lambda* (#:key inputs #:allow-other-keys)
                    (define (apply-patch file)
@@ -846,7 +892,6 @@ manpages.")
                      (format #t "applying Debian patch set '~a'...~%"
                              patch.gz)
                      (system (string-append "gunzip < " patch.gz " > the-patch"))
-                     (pk 'here)
                      (and (apply-patch "the-patch")
                           (for-each apply-patch
                                     (find-files "debian/patches"
@@ -865,7 +910,18 @@ manpages.")
                       ;; definition.
                       (substitute* '("config.make" "config.h")
                         (("^.*HAVE_AFDECnet.*$") ""))))
-                  %standard-phases))
+                  (alist-cons-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))
+                   %standard-phases)))
 
        ;; Binaries that depend on libnet-tools.a don't declare that
        ;; dependency, making it parallel-unsafe.
@@ -1432,7 +1488,7 @@ from the module-init-tools project.")
   ;; The post-systemd fork, maintained by Gentoo.
   (package
     (name "eudev")
-    (version "1.10")
+    (version "2.1.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -1440,7 +1496,7 @@ from the module-init-tools project.")
                     version ".tar.gz"))
               (sha256
                (base32
-                "1l907bvz6dcykvaq8d4iklvfpb9fyrnh1a29g3c28gkx2hlyn7j0"))
+                "0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva"))
               (patches (list (search-patch "eudev-rules-directory.patch")))
               (modules '((guix build utils)))
               (snippet
@@ -1477,7 +1533,18 @@ from the module-init-tools project.")
 
                                ;; Work around undefined reference to
                                ;; 'mq_getattr' in sc-daemon.c.
-                               "LDFLAGS=-lrt")))
+                               "LDFLAGS=-lrt")
+       #:phases 
+       (alist-cons-before
+        'build 'pre-build
+        ;; The program 'g-ir-scanner' (part of the package
+        ;; 'gobject-introspection'), to generate .gir files, makes some
+        ;; library pre-processing.  During that phase it looks for the C
+        ;; compiler as either 'cc' or as defined by the environment variable
+        ;; 'CC' (with code in 'giscanner/dumper.py').
+        (lambda* _
+          (setenv "CC" "gcc"))
+        %standard-phases)))
     (home-page "http://www.gentoo.org/proj/en/eudev/")
     (synopsis "Userspace device management")
     (description "Udev is a daemon which dynamically creates and removes
@@ -1657,6 +1724,34 @@ you to access information from temperature, voltage, and fan speed sensors.
 It works with most newer systems.")
     (license gpl2+)))
 
+(define-public i2c-tools
+  (package
+    (name "i2c-tools")
+    (version "3.1.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://dl.lm-sensors.org/i2c-tools/releases/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 (alist-delete 'configure %standard-phases)))
+    (home-page "http://www.lm-sensors.org/wiki/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 gpl2+)))
+
 (define-public xsensors
   (package
     (name "xsensors")
@@ -1768,3 +1863,51 @@ 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)))
+
+(define-public hdparm
+  (package
+    (name "hdparm")
+    (version "9.45")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name "/"
+                                  name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
+    (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 (alist-delete 'configure %standard-phases)
+       #:tests? #f))  ; no test suite
+    (home-page "http://sourceforge.net/projects/hdparm/")
+    (synopsis "tune hard disk parameters for high performance")
+    (description
+     "Get/set device parameters for Linux SATA/IDE drives.  It's primary use
+is for enabling irq-unmasking and IDE multiplemode.")
+    (license (bsd-style "file://LICENSE.TXT"))))
+
+(define-public acpid
+  (package
+    (name "acpid")
+    (version "2.0.23")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/acpid2/acpid-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
+    (build-system gnu-build-system)
+    (home-page "http://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 gpl2+)))