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