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