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 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2016 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>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages disk)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bash)
38 #:use-module (gnu packages c)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages cryptsetup)
43 #:use-module (gnu packages docbook)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages elf)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages gnupg)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages guile)
52 #:use-module (gnu packages linux)
53 #:use-module (gnu packages ncurses)
54 #:use-module (gnu packages nss)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages popt)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-xyz)
60 #:use-module (gnu packages readline)
61 #:use-module (gnu packages sphinx)
62 #:use-module (gnu packages sqlite)
63 #:use-module (gnu packages swig)
64 #:use-module (gnu packages vim)
65 #:use-module (gnu packages w3m)
66 #:use-module (gnu packages web)
67 #:use-module (gnu packages xml)
68 #:use-module (guix build-system gnu)
69 #:use-module (guix build-system python)
70 #:use-module (guix build-system trivial)
71 #:use-module (guix build-system scons)
72 #:use-module (guix download)
73 #:use-module (guix git-download)
74 #:use-module ((guix licenses) #:prefix license:)
75 #:use-module (guix packages))
83 (uri (string-append "mirror://gnu/parted/parted-"
85 (patches (search-patches "parted-glibc-compat.patch"))
88 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
89 (build-system gnu-build-system)
92 (modify-phases %standard-phases
94 'unpack 'fix-locales-and-python
95 (lambda* (#:key inputs #:allow-other-keys)
96 (substitute* "tests/t0251-gpt-unicode.sh"
97 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
98 (substitute* "tests/msdos-overlap"
99 (("/usr/bin/python") (which "python"))))))))
102 ("readline" ,readline)
103 ("util-linux" ,util-linux)))
105 `(("gettext" ,gettext-minimal)
108 ("python" ,python-2)))
109 (home-page "https://www.gnu.org/software/parted/")
110 (synopsis "Disk partition editor")
112 "GNU Parted is a package for creating and manipulating disk partition
113 tables. It includes a library and command-line utility.")
114 (license license:gpl3+)))
123 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
127 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
128 (build-system gnu-build-system)
130 `(("gettext" ,gettext-minimal)
132 ("util-linux" ,util-linux)
134 ;; The build neglects to look for its own headers in its own tree. A next
135 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
138 (modify-phases %standard-phases
139 (add-after 'unpack 'skip-broken-header-probes
141 (substitute* "backend/configure"
142 (("gnufdisk-common.h .*") "\n"))
144 #:make-flags (list (string-append "CPPFLAGS="
145 " -I../common/include "
146 " -I../debug/include "
147 " -I../exception/include"))))
148 (home-page "https://www.gnu.org/software/fdisk/")
149 (synopsis "Low-level disk partitioning and formatting")
151 "GNU fdisk provides a GNU version of the common disk partitioning tool
152 fdisk. fdisk is used for the creation and manipulation of disk partition
153 tables, and it understands a variety of different formats.")
154 (license license:gpl3+)))
156 (define-public gptfdisk
163 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
164 version "/" name "-" version ".tar.gz"))
167 "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
168 (build-system gnu-build-system)
170 `(("gettext" ,gettext-minimal)
173 ("util-linux" ,util-linux))) ; libuuid
175 `(#:test-target "test"
177 (modify-phases %standard-phases
178 ;; no configure script
182 (lambda* (#:key outputs #:allow-other-keys)
183 (let* ((out (assoc-ref outputs "out"))
184 (bin (string-append out "/bin"))
185 (man (string-append out "/share/man/man8")))
186 (install-file "gdisk" bin)
187 (install-file "sgdisk" bin)
188 (install-file "cgdisk" bin)
189 (install-file "fixparts" bin)
190 (install-file "cgdisk.8" man)
191 (install-file "fixparts.8" man)
192 (install-file "gdisk.8" man)
193 (install-file "sgdisk.8" man)))))))
194 (home-page "http://www.rodsbooks.com/gdisk/")
195 (synopsis "Low-level GPT disk partitioning and formatting")
196 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
197 works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
198 disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
200 (license license:gpl2)))
202 (define-public ddrescue
209 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
212 (base32 "11qh0bbzf00mfb4yq35gnv5m260k4d7q9ixklry6bqvhvvp3ypab"))))
213 (build-system gnu-build-system)
214 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
215 (synopsis "Data recovery utility")
216 (native-inputs `(("lzip" ,lzip)))
218 "GNU ddrescue is a fully automated data recovery tool. It copies data
219 from one file to another, working to rescue data in case of read errors. The
220 program also includes a tool for manipulating its log files, which are used
221 to recover data more efficiently by only reading the necessary blocks.")
222 (license license:gpl3+)))
224 (define-public dosfstools
231 (uri (string-append "https://github.com/" name "/" name
232 "/releases/download/v" version "/"
233 name "-" version ".tar.xz"))
236 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
237 (build-system gnu-build-system)
239 `(#:make-flags (list (string-append "PREFIX=" %output)
242 `(("xxd" ,xxd))) ; for tests
243 (home-page "https://github.com/dosfstools/dosfstools")
244 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
246 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
247 which respectively make and check MS-DOS FAT file systems.")
248 (license license:gpl3+)))
250 (define dosfstools/static
252 (package (inherit dosfstools))))
254 (define-public fatfsck/static
256 (name "fatfsck-static")
257 (version (package-version dosfstools))
258 (build-system trivial-build-system)
261 `(#:modules ((guix build utils))
264 (use-modules (guix build utils))
265 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
268 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
270 (with-directory-excursion bin
271 (copy-file (string-append src "/" exe) exe)
272 (remove-store-references exe)
274 ;; Add fsck.vfat symlink to match the Linux driver name.
275 (symlink exe "fsck.vfat")
277 (inputs `(("dosfstools" ,dosfstools/static)))
278 (home-page (package-home-page dosfstools))
279 (synopsis "Statically linked fsck.fat from dosfstools")
280 (description "This package provides a statically-linked @command{fsck.fat}
281 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
282 (license (package-license dosfstools))))
284 (define-public sdparm
291 (uri (string-append "http://sg.danny.cz/sg/p/"
292 name "-" version ".tar.xz"))
295 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
296 (build-system gnu-build-system)
297 (home-page "http://sg.danny.cz/sg/sdparm.html")
298 (synopsis "Provide access to SCSI device parameters")
300 "Sdparm reads and modifies SCSI device parameters. These devices can be
301 SCSI disks, in which case the role of @command{sdparm} is similar to its
302 namesake: the @command{hdparm} utility originally designed for ATA disks.
303 However, @command{sdparm} can be used to access parameters on any device that
304 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
305 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
306 also send commands associated with starting and stopping the media, loading
307 and unloading removable media and some other housekeeping functions.")
308 (license license:bsd-3)))
310 (define-public idle3-tools
317 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
321 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
322 (build-system gnu-build-system)
324 `(#:tests? #f ;no test suite
326 (modify-phases %standard-phases
328 #:make-flags (list "CC=gcc"
329 (string-append "manprefix=")
330 (string-append "DESTDIR="
331 (assoc-ref %outputs "out")))))
332 (home-page "http://idle3-tools.sourceforge.net")
333 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
335 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
336 present in many Western Digital hard drives. This timer is part of the
337 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
338 the default timer setting is not well suited to Linux or other *nix systems,
339 and can dramatically shorten the lifespan of the drive if left unchecked.")
340 (license license:gpl3+)))
342 (define-public gparted
349 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
350 version "/gparted-" version ".tar.gz"))
353 "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4"))))
354 (build-system gnu-build-system)
356 ;; Tests require access to paths outside the build container, such
357 ;; as '/dev/disk/by-id'
360 `(("util-linux" ,util-linux)
365 ("yelp-tools" ,yelp-tools)
366 ("itstool" ,itstool)))
368 `(("intltool" ,intltool)
369 ("lvm2" ,lvm2) ; for tests
370 ("pkg-config" ,pkg-config)))
371 (home-page "https://gparted.org/")
372 (synopsis "Partition editor to graphically manage disk partitions")
373 (description "GParted is a GNOME partition editor for creating,
374 reorganizing, and deleting disk partitions. It uses libparted from the parted
375 project to detect and manipulate partition tables. Optional file system tools
376 permit managing file systems not included in libparted.")
377 ;; The home page says GPLv2, but the source code says GPLv2+.
378 (license license:gpl2+)))
387 (uri (pypi-uri "pydf" version))
390 "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
391 (build-system python-build-system)
392 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
393 (synopsis "Colourised @command{df} clone")
394 (description "All-singing, all-dancing, fully colourised @command{df} clone
395 written in Python. It displays the amount of disk space available on the
396 mounted file systems, using different colours for different types of file
397 systems. Output format is completely customizable.")
398 (license license:public-domain)))
408 (url "https://github.com/AltraMayor/f3.git")
409 (commit (string-append "v" version))))
410 (file-name (git-file-name name version))
413 "0zglsmz683jg7f9wc6vmgljyg9w87pbnjw5x4w6x02w8233zvjqf"))))
414 (build-system gnu-build-system)
416 '(#:tests? #f ; no check target
417 #:make-flags (list "CC=gcc"
418 (string-append "PREFIX=" %output))
420 (modify-phases %standard-phases
421 (delete 'configure) ; no configure script
422 (add-after 'build 'build-extra
423 (lambda* (#:key make-flags #:allow-other-keys)
424 (apply invoke "make" "extra" make-flags)))
425 (add-after 'build 'install-extra
426 (lambda* (#:key make-flags #:allow-other-keys)
427 (apply invoke "make" "install-extra" make-flags))))))
431 (home-page "http://oss.digirati.com.br/f3/")
432 (synopsis "Test real capacity of flash memory cards and such.")
433 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
434 capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
435 the card and then checks if can read it. It will assure you haven't been sold
436 a card with a smaller capacity than stated.")
437 (license license:gpl3+)))
439 (define-public python-parted
441 (name "python-parted")
446 (uri (string-append "https://github.com/dcantrell/pyparted/archive/v"
450 "0r1nyjj40nacnfnv17x2mnsj6ga1qplyxyza82v2809dfhim2fwq"))))
451 (build-system python-build-system)
454 (modify-phases %standard-phases
456 (add-after 'install 'check
457 (lambda* (#:key outputs inputs #:allow-other-keys)
458 (add-installed-pythonpath inputs outputs)
459 ;; See <https://github.com/dcantrell/pyparted/issues/47>.
460 (substitute* "tests/test__ped_ped.py"
461 (("\"/tmp/temp-device-\"") "self.path"))
462 (invoke "python" "-m" "unittest" "discover" "-v")
465 `(("e2fsprogs" ,e2fsprogs)
466 ("pkg-config" ,pkg-config)))
468 `(("python-six" ,python-six)))
470 `(("parted" ,parted)))
471 (home-page "https://github.com/dcantrell/pyparted")
472 (synopsis "Parted bindings for Python")
473 (description "This package provides @code{parted} bindings for Python.")
474 (license license:gpl2+)))
476 (define-public python2-parted
477 (package-with-python2 python-parted))
479 (define-public duperemove
487 (url "https://github.com/markfasheh/duperemove.git")
488 (commit (string-append "v" version))))
490 (base32 "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"))
491 (file-name (git-file-name name version))))
492 (build-system gnu-build-system)
494 `(("pkg-config" ,pkg-config)))
499 `(#:tests? #f ; no test suite
501 (modify-phases %standard-phases
502 (delete 'configure)) ; no configure script
503 #:make-flags (list (string-append "PREFIX=" %output)
505 (home-page "https://github.com/markfasheh/duperemove")
506 (synopsis "Tools for de-duplicating file system data")
507 (description "Duperemove is a simple tool for finding duplicated extents
508 and submitting them for deduplication. When given a list of files it will
509 hash their contents on a block by block basis and compare those hashes to each
510 other, finding and categorizing blocks that match each other. When given the
511 @option{-d} option, duperemove will submit those extents for deduplication
512 using the Linux kernel extent-same @code{ioctl}.
514 Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
515 existing hash file, duperemove will only compute hashes for those files which
516 have changed since the last run. Thus you can run duperemove repeatedly on
517 your data as it changes, without having to re-checksum unchanged data.
519 Duperemove can also take input from the @command{fdupes} program.")
520 (license license:gpl2)))
522 (define-public ranger
528 (uri (string-append "https://ranger.github.io/"
529 "ranger-" version ".tar.gz"))
532 "12kbsqakbxs09y0x8hy66mmaf72rk0p850x7ryk2ghkq7wfin78f"))))
533 (build-system python-build-system)
540 ("python-pytest" ,python-pytest)))
542 '( ;; The 'test' target runs developer tools like pylint, which fail.
543 #:test-target "test_pytest"
545 (modify-phases %standard-phases
546 (add-after 'configure 'wrap-program
547 ;; Tell 'ranger' where 'w3mimgdisplay' is.
548 (lambda* (#:key inputs outputs #:allow-other-keys)
549 (let* ((out (assoc-ref outputs "out"))
550 (ranger (string-append out "/bin/ranger"))
551 (w3m (assoc-ref inputs "w3m"))
552 (w3mimgdisplay (string-append w3m
553 "/libexec/w3m/w3mimgdisplay")))
555 `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
558 ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
559 (lambda* (#:key test-target #:allow-other-keys)
560 (invoke "make" test-target))))))
561 (home-page "https://ranger.github.io/")
562 (synopsis "Console file manager")
563 (description "ranger is a console file manager with Vi key bindings. It
564 provides a minimalistic and nice curses interface with a view on the directory
565 hierarchy. It ships with @code{rifle}, a file launcher that is good at
566 automatically finding out which program to use for what file type.")
567 (license license:gpl3)))
569 (define-public volume-key
575 (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
579 "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
580 (build-system gnu-build-system)
582 `(("pkg-config" ,pkg-config)
583 ("util-linux" ,util-linux)
585 ("python" ,python-3))) ; used to generate the Python bindings
587 `(("cryptsetup" ,cryptsetup)
589 ("lvm2" ,lvm2) ; for "-ldevmapper"
593 `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
595 (modify-phases %standard-phases
596 (add-before 'configure 'patch-python.h-path
597 (lambda* (#:key inputs #:allow-other-keys)
598 (let ((python (assoc-ref inputs "python")))
599 (substitute* "Makefile.in"
600 (("/usr/include/python") (string-append python "/include/python")))
602 (home-page "https://pagure.io/volume_key")
603 (synopsis "Manipulate storage volume encryption keys")
605 "This package provides a library for manipulating storage volume
606 encryption keys and storing them separately from volumes to handle forgotten
608 (license license:gpl2)))
617 (url "https://github.com/pmem/ndctl.git")
618 (commit (string-append "v" version))))
619 (file-name (git-file-name name version))
622 "0d8hzfvyxs2q8kgkwgdizlml41kin4mhx3vpdsjk34pfi7mqy69y"))))
623 (build-system gnu-build-system)
625 `(("asciidoc" ,asciidoc)
626 ("automake" ,automake)
627 ("autoconf" ,autoconf)
628 ("bash-completion" ,bash-completion)
629 ("docbook-xsl" ,docbook-xsl)
632 ("pkg-config" ,pkg-config)
634 ;; Required for offline docbook generation.
639 ("keyutils" ,keyutils)
641 ("util-linux" ,util-linux)))
644 (list "--disable-asciidoctor" ; use docbook-xsl instead
647 (modify-phases %standard-phases
648 (add-after 'unpack 'patch-FHS-file-names
650 (substitute* "git-version-gen"
651 (("/bin/sh") (which "sh")))
652 (substitute* "git-version"
653 (("/bin/bash") (which "bash")))
656 (let ((out (assoc-ref %outputs "out")))
657 (list (string-append "BASH_COMPLETION_DIR=" out
658 "/share/bash-completion/completions")))))
659 (home-page "https://github.com/pmem/ndctl")
660 (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
662 "This package provides a utility library for managing the
663 libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
664 ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
665 ;; the effective license. Note that some files under ccan/ are
666 ;; covered by BSD-3 or public domain, see the individual folders.
667 (license license:gpl2)))
669 (define-public dmraid
672 (version "1.0.0.rc16-3")
675 (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
679 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
680 (build-system gnu-build-system)
681 (inputs `(("lvm2" ,lvm2)))
682 (native-inputs `(("which" ,which)))
684 `(#:tests? #f ; No tests.
685 ;; Prevent a race condition where some target would attempt to link
686 ;; libdmraid.so before it had been built as reported in
687 ;; <https://bugs.gnu.org/31999#187>.
689 #:phases (modify-phases %standard-phases
690 (add-before 'configure 'change-directory
692 (chdir (string-append ,version "/dmraid"))
693 (substitute* "make.tmpl.in"
694 (("/bin/sh") (which "sh")))
696 #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
697 ;; find libdmraid.so.
698 (string-append "LDFLAGS=-Wl,-rpath="
699 (assoc-ref %outputs "out")
701 (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
702 (synopsis "Device mapper RAID interface")
704 "This software supports RAID device discovery, RAID set activation, creation,
705 removal, rebuild and display of properties for ATARAID/DDF1 metadata.
707 @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
708 to create devices with respective mappings for the ATARAID sets discovered.")
709 (license license:gpl2+)))
711 (define-public libblockdev
717 (uri (string-append "https://github.com/storaged-project/"
718 "libblockdev/releases/download/"
719 version "-1/libblockdev-" version ".tar.gz"))
722 "02p13l4194j0vyd2zs7bb9dmyclcpqq8l3qv9289vjfbsvq2awii"))))
723 (build-system gnu-build-system)
725 `(("pkg-config" ,pkg-config)
726 ("python" ,python-wrapper)
727 ("util-linux" ,util-linux)))
729 `(("btrfs-progs" ,btrfs-progs)
730 ("cryptsetup" ,cryptsetup)
731 ("dosfstools" ,dosfstools)
735 ("gobject-introspection" ,gobject-introspection)
737 ("libbytesize" ,libbytesize)
744 ("volume-key" ,volume-key)
745 ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
747 (home-page "https://github.com/storaged-project/libblockdev")
748 (synopsis "Library for manipulating block devices")
750 "libblockdev is a C library supporting GObject introspection for
751 manipulation of block devices. It has a plugin-based architecture where each
752 technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
753 plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
755 (license license:lgpl2.1+)))
757 (define-public rmlint
764 (url "https://github.com/sahib/rmlint")
765 (commit (string-append "v" version))))
766 (file-name (git-file-name name version))
769 "1gc7gbnh0qg1kl151cv1ld87vhpm1v3pnkn7prhscdcc21jrg8nz"))))
770 (build-system scons-build-system)
772 `(#:scons ,scons-python2
773 #:scons-flags (list (string-append "--prefix=" %output)
774 (string-append "--actual-prefix=" %output))
775 #:tests? #f ; No tests?
777 (modify-phases %standard-phases
778 (add-after 'unpack 'scons-propagate-environment
779 (lambda* (#:key inputs #:allow-other-keys)
780 ;; TODO: `rmlint --gui` fails with
781 ;; "Failed to load shredder: No module named 'shredder'".
782 ;; The GUI might also need extra dependencies, such as
783 ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
784 (substitute* "lib/cmdline.c"
785 (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
787 "const char *commands[] = {\""
788 (assoc-ref inputs "python") "/bin/python"
789 "\", \"python\", NULL};")))
790 ;; By design, SCons does not, by default, propagate
791 ;; environment variables to subprocesses. See:
792 ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
793 ;; Here, we modify the SConstruct file to arrange for
794 ;; environment variables to be propagated.
795 (substitute* "SConstruct"
796 (("^env = Environment\\(.*\\)" all)
799 "\nenv['ENV']=os.environ"))))))))
801 `(("pkg-config" ,pkg-config)
802 ("glib:bin" ,glib "bin")
803 ("python-sphinx" ,python-sphinx)))
805 `(("python" ,python-wrapper)
808 ("elfutils" ,elfutils)
809 ("json-glib" ,json-glib)
810 ("libblkid" ,util-linux)))
811 (home-page "https://rmlint.rtfd.org")
812 (synopsis "Remove duplicates and other lint from the file system")
813 (description "@command{rmlint} finds space waste and other broken things
814 on your file system and offers to remove it. @command{rmlint} can find:
817 @item duplicate files and duplicate directories,
818 @item non-stripped binaries (i.e. binaries with debug symbols),
819 @item broken symbolic links,
820 @item empty files and directories,
821 @item files with broken user and/or group ID.
823 (license license:gpl3+)))