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