gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / disk.scm
CommitLineData
e04f30e0 1;;; GNU Guix --- Functional package management for GNU
cc4a2aeb 2;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
1b933e62 3;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
dd4a8620 4;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7ff557a5 5;;; Copyright © 2016, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
3e68e7d2 6;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
abba1d08 7;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
c20e552b 8;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
5f0f3686 9;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
49393691 10;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
893f9d24 11;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
d232e02e 12;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
834b0b9a 13;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
19b662ea 14;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
3b451546 15;;; Copyright © 2018, 2019 Pierre Neidhardt <mail@ambrevar.xyz>
ff22ff42 16;;; Copyright © 2019 Leo Famulari <leo@famulari.name>
a55dd25d 17;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
e04f30e0
NK
18;;;
19;;; This file is part of GNU Guix.
20;;;
21;;; GNU Guix is free software; you can redistribute it and/or modify it
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
26;;; GNU Guix is distributed in the hope that it will be useful, but
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
cc4a2aeb 34(define-module (gnu packages disk)
abba1d08 35 #:use-module (gnu packages)
3820d51b 36 #:use-module (gnu packages autotools)
c20e552b 37 #:use-module (gnu packages base)
3820d51b
TGR
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages c)
834b0b9a 40 #:use-module (gnu packages check)
3820d51b 41 #:use-module (gnu packages compression)
f95114e5 42 #:use-module (gnu packages crypto)
3820d51b 43 #:use-module (gnu packages cryptsetup)
c20e552b 44 #:use-module (gnu packages docbook)
3820d51b 45 #:use-module (gnu packages documentation)
3b451546 46 #:use-module (gnu packages elf)
1dba6407 47 #:use-module (gnu packages gettext)
c20e552b 48 #:use-module (gnu packages glib)
c20e552b 49 #:use-module (gnu packages gnome)
3820d51b 50 #:use-module (gnu packages gnupg)
3820d51b
TGR
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages guile)
e04f30e0 53 #:use-module (gnu packages linux)
abba1d08 54 #:use-module (gnu packages ncurses)
aff0cce9 55 #:use-module (gnu packages nss)
1b933e62 56 #:use-module (gnu packages perl)
c20e552b 57 #:use-module (gnu packages pkg-config)
abba1d08 58 #:use-module (gnu packages popt)
1b933e62 59 #:use-module (gnu packages python)
44d10b1f 60 #:use-module (gnu packages python-xyz)
cc4a2aeb 61 #:use-module (gnu packages readline)
9d0c291e 62 #:use-module (gnu packages sphinx)
cd0322a3 63 #:use-module (gnu packages sqlite)
3820d51b 64 #:use-module (gnu packages swig)
5f0f3686 65 #:use-module (gnu packages vim)
19b662ea 66 #:use-module (gnu packages w3m)
f7a4f7c0 67 #:use-module (gnu packages web)
3820d51b
TGR
68 #:use-module (gnu packages xml)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system python)
71 #:use-module (guix build-system trivial)
3b451546 72 #:use-module (guix build-system scons)
3820d51b
TGR
73 #:use-module (guix download)
74 #:use-module (guix git-download)
75 #:use-module ((guix licenses) #:prefix license:)
76 #:use-module (guix packages))
e04f30e0
NK
77
78(define-public parted
79 (package
80 (name "parted")
6ad7e357 81 (version "3.3")
1b933e62
ML
82 (source (origin
83 (method url-fetch)
84 (uri (string-append "mirror://gnu/parted/parted-"
85 version ".tar.xz"))
86 (sha256
87 (base32
6ad7e357 88 "0i1xp367wpqw75b20c3jnism3dg3yqj4a7a22p2jb1h1hyyv9qjp"))))
e04f30e0 89 (build-system gnu-build-system)
1b933e62
ML
90 (arguments
91 `(#:phases
92 (modify-phases %standard-phases
bd321df3
MB
93 (add-after 'unpack 'fix-locales-and-python
94 (lambda* (#:key inputs #:allow-other-keys)
95 (substitute* "tests/t0251-gpt-unicode.sh"
96 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
97 (substitute* "tests/msdos-overlap"
98 (("/usr/bin/python") (which "python")))
99 #t)))))
e04f30e0 100 (inputs
1b933e62
ML
101 `(("lvm2" ,lvm2)
102 ("readline" ,readline)
e04f30e0 103 ("util-linux" ,util-linux)))
c4c4cc05 104 (native-inputs
b94a6ca0 105 `(("gettext" ,gettext-minimal)
1b933e62 106 ;; For the tests.
20e01573 107 ("e2fsprogs" ,e2fsprogs)
1b933e62
ML
108 ("perl" ,perl)
109 ("python" ,python-2)))
110 (home-page "https://www.gnu.org/software/parted/")
f50d2669 111 (synopsis "Disk partition editor")
e04f30e0 112 (description
79c311b8
LC
113 "GNU Parted is a package for creating and manipulating disk partition
114tables. It includes a library and command-line utility.")
fd297f4a 115 (license license:gpl3+)))
cc4a2aeb
LC
116
117(define-public fdisk
118 (package
119 (name "fdisk")
ae03ee42 120 (version "2.0.0a1")
cc4a2aeb
LC
121 (source
122 (origin
123 (method url-fetch)
124 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
125 version ".tar.gz"))
126 (sha256
127 (base32
ae03ee42 128 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
cc4a2aeb
LC
129 (build-system gnu-build-system)
130 (inputs
b94a6ca0 131 `(("gettext" ,gettext-minimal)
cc4a2aeb
LC
132 ("guile" ,guile-1.8)
133 ("util-linux" ,util-linux)
134 ("parted" ,parted)))
ae03ee42
TGR
135 ;; The build neglects to look for its own headers in its own tree. A next
136 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
137 (arguments
138 `(#:phases
139 (modify-phases %standard-phases
140 (add-after 'unpack 'skip-broken-header-probes
141 (lambda _
142 (substitute* "backend/configure"
143 (("gnufdisk-common.h .*") "\n"))
144 #t)))
145 #:make-flags (list (string-append "CPPFLAGS="
146 " -I../common/include "
147 " -I../debug/include "
148 " -I../exception/include"))))
cc4a2aeb
LC
149 (home-page "https://www.gnu.org/software/fdisk/")
150 (synopsis "Low-level disk partitioning and formatting")
151 (description
152 "GNU fdisk provides a GNU version of the common disk partitioning tool
153fdisk. fdisk is used for the creation and manipulation of disk partition
154tables, and it understands a variety of different formats.")
fd297f4a 155 (license license:gpl3+)))
cc4a2aeb 156
abba1d08
JN
157(define-public gptfdisk
158 (package
159 (name "gptfdisk")
871d8199 160 (version "1.0.4")
abba1d08
JN
161 (source
162 (origin
163 (method url-fetch)
164 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
165 version "/" name "-" version ".tar.gz"))
166 (sha256
167 (base32
871d8199 168 "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
abba1d08
JN
169 (build-system gnu-build-system)
170 (inputs
b94a6ca0 171 `(("gettext" ,gettext-minimal)
abba1d08
JN
172 ("ncurses" ,ncurses)
173 ("popt" ,popt)
174 ("util-linux" ,util-linux))) ; libuuid
175 (arguments
176 `(#:test-target "test"
177 #:phases
178 (modify-phases %standard-phases
179 ;; no configure script
180 (delete 'configure)
181 ;; no install target
182 (replace 'install
183 (lambda* (#:key outputs #:allow-other-keys)
6fb9e069
LF
184 (let* ((out (assoc-ref outputs "out"))
185 (bin (string-append out "/bin"))
186 (man (string-append out "/share/man/man8")))
abba1d08
JN
187 (install-file "gdisk" bin)
188 (install-file "sgdisk" bin)
189 (install-file "cgdisk" bin)
6fb9e069
LF
190 (install-file "fixparts" bin)
191 (install-file "cgdisk.8" man)
192 (install-file "fixparts.8" man)
193 (install-file "gdisk.8" man)
194 (install-file "sgdisk.8" man)))))))
abba1d08
JN
195 (home-page "http://www.rodsbooks.com/gdisk/")
196 (synopsis "Low-level GPT disk partitioning and formatting")
197 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
73fe4552
TGR
198works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
199disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
200scheme.")
fd297f4a 201 (license license:gpl2)))
abba1d08 202
cc4a2aeb
LC
203(define-public ddrescue
204 (package
205 (name "ddrescue")
a4776d09 206 (version "1.24")
cc4a2aeb
LC
207 (source
208 (origin
209 (method url-fetch)
210 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
211 version ".tar.lz"))
212 (sha256
a4776d09 213 (base32 "11qh0bbzf00mfb4yq35gnv5m260k4d7q9ixklry6bqvhvvp3ypab"))))
cc4a2aeb 214 (build-system gnu-build-system)
416c57f0 215 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
cc4a2aeb
LC
216 (synopsis "Data recovery utility")
217 (native-inputs `(("lzip" ,lzip)))
218 (description
219 "GNU ddrescue is a fully automated data recovery tool. It copies data
220from one file to another, working to rescue data in case of read errors. The
221program also includes a tool for manipulating its log files, which are used
222to recover data more efficiently by only reading the necessary blocks.")
fd297f4a 223 (license license:gpl3+)))
dd4a8620
MW
224
225(define-public dosfstools
226 (package
227 (name "dosfstools")
5f0f3686 228 (version "4.1")
dd4a8620
MW
229 (source
230 (origin
231 (method url-fetch)
232 (uri (string-append "https://github.com/" name "/" name
233 "/releases/download/v" version "/"
234 name "-" version ".tar.xz"))
235 (sha256
236 (base32
5f0f3686 237 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
dd4a8620
MW
238 (build-system gnu-build-system)
239 (arguments
a55dd25d
PL
240 `(#:configure-flags (list "--enable-compat-symlinks")
241 #:make-flags (list (string-append "PREFIX=" %output)
5f0f3686
MB
242 "CC=gcc")))
243 (native-inputs
9fc513ad 244 `(("xxd" ,xxd))) ; for tests
dd4a8620 245 (home-page "https://github.com/dosfstools/dosfstools")
8f65585b 246 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
dd4a8620
MW
247 (description
248 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
8f65585b 249which respectively make and check MS-DOS FAT file systems.")
fd297f4a 250 (license license:gpl3+)))
0f860464 251
51ad11ad
MB
252(define dosfstools/static
253 (static-package
254 (package (inherit dosfstools))))
255
256(define-public fatfsck/static
257 (package
258 (name "fatfsck-static")
259 (version (package-version dosfstools))
260 (build-system trivial-build-system)
261 (source #f)
262 (arguments
263 `(#:modules ((guix build utils))
264 #:builder
265 (begin
266 (use-modules (guix build utils))
267 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
268 "/sbin"))
269 (exe "fsck.fat")
270 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
271 (mkdir-p bin)
272 (with-directory-excursion bin
273 (copy-file (string-append src "/" exe) exe)
274 (remove-store-references exe)
275 (chmod exe #o555)
276 ;; Add fsck.vfat symlink to match the Linux driver name.
277 (symlink exe "fsck.vfat")
278 #t)))))
279 (inputs `(("dosfstools" ,dosfstools/static)))
280 (home-page (package-home-page dosfstools))
281 (synopsis "Statically linked fsck.fat from dosfstools")
282 (description "This package provides a statically-linked @command{fsck.fat}
283and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
284 (license (package-license dosfstools))))
285
0f860464
TGR
286(define-public sdparm
287 (package
288 (name "sdparm")
aa588d8a 289 (version "1.10")
0f860464
TGR
290 (source
291 (origin
292 (method url-fetch)
293 (uri (string-append "http://sg.danny.cz/sg/p/"
294 name "-" version ".tar.xz"))
295 (sha256
296 (base32
aa588d8a 297 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
0f860464
TGR
298 (build-system gnu-build-system)
299 (home-page "http://sg.danny.cz/sg/sdparm.html")
300 (synopsis "Provide access to SCSI device parameters")
301 (description
302 "Sdparm reads and modifies SCSI device parameters. These devices can be
303SCSI disks, in which case the role of @command{sdparm} is similar to its
304namesake: the @command{hdparm} utility originally designed for ATA disks.
305However, @command{sdparm} can be used to access parameters on any device that
306uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
307transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
308also send commands associated with starting and stopping the media, loading
309and unloading removable media and some other housekeeping functions.")
fd297f4a 310 (license license:bsd-3)))
8e14e059
TGR
311
312(define-public idle3-tools
313 (package
314 (name "idle3-tools")
315 (version "0.9.1")
316 (source
317 (origin
318 (method url-fetch)
319 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
320 version ".tgz"))
321 (sha256
322 (base32
323 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
324 (build-system gnu-build-system)
325 (arguments
326 `(#:tests? #f ;no test suite
327 #:phases
328 (modify-phases %standard-phases
329 (delete 'configure))
330 #:make-flags (list "CC=gcc"
331 (string-append "manprefix=")
332 (string-append "DESTDIR="
333 (assoc-ref %outputs "out")))))
334 (home-page "http://idle3-tools.sourceforge.net")
335 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
336 (description
337 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
338present in many Western Digital hard drives. This timer is part of the
339\"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
340the default timer setting is not well suited to Linux or other *nix systems,
341and can dramatically shorten the lifespan of the drive if left unchecked.")
fd297f4a 342 (license license:gpl3+)))
c20e552b
RJ
343
344(define-public gparted
345 (package
346 (name "gparted")
ff22ff42 347 (version "1.0.0")
c20e552b
RJ
348 (source
349 (origin
350 (method url-fetch)
351 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
352 version "/gparted-" version ".tar.gz"))
353 (sha256
ff22ff42
LF
354 (base32
355 "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4"))))
c20e552b
RJ
356 (build-system gnu-build-system)
357 (arguments
ff22ff42
LF
358 ;; Tests require access to paths outside the build container, such
359 ;; as '/dev/disk/by-id'
360 `(#:tests? #f))
c20e552b
RJ
361 (inputs
362 `(("util-linux" ,util-linux)
363 ("parted" ,parted)
364 ("glib" ,glib)
ff22ff42 365 ("gtkmm" ,gtkmm)
c20e552b 366 ("libxml2" ,libxml2)
3e68e7d2 367 ("yelp-tools" ,yelp-tools)))
c20e552b
RJ
368 (native-inputs
369 `(("intltool" ,intltool)
3e68e7d2 370 ("itstool" ,itstool)
ff22ff42 371 ("lvm2" ,lvm2) ; for tests
c20e552b 372 ("pkg-config" ,pkg-config)))
d5909be9 373 (home-page "https://gparted.org/")
c20e552b
RJ
374 (synopsis "Partition editor to graphically manage disk partitions")
375 (description "GParted is a GNOME partition editor for creating,
376reorganizing, and deleting disk partitions. It uses libparted from the parted
377project to detect and manipulate partition tables. Optional file system tools
378permit managing file systems not included in libparted.")
379 ;; The home page says GPLv2, but the source code says GPLv2+.
380 (license license:gpl2+)))
49393691 381
893f9d24
SR
382(define-public pydf
383 (package
384 (name "pydf")
385 (version "12")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (pypi-uri "pydf" version))
390 (sha256
391 (base32
392 "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
393 (build-system python-build-system)
394 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
395 (synopsis "Colourised @command{df} clone")
396 (description "All-singing, all-dancing, fully colourised @command{df} clone
397written in Python. It displays the amount of disk space available on the
162a1374 398mounted file systems, using different colours for different types of file
893f9d24
SR
399systems. Output format is completely customizable.")
400 (license license:public-domain)))
49393691
HG
401
402(define-public f3
403 (package
404 (name "f3")
3eb278aa 405 (version "7.2")
49393691
HG
406 (source
407 (origin
b3307bfd
TGR
408 (method git-fetch)
409 (uri (git-reference
410 (url "https://github.com/AltraMayor/f3.git")
411 (commit (string-append "v" version))))
412 (file-name (git-file-name name version))
49393691 413 (sha256
3eb278aa 414 (base32 "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy"))))
49393691
HG
415 (build-system gnu-build-system)
416 (arguments
af514ead 417 '(#:tests? #f ; no check target
49393691
HG
418 #:make-flags (list "CC=gcc"
419 (string-append "PREFIX=" %output))
420 #:phases
421 (modify-phases %standard-phases
af514ead
TGR
422 (delete 'configure) ; no configure script
423 (add-after 'build 'build-extra
424 (lambda* (#:key make-flags #:allow-other-keys)
425 (apply invoke "make" "extra" make-flags)))
426 (add-after 'build 'install-extra
427 (lambda* (#:key make-flags #:allow-other-keys)
428 (apply invoke "make" "install-extra" make-flags))))))
49393691
HG
429 (inputs
430 `(("eudev" ,eudev)
431 ("parted" ,parted)))
432 (home-page "http://oss.digirati.com.br/f3/")
433 (synopsis "Test real capacity of flash memory cards and such.")
434 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
435capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
436the card and then checks if can read it. It will assure you haven't been sold
437a card with a smaller capacity than stated.")
438 (license license:gpl3+)))
9b36e3bf
DM
439
440(define-public python-parted
441 (package
442 (name "python-parted")
89512e1b 443 (version "3.11.2")
9b36e3bf
DM
444 (source
445 (origin
455d29dd
TGR
446 (method git-fetch)
447 (uri (git-reference
448 (url "https://github.com/dcantrell/pyparted.git")
449 (commit (string-append "v" version))))
450 (file-name (git-file-name name version))
9b36e3bf 451 (sha256
455d29dd 452 (base32 "0r6916n3w4vldxrq30a3z2iagvxgly4vfmlidjm65vwqnyv17bvn"))))
9b36e3bf
DM
453 (build-system python-build-system)
454 (arguments
455 `(#:phases
456 (modify-phases %standard-phases
457 (delete 'check)
458 (add-after 'install 'check
459 (lambda* (#:key outputs inputs #:allow-other-keys)
460 (add-installed-pythonpath inputs outputs)
461 ;; See <https://github.com/dcantrell/pyparted/issues/47>.
462 (substitute* "tests/test__ped_ped.py"
463 (("\"/tmp/temp-device-\"") "self.path"))
464 (invoke "python" "-m" "unittest" "discover" "-v")
465 #t)))))
466 (native-inputs
467 `(("e2fsprogs" ,e2fsprogs)
468 ("pkg-config" ,pkg-config)))
469 (propagated-inputs
470 `(("python-six" ,python-six)))
471 (inputs
472 `(("parted" ,parted)))
473 (home-page "https://github.com/dcantrell/pyparted")
474 (synopsis "Parted bindings for Python")
475 (description "This package provides @code{parted} bindings for Python.")
476 (license license:gpl2+)))
477
478(define-public python2-parted
479 (package-with-python2 python-parted))
d232e02e
VD
480
481(define-public duperemove
482 (package
483 (name "duperemove")
3d238656 484 (version "0.11.1")
acc6eb89
TGR
485 (source
486 (origin
487 (method git-fetch)
488 (uri (git-reference
489 (url "https://github.com/markfasheh/duperemove.git")
490 (commit (string-append "v" version))))
491 (sha256
492 (base32 "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"))
493 (file-name (git-file-name name version))))
d232e02e
VD
494 (build-system gnu-build-system)
495 (native-inputs
496 `(("pkg-config" ,pkg-config)))
497 (inputs
498 `(("glib" ,glib)
499 ("sqlite" ,sqlite)))
500 (arguments
51c4fb00 501 `(#:tests? #f ; no test suite
d232e02e
VD
502 #:phases
503 (modify-phases %standard-phases
51c4fb00 504 (delete 'configure)) ; no configure script
d232e02e
VD
505 #:make-flags (list (string-append "PREFIX=" %output)
506 "CC=gcc")))
507 (home-page "https://github.com/markfasheh/duperemove")
508 (synopsis "Tools for de-duplicating file system data")
509 (description "Duperemove is a simple tool for finding duplicated extents
510and submitting them for deduplication. When given a list of files it will
511hash their contents on a block by block basis and compare those hashes to each
512other, finding and categorizing blocks that match each other. When given the
513@option{-d} option, duperemove will submit those extents for deduplication
514using the Linux kernel extent-same @code{ioctl}.
515
516Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
517existing hash file, duperemove will only compute hashes for those files which
518have changed since the last run. Thus you can run duperemove repeatedly on
519your data as it changes, without having to re-checksum unchanged data.
520
521Duperemove can also take input from the @command{fdupes} program.")
522 (license license:gpl2)))
834b0b9a
EB
523
524(define-public ranger
525 (package
526 (name "ranger")
7ff557a5 527 (version "1.9.3")
834b0b9a
EB
528 (source (origin
529 (method url-fetch)
530 (uri (string-append "https://ranger.github.io/"
531 "ranger-" version ".tar.gz"))
532 (sha256
533 (base32
7ff557a5 534 "0lfjrpv3z4h0knd3v94fijrw2zjba51mrp3mjqx2c98wr428l26f"))))
834b0b9a 535 (build-system python-build-system)
19b662ea
RH
536 (inputs
537 `(("w3m" ,w3m)))
43c97cce
TGR
538 (native-inputs
539 `(("which" ,which)
540
541 ;; For tests.
542 ("python-pytest" ,python-pytest)))
19b662ea 543 (arguments
43c97cce
TGR
544 '( ;; The 'test' target runs developer tools like pylint, which fail.
545 #:test-target "test_pytest"
19b662ea
RH
546 #:phases
547 (modify-phases %standard-phases
548 (add-after 'configure 'wrap-program
549 ;; Tell 'ranger' where 'w3mimgdisplay' is.
550 (lambda* (#:key inputs outputs #:allow-other-keys)
551 (let* ((out (assoc-ref outputs "out"))
552 (ranger (string-append out "/bin/ranger"))
553 (w3m (assoc-ref inputs "w3m"))
554 (w3mimgdisplay (string-append w3m
555 "/libexec/w3m/w3mimgdisplay")))
556 (wrap-program ranger
557 `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
3d0fdb34
TGR
558 #t)))
559 (replace 'check
43c97cce
TGR
560 ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
561 (lambda* (#:key test-target #:allow-other-keys)
562 (invoke "make" test-target))))))
834b0b9a
EB
563 (home-page "https://ranger.github.io/")
564 (synopsis "Console file manager")
adfc742c
EB
565 (description "ranger is a console file manager with Vi key bindings. It
566provides a minimalistic and nice curses interface with a view on the directory
567hierarchy. It ships with @code{rifle}, a file launcher that is good at
568automatically finding out which program to use for what file type.")
834b0b9a 569 (license license:gpl3)))
dedc0d0b
PN
570
571(define-public volume-key
572 (package
573 (name "volume-key")
8984dbd0 574 (version "0.3.12")
dedc0d0b
PN
575 (source (origin
576 (method url-fetch)
577 (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
578 version ".tar.xz"))
579 (sha256
580 (base32
8984dbd0 581 "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
dedc0d0b
PN
582 (build-system gnu-build-system)
583 (native-inputs
584 `(("pkg-config" ,pkg-config)
585 ("util-linux" ,util-linux)
586 ("swig" ,swig)
8984dbd0 587 ("python" ,python-3))) ; used to generate the Python bindings
dedc0d0b
PN
588 (inputs
589 `(("cryptsetup" ,cryptsetup)
590 ("nss" ,nss)
8984dbd0 591 ("lvm2" ,lvm2) ; for "-ldevmapper"
dedc0d0b
PN
592 ("glib" ,glib)
593 ("gpgme" ,gpgme)))
594 (arguments
8984dbd0 595 `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
dedc0d0b
PN
596 #:phases
597 (modify-phases %standard-phases
598 (add-before 'configure 'patch-python.h-path
599 (lambda* (#:key inputs #:allow-other-keys)
600 (let ((python (assoc-ref inputs "python")))
601 (substitute* "Makefile.in"
602 (("/usr/include/python") (string-append python "/include/python")))
603 #t))))))
604 (home-page "https://pagure.io/volume_key")
605 (synopsis "Manipulate storage volume encryption keys")
606 (description
607 "This package provides a library for manipulating storage volume
608encryption keys and storing them separately from volumes to handle forgotten
609passphrases.")
610 (license license:gpl2)))
f7a4f7c0
PN
611
612(define-public ndctl
613 (package
614 (name "ndctl")
aa243f9d 615 (version "67")
f7a4f7c0
PN
616 (source (origin
617 (method git-fetch)
618 (uri (git-reference
1f033795 619 (url "https://github.com/pmem/ndctl.git")
f7a4f7c0 620 (commit (string-append "v" version))))
1f033795 621 (file-name (git-file-name name version))
f7a4f7c0
PN
622 (sha256
623 (base32
aa243f9d 624 "076jgw1g2aafqgnq705in0wnabysqk46dq5yxdv1qzgjmyhka39n"))))
f7a4f7c0
PN
625 (build-system gnu-build-system)
626 (native-inputs
627 `(("asciidoc" ,asciidoc)
628 ("automake" ,automake)
629 ("autoconf" ,autoconf)
1f033795 630 ("bash-completion" ,bash-completion)
f7a4f7c0
PN
631 ("docbook-xsl" ,docbook-xsl)
632 ("libtool" ,libtool)
633 ("libxml2" ,libxml2)
634 ("pkg-config" ,pkg-config)
635 ("xmlto" ,xmlto)
1f033795 636 ;; Required for offline docbook generation.
f7a4f7c0
PN
637 ("which" ,which)))
638 (inputs
639 `(("eudev" ,eudev)
640 ("json-c" ,json-c)
f95114e5 641 ("keyutils" ,keyutils)
f7a4f7c0
PN
642 ("kmod" ,kmod)
643 ("util-linux" ,util-linux)))
644 (arguments
1f033795
TGR
645 `(#:configure-flags
646 (list "--disable-asciidoctor" ; use docbook-xsl instead
647 "--without-systemd")
648 #:phases
f7a4f7c0 649 (modify-phases %standard-phases
a926109d 650 (add-after 'unpack 'patch-FHS-file-names
f7a4f7c0 651 (lambda _
f7a4f7c0
PN
652 (substitute* "git-version-gen"
653 (("/bin/sh") (which "sh")))
654 (substitute* "git-version"
a926109d
TGR
655 (("/bin/bash") (which "bash")))
656 #t)))
f7a4f7c0
PN
657 #:make-flags
658 (let ((out (assoc-ref %outputs "out")))
659 (list (string-append "BASH_COMPLETION_DIR=" out
660 "/share/bash-completion/completions")))))
661 (home-page "https://github.com/pmem/ndctl")
662 (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
663 (description
664 "This package provides a utility library for managing the
665libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
666 ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
667 ;; the effective license. Note that some files under ccan/ are
668 ;; covered by BSD-3 or public domain, see the individual folders.
669 (license license:gpl2)))
82aac7c1
PN
670
671(define-public dmraid
672 (package
673 (name "dmraid")
674 (version "1.0.0.rc16-3")
675 (source (origin
676 (method url-fetch)
677 (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
678 version ".tar.bz2"))
679 (sha256
680 (base32
681 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
682 (build-system gnu-build-system)
683 (inputs `(("lvm2" ,lvm2)))
684 (native-inputs `(("which" ,which)))
685 (arguments
686 `(#:tests? #f ; No tests.
22070535
MB
687 ;; Prevent a race condition where some target would attempt to link
688 ;; libdmraid.so before it had been built as reported in
689 ;; <https://bugs.gnu.org/31999#187>.
690 #:parallel-build? #f
82aac7c1
PN
691 #:phases (modify-phases %standard-phases
692 (add-before 'configure 'change-directory
693 (lambda _
694 (chdir (string-append ,version "/dmraid"))
695 (substitute* "make.tmpl.in"
696 (("/bin/sh") (which "sh")))
697 #t)))
698 #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
699 ;; find libdmraid.so.
700 (string-append "LDFLAGS=-Wl,-rpath="
701 (assoc-ref %outputs "out")
702 "/lib"))))
703 (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
704 (synopsis "Device mapper RAID interface")
705 (description
706 "This software supports RAID device discovery, RAID set activation, creation,
707removal, rebuild and display of properties for ATARAID/DDF1 metadata.
708
709@command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
710to create devices with respective mappings for the ATARAID sets discovered.")
711 (license license:gpl2+)))
fac91b39
PN
712
713(define-public libblockdev
714 (package
715 (name "libblockdev")
c00181d1 716 (version "2.23")
fac91b39
PN
717 (source (origin
718 (method url-fetch)
4273a7ef
TGR
719 (uri (string-append "https://github.com/storaged-project/"
720 "libblockdev/releases/download/"
fac91b39
PN
721 version "-1/libblockdev-" version ".tar.gz"))
722 (sha256
723 (base32
c00181d1 724 "15c7g2gbkahmy8c6677pvbvblan5h8jxcqqmn6nlvqwqynq2mkjm"))))
fac91b39
PN
725 (build-system gnu-build-system)
726 (native-inputs
727 `(("pkg-config" ,pkg-config)
728 ("python" ,python-wrapper)
729 ("util-linux" ,util-linux)))
730 (inputs
731 `(("btrfs-progs" ,btrfs-progs)
732 ("cryptsetup" ,cryptsetup)
733 ("dosfstools" ,dosfstools)
734 ("dmraid" ,dmraid)
735 ("eudev" ,eudev)
736 ("glib" ,glib)
737 ("gobject-introspection" ,gobject-introspection)
738 ("kmod" ,kmod)
739 ("libbytesize" ,libbytesize)
740 ("libyaml" ,libyaml)
741 ("lvm2" ,lvm2)
742 ("mdadm" ,mdadm)
743 ("ndctl" ,ndctl)
744 ("nss" ,nss)
745 ("parted" ,parted)
746 ("volume-key" ,volume-key)
747 ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
748 ))
749 (home-page "https://github.com/storaged-project/libblockdev")
750 (synopsis "Library for manipulating block devices")
751 (description
752 "libblockdev is a C library supporting GObject introspection for
753manipulation of block devices. It has a plugin-based architecture where each
754technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
755plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
756LVM D-Bus API).")
4273a7ef 757 (license license:lgpl2.1+)))
3b451546
PN
758
759(define-public rmlint
760 (package
761 (name "rmlint")
9b9086ea 762 (version "2.9.0")
3b451546
PN
763 (source (origin
764 (method git-fetch)
765 (uri (git-reference
766 (url "https://github.com/sahib/rmlint")
767 (commit (string-append "v" version))))
768 (file-name (git-file-name name version))
769 (sha256
770 (base32
9b9086ea 771 "1b5cziam14h80xrfb285fmfrzz2rligxcpsq1xsig14xf4l2875i"))))
3b451546
PN
772 (build-system scons-build-system)
773 (arguments
774 `(#:scons ,scons-python2
775 #:scons-flags (list (string-append "--prefix=" %output)
776 (string-append "--actual-prefix=" %output))
777 #:tests? #f ; No tests?
778 #:phases
779 (modify-phases %standard-phases
780 (add-after 'unpack 'scons-propagate-environment
781 (lambda* (#:key inputs #:allow-other-keys)
782 ;; TODO: `rmlint --gui` fails with
783 ;; "Failed to load shredder: No module named 'shredder'".
784 ;; The GUI might also need extra dependencies, such as
785 ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
786 (substitute* "lib/cmdline.c"
787 (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
788 (string-append
789 "const char *commands[] = {\""
790 (assoc-ref inputs "python") "/bin/python"
791 "\", \"python\", NULL};")))
792 ;; By design, SCons does not, by default, propagate
793 ;; environment variables to subprocesses. See:
794 ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
795 ;; Here, we modify the SConstruct file to arrange for
796 ;; environment variables to be propagated.
797 (substitute* "SConstruct"
798 (("^env = Environment\\(.*\\)" all)
799 (string-append
800 all
801 "\nenv['ENV']=os.environ"))))))))
802 (native-inputs
803 `(("pkg-config" ,pkg-config)
804 ("glib:bin" ,glib "bin")
805 ("python-sphinx" ,python-sphinx)))
806 (inputs
807 `(("python" ,python-wrapper)
808 ("glib" ,glib)
809 ("libelf" ,libelf)
810 ("elfutils" ,elfutils)
811 ("json-glib" ,json-glib)
812 ("libblkid" ,util-linux)))
813 (home-page "https://rmlint.rtfd.org")
52beae7b 814 (synopsis "Remove duplicates and other lint from the file system")
3b451546 815 (description "@command{rmlint} finds space waste and other broken things
52beae7b 816on your file system and offers to remove it. @command{rmlint} can find:
3b451546
PN
817
818@itemize
819@item duplicate files and duplicate directories,
820@item non-stripped binaries (i.e. binaries with debug symbols),
821@item broken symbolic links,
822@item empty files and directories,
823@item files with broken user and/or group ID.
824@end itemize\n")
825 (license license:gpl3+)))