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