gnu: libdrm: Switch to meson-build-system.
[jackhill/guix/guix.git] / gnu / packages / disk.scm
index bdd24a3..006a381 100644 (file)
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
@@ -12,6 +12,7 @@
 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages disk)
-  #:use-module ((guix licenses) #:prefix license:)
-  #:use-module (guix packages)
-  #:use-module (guix download)
-  #:use-module (guix build-system gnu)
-  #:use-module (guix build-system trivial)
-  #:use-module (guix build-system python)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages c)
   #:use-module (gnu packages check)
-  #:use-module (gnu packages databases)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages crypto)
+  #:use-module (gnu packages cryptsetup)
   #:use-module (gnu packages docbook)
+  #:use-module (gnu packages documentation)
+  #:use-module (gnu packages elf)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
-  #:use-module (gnu packages gtk)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages gnuzilla)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages guile)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
-  #:use-module (gnu packages guile)
-  #:use-module (gnu packages compression)
+  #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages vim)
   #:use-module (gnu packages w3m)
-  #:use-module (gnu packages xml))
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
+  #:use-module (guix build-system trivial)
+  #:use-module (guix build-system scons)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages))
 
 (define-public parted
   (package
@@ -65,6 +80,7 @@
               (method url-fetch)
               (uri (string-append "mirror://gnu/parted/parted-"
                                   version ".tar.xz"))
+              (patches (search-patches "parted-glibc-compat.patch"))
               (sha256
                (base32
                 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
@@ -138,7 +154,7 @@ tables, and it understands a variety of different formats.")
 (define-public gptfdisk
   (package
     (name "gptfdisk")
-    (version "1.0.3")
+    (version "1.0.4")
     (source
      (origin
       (method url-fetch)
@@ -146,7 +162,7 @@ tables, and it understands a variety of different formats.")
                           version "/" name "-" version ".tar.gz"))
       (sha256
        (base32
-        "0p0vr67lnqdsgdv2y144xmjqa1a2nijrrd3clc8dc2f46pn5mzc9"))))
+        "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
     (build-system gnu-build-system)
     (inputs
      `(("gettext" ,gettext-minimal)
@@ -184,15 +200,14 @@ scheme.")
 (define-public ddrescue
   (package
     (name "ddrescue")
-    (version "1.23")
+    (version "1.24")
     (source
      (origin
       (method url-fetch)
       (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
                           version ".tar.lz"))
       (sha256
-       (base32
-        "13cd6c0x91zq10vdlyl6r5rib47bmsn5sshmkin3igwj8pa2vbm9"))))
+       (base32 "11qh0bbzf00mfb4yq35gnv5m260k4d7q9ixklry6bqvhvvp3ypab"))))
     (build-system gnu-build-system)
     (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
     (synopsis "Data recovery utility")
@@ -325,14 +340,14 @@ and can dramatically shorten the lifespan of the drive if left unchecked.")
 (define-public gparted
   (package
     (name "gparted")
-    (version "0.31.0")
+    (version "0.33.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
                            version "/gparted-" version ".tar.gz"))
        (sha256
-        (base32 "1fh7rpgb4xxdhgyjsirb83zvjfc5mfngb8a1pjbv7r6r6jj4jyrv"))))
+        (base32 "1ml1ky3s75lbxr91p608q3prsdh9x899mw7nbgk252pqhg4vh8sh"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f                      ; tests require a network connection
@@ -384,34 +399,31 @@ systems.  Output format is completely customizable.")
 (define-public f3
   (package
     (name "f3")
-    (version "6.0")
+    (version "7.1")
     (source
      (origin
-      (method url-fetch)
-      (uri (string-append "https://github.com/AltraMayor/f3/archive/"
-                          "v" version ".tar.gz"))
-      (file-name (string-append name "-" version ".tar.gz"))
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/AltraMayor/f3.git")
+            (commit (string-append "v" version))))
+      (file-name (git-file-name name version))
       (sha256
        (base32
-        "1mgbzc1swvgil45md1336j0aqkmkhwmpxical0ln5g09b2qxsanp"))))
+        "0zglsmz683jg7f9wc6vmgljyg9w87pbnjw5x4w6x02w8233zvjqf"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f ; no check target
+     '(#:tests? #f                      ; no check target
        #:make-flags (list "CC=gcc"
                           (string-append "PREFIX=" %output))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before 'build 'fix-makefile
-           (lambda _
-             (substitute* "Makefile"
-               ;; Install without setting owner and group
-               (("\\$\\(INSTALL\\) -oroot -groot ") "$(INSTALL) ")
-               ;; also build and install experimental tools
-               (("^all: ") "all: $(EXPERIMENTAL_TARGETS) ")
-               (("^install: ") "install-all: ")
-               (("^install-experimental: ") "install: install-all "))
-             #t)))))
+         (delete 'configure)            ; no configure script
+         (add-after 'build 'build-extra
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "extra" make-flags)))
+         (add-after 'build 'install-extra
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "install-extra" make-flags))))))
     (inputs
      `(("eudev" ,eudev)
        ("parted" ,parted)))
@@ -466,16 +478,16 @@ a card with a smaller capacity than stated.")
 (define-public duperemove
   (package
     (name "duperemove")
-    (version "0.11")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/markfasheh/duperemove/archive/v"
-                    version ".tar.gz"))
-              (sha256
-               (base32
-                "0rjmmh42yqw9a5j6sp31cqwxk3s97dsi4xz0wpxpllj7bsp3aiw5"))
-              (file-name (string-append name "-" version ".tar.gz"))))
+    (version "0.11.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/markfasheh/duperemove.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"))
+       (file-name (git-file-name name version))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -509,24 +521,25 @@ Duperemove can also take input from the @command{fdupes} program.")
 (define-public ranger
   (package
     (name "ranger")
-    (version "1.9.1")
+    (version "1.9.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://ranger.github.io/"
                                   "ranger-" version ".tar.gz"))
               (sha256
                (base32
-                "1lnzkrxcnlwnyi3z0v8ybyp8d5rm26qm35rr68kbs2lbs06inha0"))))
+                "12kbsqakbxs09y0x8hy66mmaf72rk0p850x7ryk2ghkq7wfin78f"))))
     (build-system python-build-system)
     (inputs
      `(("w3m" ,w3m)))
-    (native-inputs                      ;for tests
-     `(("python-pytest" ,python-pytest)
-       ("python-pylint" ,python-pylint)
-       ("python-flake8" ,python-flake8)
-       ("which" ,which)))
+    (native-inputs
+     `(("which" ,which)
+
+       ;; For tests.
+       ("python-pytest" ,python-pytest)))
     (arguments
-     '(#:test-target "test"
+     '( ;; The 'test' target runs developer tools like pylint, which fail.
+       #:test-target "test_pytest"
        #:phases
        (modify-phases %standard-phases
          (add-after 'configure 'wrap-program
@@ -539,7 +552,11 @@ Duperemove can also take input from the @command{fdupes} program.")
                                    "/libexec/w3m/w3mimgdisplay")))
                (wrap-program ranger
                  `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
-               #t))))))
+               #t)))
+         (replace 'check
+           ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
+           (lambda* (#:key test-target #:allow-other-keys)
+             (invoke "make" test-target))))))
     (home-page "https://ranger.github.io/")
     (synopsis "Console file manager")
     (description "ranger is a console file manager with Vi key bindings.  It
@@ -547,3 +564,259 @@ provides a minimalistic and nice curses interface with a view on the directory
 hierarchy.  It ships with @code{rifle}, a file launcher that is good at
 automatically finding out which program to use for what file type.")
     (license license:gpl3)))
+
+(define-public volume-key
+  (package
+    (name "volume-key")
+    (version "0.3.12")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("util-linux" ,util-linux)
+       ("swig" ,swig)
+       ("python" ,python-3)))           ; used to generate the Python bindings
+    (inputs
+     `(("cryptsetup" ,cryptsetup)
+       ("nss" ,nss)
+       ("lvm2" ,lvm2)                   ; for "-ldevmapper"
+       ("glib" ,glib)
+       ("gpgme" ,gpgme)))
+    (arguments
+     `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'patch-python.h-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((python (assoc-ref inputs "python")))
+               (substitute* "Makefile.in"
+                 (("/usr/include/python") (string-append python "/include/python")))
+               #t))))))
+    (home-page "https://pagure.io/volume_key")
+    (synopsis "Manipulate storage volume encryption keys")
+    (description
+     "This package provides a library for manipulating storage volume
+encryption keys and storing them separately from volumes to handle forgotten
+passphrases.")
+    (license license:gpl2)))
+
+(define-public ndctl
+  (package
+    (name "ndctl")
+    (version "64.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/pmem/ndctl.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1la82fqbdwjkw6il498nkdfgqc4aszv481xf2p9p07jfvankx24v"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("asciidoc" ,asciidoc)
+       ("automake" ,automake)
+       ("autoconf" ,autoconf)
+       ("bash-completion" ,bash-completion)
+       ("docbook-xsl" ,docbook-xsl)
+       ("libtool" ,libtool)
+       ("libxml2" ,libxml2)
+       ("pkg-config" ,pkg-config)
+       ("xmlto" ,xmlto)
+       ;; Required for offline docbook generation.
+       ("which" ,which)))
+    (inputs
+     `(("eudev" ,eudev)
+       ("json-c" ,json-c)
+       ("keyutils" ,keyutils)
+       ("kmod" ,kmod)
+       ("util-linux" ,util-linux)))
+    (arguments
+     `(#:configure-flags
+       (list "--disable-asciidoctor"    ; use docbook-xsl instead
+             "--without-systemd")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-FHS-file-names
+           (lambda _
+             (substitute* "git-version-gen"
+               (("/bin/sh") (which "sh")))
+             (substitute* "git-version"
+               (("/bin/bash") (which "bash")))
+             #t)))
+       #:make-flags
+       (let ((out (assoc-ref %outputs "out")))
+         (list (string-append "BASH_COMPLETION_DIR=" out
+                              "/share/bash-completion/completions")))))
+    (home-page "https://github.com/pmem/ndctl")
+    (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
+    (description
+     "This package provides a utility library for managing the
+libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
+    ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
+    ;; the effective license.  Note that some files under ccan/ are
+    ;; covered by BSD-3 or public domain, see the individual folders.
+    (license license:gpl2)))
+
+(define-public dmraid
+  (package
+    (name "dmraid")
+    (version "1.0.0.rc16-3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
+    (build-system gnu-build-system)
+    (inputs `(("lvm2" ,lvm2)))
+    (native-inputs `(("which" ,which)))
+    (arguments
+     `(#:tests? #f                      ; No tests.
+       ;; Prevent a race condition where some target would attempt to link
+       ;; libdmraid.so before it had been built as reported in
+       ;; <https://bugs.gnu.org/31999#187>.
+       #:parallel-build? #f
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'change-directory
+                    (lambda _
+                      (chdir (string-append ,version "/dmraid"))
+                      (substitute* "make.tmpl.in"
+                        (("/bin/sh") (which "sh")))
+                      #t)))
+       #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
+                               ;; find libdmraid.so.
+                               (string-append "LDFLAGS=-Wl,-rpath="
+                                              (assoc-ref %outputs "out")
+                                              "/lib"))))
+    (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
+    (synopsis "Device mapper RAID interface")
+    (description
+     "This software supports RAID device discovery, RAID set activation, creation,
+removal, rebuild and display of properties for ATARAID/DDF1 metadata.
+
+@command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
+to create devices with respective mappings for the ATARAID sets discovered.")
+    (license license:gpl2+)))
+
+(define-public libblockdev
+  (package
+    (name "libblockdev")
+    (version "2.21")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/storaged-project/"
+                                  "libblockdev/releases/download/"
+                                  version "-1/libblockdev-" version ".tar.gz"))
+              (sha256
+               (base32
+                "02p13l4194j0vyd2zs7bb9dmyclcpqq8l3qv9289vjfbsvq2awii"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-wrapper)
+       ("util-linux" ,util-linux)))
+    (inputs
+     `(("btrfs-progs" ,btrfs-progs)
+       ("cryptsetup" ,cryptsetup)
+       ("dosfstools" ,dosfstools)
+       ("dmraid" ,dmraid)
+       ("eudev" ,eudev)
+       ("glib" ,glib)
+       ("gobject-introspection" ,gobject-introspection)
+       ("kmod" ,kmod)
+       ("libbytesize" ,libbytesize)
+       ("libyaml" ,libyaml)
+       ("lvm2" ,lvm2)
+       ("mdadm" ,mdadm)
+       ("ndctl" ,ndctl)
+       ("nss" ,nss)
+       ("parted" ,parted)
+       ("volume-key" ,volume-key)
+       ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
+       ))
+    (home-page "https://github.com/storaged-project/libblockdev")
+    (synopsis "Library for manipulating block devices")
+    (description
+     "libblockdev is a C library supporting GObject introspection for
+manipulation of block devices.  It has a plugin-based architecture where each
+technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
+plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
+LVM D-Bus API).")
+    (license license:lgpl2.1+)))
+
+(define-public rmlint
+  (package
+    (name "rmlint")
+    (version "2.8.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/sahib/rmlint")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1gc7gbnh0qg1kl151cv1ld87vhpm1v3pnkn7prhscdcc21jrg8nz"))))
+    (build-system scons-build-system)
+    (arguments
+     `(#:scons ,scons-python2
+       #:scons-flags (list (string-append "--prefix=" %output)
+                           (string-append "--actual-prefix=" %output))
+       #:tests? #f                      ; No tests?
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'scons-propagate-environment
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; TODO: `rmlint --gui` fails with
+             ;; "Failed to load shredder: No module named 'shredder'".
+             ;; The GUI might also need extra dependencies, such as
+             ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
+             (substitute* "lib/cmdline.c"
+               (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
+                (string-append
+                 "const char *commands[] = {\""
+                 (assoc-ref inputs "python") "/bin/python"
+                 "\", \"python\", NULL};")))
+             ;; By design, SCons does not, by default, propagate
+             ;; environment variables to subprocesses.  See:
+             ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
+             ;; Here, we modify the SConstruct file to arrange for
+             ;; environment variables to be propagated.
+             (substitute* "SConstruct"
+               (("^env = Environment\\(.*\\)" all)
+                (string-append
+                 all
+                 "\nenv['ENV']=os.environ"))))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("glib:bin" ,glib "bin")
+       ("python-sphinx" ,python-sphinx)))
+    (inputs
+     `(("python" ,python-wrapper)
+       ("glib" ,glib)
+       ("libelf" ,libelf)
+       ("elfutils" ,elfutils)
+       ("json-glib" ,json-glib)
+       ("libblkid" ,util-linux)))
+    (home-page "https://rmlint.rtfd.org")
+    (synopsis "Remove duplicates and other lint from the filesystem")
+    (description "@command{rmlint} finds space waste and other broken things
+on your filesystem and offers to remove it.  @command{rmlint} can find:
+
+@itemize
+@item duplicate files and duplicate directories,
+@item non-stripped binaries (i.e. binaries with debug symbols),
+@item broken symbolic links,
+@item empty files and directories,
+@item files with broken user and/or group ID.
+@end itemize\n")
+    (license license:gpl3+)))