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