Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / disk.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
11 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
12 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
13 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
15 ;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
16 ;;; Copyright © 2019 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages disk)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages c)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages crypto)
43 #:use-module (gnu packages cryptsetup)
44 #:use-module (gnu packages docbook)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages elf)
47 #:use-module (gnu packages gettext)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages gnupg)
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages ncurses)
55 #:use-module (gnu packages nss)
56 #:use-module (gnu packages perl)
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages popt)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages readline)
62 #:use-module (gnu packages sphinx)
63 #:use-module (gnu packages sqlite)
64 #:use-module (gnu packages swig)
65 #:use-module (gnu packages vim)
66 #:use-module (gnu packages w3m)
67 #:use-module (gnu packages web)
68 #:use-module (gnu packages xml)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system python)
71 #:use-module (guix build-system trivial)
72 #:use-module (guix build-system scons)
73 #:use-module (guix download)
74 #:use-module (guix git-download)
75 #:use-module ((guix licenses) #:prefix license:)
76 #:use-module (guix packages))
77
78 (define-public parted
79 (package
80 (name "parted")
81 (version "3.3")
82 (source (origin
83 (method url-fetch)
84 (uri (string-append "mirror://gnu/parted/parted-"
85 version ".tar.xz"))
86 (sha256
87 (base32
88 "0i1xp367wpqw75b20c3jnism3dg3yqj4a7a22p2jb1h1hyyv9qjp"))))
89 (build-system gnu-build-system)
90 (arguments
91 `(#:phases
92 (modify-phases %standard-phases
93 (add-after 'unpack 'fix-locales-and-python
94 (lambda* (#:key inputs #:allow-other-keys)
95 (substitute* "tests/t0251-gpt-unicode.sh"
96 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
97 (substitute* "tests/msdos-overlap"
98 (("/usr/bin/python") (which "python")))
99 #t)))))
100 (inputs
101 `(("lvm2" ,lvm2)
102 ("readline" ,readline)
103 ("util-linux" ,util-linux "lib")))
104 (native-inputs
105 `(("gettext" ,gettext-minimal)
106
107 ;; For the tests.
108 ("e2fsprogs" ,e2fsprogs)
109 ("perl" ,perl)
110 ("python" ,python-2)
111 ("util-linux" ,util-linux)))
112 (home-page "https://www.gnu.org/software/parted/")
113 (synopsis "Disk partition editor")
114 (description
115 "GNU Parted is a package for creating and manipulating disk partition
116 tables. It includes a library and command-line utility.")
117 (license license:gpl3+)))
118
119 (define-public fdisk
120 (package
121 (name "fdisk")
122 (version "2.0.0a1")
123 (source
124 (origin
125 (method url-fetch)
126 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
127 version ".tar.gz"))
128 (sha256
129 (base32
130 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
131 (build-system gnu-build-system)
132 (inputs
133 `(("gettext" ,gettext-minimal)
134 ("guile" ,guile-1.8)
135 ("util-linux" ,util-linux "lib")
136 ("parted" ,parted)))
137 ;; The build neglects to look for its own headers in its own tree. A next
138 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
139 (arguments
140 `(#:phases
141 (modify-phases %standard-phases
142 (add-after 'unpack 'skip-broken-header-probes
143 (lambda _
144 (substitute* "backend/configure"
145 (("gnufdisk-common.h .*") "\n"))
146 #t)))
147 #:make-flags (list (string-append "CPPFLAGS="
148 " -I../common/include "
149 " -I../debug/include "
150 " -I../exception/include"))))
151 (home-page "https://www.gnu.org/software/fdisk/")
152 (synopsis "Low-level disk partitioning and formatting")
153 (description
154 "GNU fdisk provides a GNU version of the common disk partitioning tool
155 fdisk. fdisk is used for the creation and manipulation of disk partition
156 tables, and it understands a variety of different formats.")
157 (license license:gpl3+)))
158
159 (define-public gptfdisk
160 (package
161 (name "gptfdisk")
162 (version "1.0.4")
163 (source
164 (origin
165 (method url-fetch)
166 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
167 version "/" name "-" version ".tar.gz"))
168 (sha256
169 (base32
170 "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
171 (build-system gnu-build-system)
172 (inputs
173 `(("gettext" ,gettext-minimal)
174 ("ncurses" ,ncurses)
175 ("popt" ,popt)
176 ("util-linux" ,util-linux "lib"))) ;libuuid
177 (arguments
178 `(#:test-target "test"
179 #:phases
180 (modify-phases %standard-phases
181 ;; no configure script
182 (delete 'configure)
183 ;; no install target
184 (replace 'install
185 (lambda* (#:key outputs #:allow-other-keys)
186 (let* ((out (assoc-ref outputs "out"))
187 (bin (string-append out "/bin"))
188 (man (string-append out "/share/man/man8")))
189 (install-file "gdisk" bin)
190 (install-file "sgdisk" bin)
191 (install-file "cgdisk" bin)
192 (install-file "fixparts" bin)
193 (install-file "cgdisk.8" man)
194 (install-file "fixparts.8" man)
195 (install-file "gdisk.8" man)
196 (install-file "sgdisk.8" man)))))))
197 (home-page "http://www.rodsbooks.com/gdisk/")
198 (synopsis "Low-level GPT disk partitioning and formatting")
199 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
200 works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
201 disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
202 scheme.")
203 (license license:gpl2)))
204
205 (define-public ddrescue
206 (package
207 (name "ddrescue")
208 (version "1.24")
209 (source
210 (origin
211 (method url-fetch)
212 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
213 version ".tar.lz"))
214 (sha256
215 (base32 "11qh0bbzf00mfb4yq35gnv5m260k4d7q9ixklry6bqvhvvp3ypab"))))
216 (build-system gnu-build-system)
217 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
218 (synopsis "Data recovery utility")
219 (native-inputs `(("lzip" ,lzip)))
220 (description
221 "GNU ddrescue is a fully automated data recovery tool. It copies data
222 from one file to another, working to rescue data in case of read errors. The
223 program also includes a tool for manipulating its log files, which are used
224 to recover data more efficiently by only reading the necessary blocks.")
225 (license license:gpl3+)))
226
227 (define-public dosfstools
228 (package
229 (name "dosfstools")
230 (version "4.1")
231 (source
232 (origin
233 (method url-fetch)
234 (uri (string-append "https://github.com/" name "/" name
235 "/releases/download/v" version "/"
236 name "-" version ".tar.xz"))
237 (sha256
238 (base32
239 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
240 (build-system gnu-build-system)
241 (arguments
242 `(#:configure-flags (list "--enable-compat-symlinks")
243 #:make-flags (list (string-append "PREFIX=" %output)
244 "CC=gcc")))
245 (native-inputs
246 `(("xxd" ,xxd))) ; for tests
247 (home-page "https://github.com/dosfstools/dosfstools")
248 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
249 (description
250 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
251 which respectively make and check MS-DOS FAT file systems.")
252 (license license:gpl3+)))
253
254 (define dosfstools/static
255 (static-package
256 (package (inherit dosfstools))))
257
258 (define-public fatfsck/static
259 (package
260 (name "fatfsck-static")
261 (version (package-version dosfstools))
262 (build-system trivial-build-system)
263 (source #f)
264 (arguments
265 `(#:modules ((guix build utils))
266 #:builder
267 (begin
268 (use-modules (guix build utils))
269 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
270 "/sbin"))
271 (exe "fsck.fat")
272 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
273 (mkdir-p bin)
274 (with-directory-excursion bin
275 (copy-file (string-append src "/" exe) exe)
276 (remove-store-references exe)
277 (chmod exe #o555)
278 ;; Add fsck.vfat symlink to match the Linux driver name.
279 (symlink exe "fsck.vfat")
280 #t)))))
281 (inputs `(("dosfstools" ,dosfstools/static)))
282 (home-page (package-home-page dosfstools))
283 (synopsis "Statically linked fsck.fat from dosfstools")
284 (description "This package provides a statically-linked @command{fsck.fat}
285 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
286 (license (package-license dosfstools))))
287
288 (define-public sdparm
289 (package
290 (name "sdparm")
291 (version "1.10")
292 (source
293 (origin
294 (method url-fetch)
295 (uri (string-append "http://sg.danny.cz/sg/p/"
296 name "-" version ".tar.xz"))
297 (sha256
298 (base32
299 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
300 (build-system gnu-build-system)
301 (home-page "http://sg.danny.cz/sg/sdparm.html")
302 (synopsis "Provide access to SCSI device parameters")
303 (description
304 "Sdparm reads and modifies SCSI device parameters. These devices can be
305 SCSI disks, in which case the role of @command{sdparm} is similar to its
306 namesake: the @command{hdparm} utility originally designed for ATA disks.
307 However, @command{sdparm} can be used to access parameters on any device that
308 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
309 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
310 also send commands associated with starting and stopping the media, loading
311 and unloading removable media and some other housekeeping functions.")
312 (license license:bsd-3)))
313
314 (define-public idle3-tools
315 (package
316 (name "idle3-tools")
317 (version "0.9.1")
318 (source
319 (origin
320 (method url-fetch)
321 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
322 version ".tgz"))
323 (sha256
324 (base32
325 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
326 (build-system gnu-build-system)
327 (arguments
328 `(#:tests? #f ;no test suite
329 #:phases
330 (modify-phases %standard-phases
331 (delete 'configure))
332 #:make-flags (list "CC=gcc"
333 (string-append "manprefix=")
334 (string-append "DESTDIR="
335 (assoc-ref %outputs "out")))))
336 (home-page "http://idle3-tools.sourceforge.net")
337 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
338 (description
339 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
340 present in many Western Digital hard drives. This timer is part of the
341 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
342 the default timer setting is not well suited to Linux or other *nix systems,
343 and can dramatically shorten the lifespan of the drive if left unchecked.")
344 (license license:gpl3+)))
345
346 (define-public gparted
347 (package
348 (name "gparted")
349 (version "1.0.0")
350 (source
351 (origin
352 (method url-fetch)
353 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
354 version "/gparted-" version ".tar.gz"))
355 (sha256
356 (base32
357 "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4"))))
358 (build-system gnu-build-system)
359 (arguments
360 ;; Tests require access to paths outside the build container, such
361 ;; as '/dev/disk/by-id'
362 `(#:tests? #f))
363 (inputs
364 `(("util-linux" ,util-linux "lib")
365 ("parted" ,parted)
366 ("glib" ,glib)
367 ("gtkmm" ,gtkmm)
368 ("libxml2" ,libxml2)
369 ("yelp-tools" ,yelp-tools)))
370 (native-inputs
371 `(("intltool" ,intltool)
372 ("itstool" ,itstool)
373 ("lvm2" ,lvm2) ; for tests
374 ("pkg-config" ,pkg-config)))
375 (home-page "https://gparted.org/")
376 (synopsis "Partition editor to graphically manage disk partitions")
377 (description "GParted is a GNOME partition editor for creating,
378 reorganizing, and deleting disk partitions. It uses libparted from the parted
379 project to detect and manipulate partition tables. Optional file system tools
380 permit managing file systems not included in libparted.")
381 ;; The home page says GPLv2, but the source code says GPLv2+.
382 (license license:gpl2+)))
383
384 (define-public pydf
385 (package
386 (name "pydf")
387 (version "12")
388 (source
389 (origin
390 (method url-fetch)
391 (uri (pypi-uri "pydf" version))
392 (sha256
393 (base32
394 "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
395 (build-system python-build-system)
396 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
397 (synopsis "Colourised @command{df} clone")
398 (description "All-singing, all-dancing, fully colourised @command{df} clone
399 written in Python. It displays the amount of disk space available on the
400 mounted file systems, using different colours for different types of file
401 systems. Output format is completely customizable.")
402 (license license:public-domain)))
403
404 (define-public f3
405 (package
406 (name "f3")
407 (version "7.2")
408 (source
409 (origin
410 (method git-fetch)
411 (uri (git-reference
412 (url "https://github.com/AltraMayor/f3.git")
413 (commit (string-append "v" version))))
414 (file-name (git-file-name name version))
415 (sha256
416 (base32 "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy"))))
417 (build-system gnu-build-system)
418 (arguments
419 '(#:tests? #f ; no check target
420 #:make-flags (list "CC=gcc"
421 (string-append "PREFIX=" %output))
422 #:phases
423 (modify-phases %standard-phases
424 (delete 'configure) ; no configure script
425 (add-after 'build 'build-extra
426 (lambda* (#:key make-flags #:allow-other-keys)
427 (apply invoke "make" "extra" make-flags)))
428 (add-after 'build 'install-extra
429 (lambda* (#:key make-flags #:allow-other-keys)
430 (apply invoke "make" "install-extra" make-flags))))))
431 (inputs
432 `(("eudev" ,eudev)
433 ("parted" ,parted)))
434 (home-page "http://oss.digirati.com.br/f3/")
435 (synopsis "Test real capacity of flash memory cards and such.")
436 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
437 capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
438 the card and then checks if can read it. It will assure you haven't been sold
439 a card with a smaller capacity than stated.")
440 (license license:gpl3+)))
441
442 (define-public python-parted
443 (package
444 (name "python-parted")
445 (version "3.11.2")
446 (source
447 (origin
448 (method git-fetch)
449 (uri (git-reference
450 (url "https://github.com/dcantrell/pyparted.git")
451 (commit (string-append "v" version))))
452 (file-name (git-file-name name version))
453 (sha256
454 (base32 "0r6916n3w4vldxrq30a3z2iagvxgly4vfmlidjm65vwqnyv17bvn"))))
455 (build-system python-build-system)
456 (arguments
457 `(#:phases
458 (modify-phases %standard-phases
459 (delete 'check)
460 (add-after 'install 'check
461 (lambda* (#:key outputs inputs #:allow-other-keys)
462 (add-installed-pythonpath inputs outputs)
463 ;; See <https://github.com/dcantrell/pyparted/issues/47>.
464 (substitute* "tests/test__ped_ped.py"
465 (("\"/tmp/temp-device-\"") "self.path"))
466 (invoke "python" "-m" "unittest" "discover" "-v")
467 #t)))))
468 (native-inputs
469 `(("e2fsprogs" ,e2fsprogs)
470 ("pkg-config" ,pkg-config)))
471 (propagated-inputs
472 `(("python-six" ,python-six)))
473 (inputs
474 `(("parted" ,parted)))
475 (home-page "https://github.com/dcantrell/pyparted")
476 (synopsis "Parted bindings for Python")
477 (description "This package provides @code{parted} bindings for Python.")
478 (license license:gpl2+)))
479
480 (define-public python2-parted
481 (package-with-python2 python-parted))
482
483 (define-public duperemove
484 (package
485 (name "duperemove")
486 (version "0.11.1")
487 (source
488 (origin
489 (method git-fetch)
490 (uri (git-reference
491 (url "https://github.com/markfasheh/duperemove.git")
492 (commit (string-append "v" version))))
493 (sha256
494 (base32 "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"))
495 (file-name (git-file-name name version))))
496 (build-system gnu-build-system)
497 (native-inputs
498 `(("pkg-config" ,pkg-config)))
499 (inputs
500 `(("glib" ,glib)
501 ("sqlite" ,sqlite)))
502 (arguments
503 `(#:tests? #f ; no test suite
504 #:phases
505 (modify-phases %standard-phases
506 (delete 'configure)) ; no configure script
507 #:make-flags (list (string-append "PREFIX=" %output)
508 "CC=gcc")))
509 (home-page "https://github.com/markfasheh/duperemove")
510 (synopsis "Tools for de-duplicating file system data")
511 (description "Duperemove is a simple tool for finding duplicated extents
512 and submitting them for deduplication. When given a list of files it will
513 hash their contents on a block by block basis and compare those hashes to each
514 other, finding and categorizing blocks that match each other. When given the
515 @option{-d} option, duperemove will submit those extents for deduplication
516 using the Linux kernel extent-same @code{ioctl}.
517
518 Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
519 existing hash file, duperemove will only compute hashes for those files which
520 have changed since the last run. Thus you can run duperemove repeatedly on
521 your data as it changes, without having to re-checksum unchanged data.
522
523 Duperemove can also take input from the @command{fdupes} program.")
524 (license license:gpl2)))
525
526 (define-public ranger
527 (package
528 (name "ranger")
529 (version "1.9.3")
530 (source (origin
531 (method url-fetch)
532 (uri (string-append "https://ranger.github.io/"
533 "ranger-" version ".tar.gz"))
534 (sha256
535 (base32
536 "0lfjrpv3z4h0knd3v94fijrw2zjba51mrp3mjqx2c98wr428l26f"))))
537 (build-system python-build-system)
538 (inputs
539 `(("w3m" ,w3m)))
540 (native-inputs
541 `(("which" ,which)
542
543 ;; For tests.
544 ("python-pytest" ,python-pytest)))
545 (arguments
546 '( ;; The 'test' target runs developer tools like pylint, which fail.
547 #:test-target "test_pytest"
548 #:phases
549 (modify-phases %standard-phases
550 (add-after 'configure 'wrap-program
551 ;; Tell 'ranger' where 'w3mimgdisplay' is.
552 (lambda* (#:key inputs outputs #:allow-other-keys)
553 (let* ((out (assoc-ref outputs "out"))
554 (ranger (string-append out "/bin/ranger"))
555 (w3m (assoc-ref inputs "w3m"))
556 (w3mimgdisplay (string-append w3m
557 "/libexec/w3m/w3mimgdisplay")))
558 (wrap-program ranger
559 `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
560 #t)))
561 (replace 'check
562 ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
563 (lambda* (#:key test-target #:allow-other-keys)
564 (invoke "make" test-target))))))
565 (home-page "https://ranger.github.io/")
566 (synopsis "Console file manager")
567 (description "ranger is a console file manager with Vi key bindings. It
568 provides a minimalistic and nice curses interface with a view on the directory
569 hierarchy. It ships with @code{rifle}, a file launcher that is good at
570 automatically finding out which program to use for what file type.")
571 (license license:gpl3)))
572
573 (define-public volume-key
574 (package
575 (name "volume-key")
576 (version "0.3.12")
577 (source (origin
578 (method url-fetch)
579 (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
580 version ".tar.xz"))
581 (sha256
582 (base32
583 "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
584 (build-system gnu-build-system)
585 (native-inputs
586 `(("pkg-config" ,pkg-config)
587 ("swig" ,swig)
588 ("python" ,python-3))) ; used to generate the Python bindings
589 (inputs
590 `(("cryptsetup" ,cryptsetup)
591 ("nss" ,nss)
592 ("libblkid" ,util-linux "lib")
593 ("lvm2" ,lvm2) ; for "-ldevmapper"
594 ("glib" ,glib)
595 ("gpgme" ,gpgme)))
596 (arguments
597 `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
598 #:phases
599 (modify-phases %standard-phases
600 (add-before 'configure 'patch-python.h-path
601 (lambda* (#:key inputs #:allow-other-keys)
602 (let ((python (assoc-ref inputs "python")))
603 (substitute* "Makefile.in"
604 (("/usr/include/python") (string-append python "/include/python")))
605 #t))))))
606 (home-page "https://pagure.io/volume_key")
607 (synopsis "Manipulate storage volume encryption keys")
608 (description
609 "This package provides a library for manipulating storage volume
610 encryption keys and storing them separately from volumes to handle forgotten
611 passphrases.")
612 (license license:gpl2)))
613
614 (define-public ndctl
615 (package
616 (name "ndctl")
617 (version "67")
618 (source (origin
619 (method git-fetch)
620 (uri (git-reference
621 (url "https://github.com/pmem/ndctl.git")
622 (commit (string-append "v" version))))
623 (file-name (git-file-name name version))
624 (sha256
625 (base32
626 "076jgw1g2aafqgnq705in0wnabysqk46dq5yxdv1qzgjmyhka39n"))))
627 (build-system gnu-build-system)
628 (native-inputs
629 `(("asciidoc" ,asciidoc)
630 ("automake" ,automake)
631 ("autoconf" ,autoconf)
632 ("bash-completion" ,bash-completion)
633 ("docbook-xsl" ,docbook-xsl)
634 ("libtool" ,libtool)
635 ("libxml2" ,libxml2)
636 ("pkg-config" ,pkg-config)
637 ("xmlto" ,xmlto)
638 ;; Required for offline docbook generation.
639 ("which" ,which)))
640 (inputs
641 `(("eudev" ,eudev)
642 ("json-c" ,json-c)
643 ("keyutils" ,keyutils)
644 ("kmod" ,kmod)
645 ("util-linux" ,util-linux "lib")))
646 (arguments
647 `(#:configure-flags
648 (list "--disable-asciidoctor" ; use docbook-xsl instead
649 "--without-systemd")
650 #:phases
651 (modify-phases %standard-phases
652 (add-after 'unpack 'patch-FHS-file-names
653 (lambda _
654 (substitute* "git-version-gen"
655 (("/bin/sh") (which "sh")))
656 (substitute* "git-version"
657 (("/bin/bash") (which "bash")))
658 #t)))
659 #:make-flags
660 (let ((out (assoc-ref %outputs "out")))
661 (list (string-append "BASH_COMPLETION_DIR=" out
662 "/share/bash-completion/completions")))))
663 (home-page "https://github.com/pmem/ndctl")
664 (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
665 (description
666 "This package provides a utility library for managing the
667 libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
668 ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
669 ;; the effective license. Note that some files under ccan/ are
670 ;; covered by BSD-3 or public domain, see the individual folders.
671 (license license:gpl2)))
672
673 (define-public dmraid
674 (package
675 (name "dmraid")
676 (version "1.0.0.rc16-3")
677 (source (origin
678 (method url-fetch)
679 (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
680 version ".tar.bz2"))
681 (sha256
682 (base32
683 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
684 (build-system gnu-build-system)
685 (inputs `(("lvm2" ,lvm2)))
686 (native-inputs `(("which" ,which)))
687 (arguments
688 `(#:tests? #f ; No tests.
689 ;; Prevent a race condition where some target would attempt to link
690 ;; libdmraid.so before it had been built as reported in
691 ;; <https://bugs.gnu.org/31999#187>.
692 #:parallel-build? #f
693 #:phases (modify-phases %standard-phases
694 (add-before 'configure 'change-directory
695 (lambda _
696 (chdir (string-append ,version "/dmraid"))
697 (substitute* "make.tmpl.in"
698 (("/bin/sh") (which "sh")))
699 #t)))
700 #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
701 ;; find libdmraid.so.
702 (string-append "LDFLAGS=-Wl,-rpath="
703 (assoc-ref %outputs "out")
704 "/lib"))))
705 (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
706 (synopsis "Device mapper RAID interface")
707 (description
708 "This software supports RAID device discovery, RAID set activation, creation,
709 removal, rebuild and display of properties for ATARAID/DDF1 metadata.
710
711 @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
712 to create devices with respective mappings for the ATARAID sets discovered.")
713 (license license:gpl2+)))
714
715 (define-public libblockdev
716 (package
717 (name "libblockdev")
718 (version "2.23")
719 (source (origin
720 (method url-fetch)
721 (uri (string-append "https://github.com/storaged-project/"
722 "libblockdev/releases/download/"
723 version "-1/libblockdev-" version ".tar.gz"))
724 (sha256
725 (base32
726 "15c7g2gbkahmy8c6677pvbvblan5h8jxcqqmn6nlvqwqynq2mkjm"))))
727 (build-system gnu-build-system)
728 (native-inputs
729 `(("pkg-config" ,pkg-config)
730 ("python" ,python-wrapper)
731 ("util-linux" ,util-linux)))
732 (inputs
733 `(("btrfs-progs" ,btrfs-progs)
734 ("cryptsetup" ,cryptsetup)
735 ("dosfstools" ,dosfstools)
736 ("dmraid" ,dmraid)
737 ("eudev" ,eudev)
738 ("glib" ,glib)
739 ("gobject-introspection" ,gobject-introspection)
740 ("kmod" ,kmod)
741 ("libbytesize" ,libbytesize)
742 ("libyaml" ,libyaml)
743 ("lvm2" ,lvm2)
744 ("mdadm" ,mdadm)
745 ("ndctl" ,ndctl)
746 ("nss" ,nss)
747 ("parted" ,parted)
748 ("volume-key" ,volume-key)
749 ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
750 ))
751 (home-page "https://github.com/storaged-project/libblockdev")
752 (synopsis "Library for manipulating block devices")
753 (description
754 "libblockdev is a C library supporting GObject introspection for
755 manipulation of block devices. It has a plugin-based architecture where each
756 technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
757 plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
758 LVM D-Bus API).")
759 (license license:lgpl2.1+)))
760
761 (define-public rmlint
762 (package
763 (name "rmlint")
764 (version "2.9.0")
765 (source (origin
766 (method git-fetch)
767 (uri (git-reference
768 (url "https://github.com/sahib/rmlint")
769 (commit (string-append "v" version))))
770 (file-name (git-file-name name version))
771 (sha256
772 (base32
773 "1b5cziam14h80xrfb285fmfrzz2rligxcpsq1xsig14xf4l2875i"))))
774 (build-system scons-build-system)
775 (arguments
776 `(#:scons ,scons-python2
777 #:scons-flags (list (string-append "--prefix=" %output)
778 (string-append "--actual-prefix=" %output))
779 #:tests? #f ; No tests?
780 #:phases
781 (modify-phases %standard-phases
782 (add-after 'unpack 'scons-propagate-environment
783 (lambda* (#:key inputs #:allow-other-keys)
784 ;; TODO: `rmlint --gui` fails with
785 ;; "Failed to load shredder: No module named 'shredder'".
786 ;; The GUI might also need extra dependencies, such as
787 ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
788 (substitute* "lib/cmdline.c"
789 (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
790 (string-append
791 "const char *commands[] = {\""
792 (assoc-ref inputs "python") "/bin/python"
793 "\", \"python\", NULL};")))
794 ;; By design, SCons does not, by default, propagate
795 ;; environment variables to subprocesses. See:
796 ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
797 ;; Here, we modify the SConstruct file to arrange for
798 ;; environment variables to be propagated.
799 (substitute* "SConstruct"
800 (("^env = Environment\\(.*\\)" all)
801 (string-append
802 all
803 "\nenv['ENV']=os.environ"))))))))
804 (native-inputs
805 `(("pkg-config" ,pkg-config)
806 ("glib:bin" ,glib "bin")
807 ("python-sphinx" ,python-sphinx)))
808 (inputs
809 `(("python" ,python-wrapper)
810 ("glib" ,glib)
811 ("libelf" ,libelf)
812 ("elfutils" ,elfutils)
813 ("json-glib" ,json-glib)
814 ("libblkid" ,util-linux "lib")))
815 (home-page "https://rmlint.rtfd.org")
816 (synopsis "Remove duplicates and other lint from the file system")
817 (description "@command{rmlint} finds space waste and other broken things
818 on your file system and offers to remove it. @command{rmlint} can find:
819
820 @itemize
821 @item duplicate files and duplicate directories,
822 @item non-stripped binaries (i.e. binaries with debug symbols),
823 @item broken symbolic links,
824 @item empty files and directories,
825 @item files with broken user and/or group ID.
826 @end itemize\n")
827 (license license:gpl3+)))