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