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>
22 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
90 (define-public fsarchiver
99 (url "https://github.com/fdupoux/fsarchiver.git")
101 (file-name (git-file-name name version))
103 (base32 "1rvwq5v3rl14bqxjm1ibfapyicf0sa44nw7451v10kx39lp56ylp"))))
104 (build-system gnu-build-system)
106 `(("autoconf" ,autoconf)
107 ("automake" ,automake)
108 ("pkg-config" ,pkg-config)))
111 ("e2fsprogs" ,e2fsprogs)
112 ("libgcrypt" ,libgcrypt)
115 ("util-linux" ,util-linux "lib")
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)))
126 (define-public udevil
135 (url "https://github.com/IgnorantGuru/udevil.git")
137 (file-name (git-file-name name version))
139 (base32 "0x9mjr9abvbxzfa9mrip5264iz1qxvsl01k3ybz95q4a7xl4jcb3"))))
140 (build-system gnu-build-system)
145 (string-append "--sysconfdir="
146 (assoc-ref %outputs "out")
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")
156 (modify-phases %standard-phases
157 (add-after 'unpack 'remove-root-reference
159 (substitute* "src/Makefile.in"
160 (("-o root -g root") ""))
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.
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"))
173 `(("intltool" ,intltool)
174 ("pkg-config" ,pkg-config)))
176 `(("cifs-utils" ,cifs-utils)
177 ("curlftpfs" ,curlftpfs)
179 ("fakeroot" ,fakeroot)
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+)))
190 (define-public parted
196 (uri (string-append "mirror://gnu/parted/parted-"
200 "0i1xp367wpqw75b20c3jnism3dg3yqj4a7a22p2jb1h1hyyv9qjp"))))
201 (build-system gnu-build-system)
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")))
214 ("readline" ,readline)
215 ("util-linux" ,util-linux "lib")))
217 `(("gettext" ,gettext-minimal)
220 ("e2fsprogs" ,e2fsprogs)
223 ("util-linux" ,util-linux)))
224 (home-page "https://www.gnu.org/software/parted/")
225 (synopsis "Disk partition editor")
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+)))
238 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
242 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
243 (build-system gnu-build-system)
245 `(("gettext" ,gettext-minimal)
247 ("util-linux" ,util-linux "lib")
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.
253 (modify-phases %standard-phases
254 (add-after 'unpack 'skip-broken-header-probes
256 (substitute* "backend/configure"
257 (("gnufdisk-common.h .*") "\n"))
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")
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+)))
271 (define-public gptfdisk
278 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
279 version "/gptfdisk-" version ".tar.gz"))
281 (base32 "0bybgp30pqxb6x5krxazkq4drca0gz4inxj89fpyr204rn3kjz8f"))))
282 (build-system gnu-build-system)
284 `(("gettext" ,gettext-minimal)
287 ("util-linux" ,util-linux "lib"))) ;libuuid
289 `(#:test-target "test"
291 (modify-phases %standard-phases
292 (add-after 'unpack 'fix-include-directory
294 (substitute* "gptcurses.cc"
295 (("ncursesw/ncurses.h") "ncurses.h"))
297 (delete 'configure) ; no configure script
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
318 (license license:gpl2)))
320 (define-public ddrescue
327 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
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)))
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+)))
342 (define-public dosfstools
349 (uri (string-append "https://github.com/" name "/" name
350 "/releases/download/v" version "/"
351 name "-" version ".tar.xz"))
354 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
355 (build-system gnu-build-system)
357 `(#:configure-flags (list "--enable-compat-symlinks")
358 #:make-flags (list (string-append "PREFIX=" %output)
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")
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+)))
369 (define dosfstools/static
371 (package (inherit dosfstools))))
373 (define-public fatfsck/static
375 (name "fatfsck-static")
376 (version (package-version dosfstools))
377 (build-system trivial-build-system)
380 `(#:modules ((guix build utils))
383 (use-modules (guix build utils))
384 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
387 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
389 (with-directory-excursion bin
390 (copy-file (string-append src "/" exe) exe)
391 (remove-store-references exe)
393 ;; Add fsck.vfat symlink to match the Linux driver name.
394 (symlink exe "fsck.vfat")
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))))
403 (define-public sdparm
410 (uri (string-append "http://sg.danny.cz/sg/p/"
411 "sdparm-" version ".tar.xz"))
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")
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)))
428 (define-public idle3-tools
435 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
439 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
440 (build-system gnu-build-system)
442 `(#:tests? #f ;no test suite
444 (modify-phases %standard-phases
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")
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+)))
460 (define-public gparted
467 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
468 version "/gparted-" version ".tar.gz"))
470 (base32 "092rgwjh1825fal6v3yafq2wr0i61hh0a2n0j4296zn0zdx7pzp2"))))
471 (build-system gnu-build-system)
473 ;; Tests require access to paths outside the build container, such
474 ;; as '/dev/disk/by-id'
477 `(("util-linux" ,util-linux "lib")
481 ("libxml2" ,libxml2)))
483 `(("intltool" ,intltool)
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+)))
504 (uri (pypi-uri "pydf" version))
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)))
525 (url "https://github.com/AltraMayor/f3.git")
526 (commit (string-append "v" version))))
527 (file-name (git-file-name name version))
529 (base32 "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy"))))
530 (build-system gnu-build-system)
532 '(#:tests? #f ; no check target
533 #:make-flags (list "CC=gcc"
534 (string-append "PREFIX=" %output))
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))))))
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+)))
555 (define-public python-parted
557 (name "python-parted")
563 (url "https://github.com/dcantrell/pyparted.git")
564 (commit (string-append "v" version))))
565 (file-name (git-file-name name version))
567 (base32 "0r6916n3w4vldxrq30a3z2iagvxgly4vfmlidjm65vwqnyv17bvn"))))
568 (build-system python-build-system)
571 (modify-phases %standard-phases
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")
582 `(("e2fsprogs" ,e2fsprogs)
583 ("pkg-config" ,pkg-config)))
585 `(("python-six" ,python-six)))
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+)))
593 (define-public python2-parted
594 (package-with-python2 python-parted))
596 (define-public duperemove
604 (url "https://github.com/markfasheh/duperemove.git")
605 (commit (string-append "v" version))))
607 (base32 "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"))
608 (file-name (git-file-name name version))))
609 (build-system gnu-build-system)
611 `(("pkg-config" ,pkg-config)))
616 `(#:tests? #f ; no test suite
618 (modify-phases %standard-phases
619 (delete 'configure)) ; no configure script
620 #:make-flags (list (string-append "PREFIX=" %output)
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}.
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.
636 Duperemove can also take input from the @command{fdupes} program.")
637 (license license:gpl2)))
639 (define-public ranger
645 (uri (string-append "https://ranger.github.io/"
646 "ranger-" version ".tar.gz"))
649 "0lfjrpv3z4h0knd3v94fijrw2zjba51mrp3mjqx2c98wr428l26f"))))
650 (build-system python-build-system)
657 ("python-pytest" ,python-pytest)))
659 '( ;; The 'test' target runs developer tools like pylint, which fail.
660 #:test-target "test_pytest"
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")))
672 `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
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)))
686 (define-public volume-key
692 (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
696 "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
697 (build-system gnu-build-system)
699 `(("pkg-config" ,pkg-config)
701 ("python" ,python-3))) ; used to generate the Python bindings
703 `(("cryptsetup" ,cryptsetup)
705 ("libblkid" ,util-linux "lib")
706 ("lvm2" ,lvm2) ; for "-ldevmapper"
710 `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
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")))
719 (home-page "https://pagure.io/volume_key")
720 (synopsis "Manipulate storage volume encryption keys")
722 "This package provides a library for manipulating storage volume
723 encryption keys and storing them separately from volumes to handle forgotten
725 (license license:gpl2)))
734 (url "https://github.com/pmem/ndctl.git")
735 (commit (string-append "v" version))))
736 (file-name (git-file-name name version))
739 "0xmim7z4qp6x2ggndnbwd940c73pa1qlf3hxyn3qh5pyr69nh9y8"))))
740 (build-system gnu-build-system)
742 `(("asciidoc" ,asciidoc)
743 ("automake" ,automake)
744 ("autoconf" ,autoconf)
745 ("bash-completion" ,bash-completion)
746 ("docbook-xsl" ,docbook-xsl)
749 ("pkg-config" ,pkg-config)
751 ;; Required for offline docbook generation.
756 ("keyutils" ,keyutils)
758 ("util-linux" ,util-linux "lib")))
761 (list "--disable-asciidoctor" ; use docbook-xsl instead
764 (modify-phases %standard-phases
765 (add-after 'unpack 'patch-FHS-file-names
767 (substitute* "git-version-gen"
768 (("/bin/sh") (which "sh")))
769 (substitute* "git-version"
770 (("/bin/bash") (which "bash")))
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")
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)))
786 (define-public dmraid
789 (version "1.0.0.rc16-3")
792 (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
796 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
797 (build-system gnu-build-system)
798 (inputs `(("lvm2" ,lvm2)))
799 (native-inputs `(("which" ,which)))
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>.
806 #:phases (modify-phases %standard-phases
807 (add-before 'configure 'change-directory
809 (chdir (string-append ,version "/dmraid"))
810 (substitute* "make.tmpl.in"
811 (("/bin/sh") (which "sh")))
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")
818 (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
819 (synopsis "Device mapper RAID interface")
821 "This software supports RAID device discovery, RAID set activation, creation,
822 removal, rebuild and display of properties for ATARAID/DDF1 metadata.
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+)))
828 (define-public libblockdev
834 (uri (string-append "https://github.com/storaged-project/"
835 "libblockdev/releases/download/"
836 version "-1/libblockdev-" version ".tar.gz"))
839 "15c7g2gbkahmy8c6677pvbvblan5h8jxcqqmn6nlvqwqynq2mkjm"))))
840 (build-system gnu-build-system)
842 `(("pkg-config" ,pkg-config)
843 ("python" ,python-wrapper)
844 ("util-linux" ,util-linux)))
846 `(("btrfs-progs" ,btrfs-progs)
847 ("cryptsetup" ,cryptsetup)
848 ("dosfstools" ,dosfstools)
852 ("gobject-introspection" ,gobject-introspection)
854 ("libbytesize" ,libbytesize)
861 ("volume-key" ,volume-key)
862 ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
864 (home-page "https://github.com/storaged-project/libblockdev")
865 (synopsis "Library for manipulating block devices")
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
872 (license license:lgpl2.1+)))
874 (define-public rmlint
881 (url "https://github.com/sahib/rmlint")
882 (commit (string-append "v" version))))
883 (file-name (git-file-name name version))
886 "1b5cziam14h80xrfb285fmfrzz2rligxcpsq1xsig14xf4l2875i"))))
887 (build-system scons-build-system)
889 `(#:scons ,scons-python2
890 #:scons-flags (list (string-append "--prefix=" %output)
891 (string-append "--actual-prefix=" %output))
892 #:tests? #f ; No tests?
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\\};")
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)
916 "\nenv['ENV']=os.environ"))))))))
918 `(("pkg-config" ,pkg-config)
919 ("glib:bin" ,glib "bin")
920 ("python-sphinx" ,python-sphinx)))
922 `(("python" ,python-wrapper)
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:
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.
940 (license license:gpl3+)))
949 (url "https://github.com/gokcehan/lf.git")
950 (commit (string-append "r" version))))
951 (file-name (git-file-name name version))
954 "1ld3q75v8rvp169w5p85z1vznqs9bhck6bm2f6fykxx16hmpb6ga"))))
955 (build-system go-build-system)
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)))
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)))
977 (string-append "mirror://sourceforge/xfe/xfe/" version "/"
978 "xfe-" version ".tar.gz"))
980 (base32 "1fl51k5jm2vrfc2g66agbikzirmp0yb0lqhmsssixfb4mky3hpzs"))))
981 (build-system gnu-build-system)
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))))
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)))
1012 `(("intltool" ,intltool)
1013 ("pkg-config" ,pkg-config)))
1016 ("coreutils" ,coreutils)
1018 ("findutils" ,findutils)
1020 ("freetype" ,freetype)
1023 ("xcb-util" ,xcb-util)
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+)))