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