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