gnu: emacs-prop-menu: Use git-reference.
[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 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2016, 2019 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 ;;;
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
34 (define-module (gnu packages disk)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages c)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages crypto)
43 #:use-module (gnu packages cryptsetup)
44 #:use-module (gnu packages docbook)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages elf)
47 #:use-module (gnu packages gettext)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages gnupg)
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages ncurses)
55 #:use-module (gnu packages nss)
56 #:use-module (gnu packages perl)
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages popt)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-xyz)
61 #:use-module (gnu packages readline)
62 #:use-module (gnu packages sphinx)
63 #:use-module (gnu packages sqlite)
64 #:use-module (gnu packages swig)
65 #:use-module (gnu packages vim)
66 #:use-module (gnu packages w3m)
67 #:use-module (gnu packages web)
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)
72 #:use-module (guix build-system scons)
73 #:use-module (guix download)
74 #:use-module (guix git-download)
75 #:use-module ((guix licenses) #:prefix license:)
76 #:use-module (guix packages))
77
78 (define-public parted
79 (package
80 (name "parted")
81 (version "3.3")
82 (source (origin
83 (method url-fetch)
84 (uri (string-append "mirror://gnu/parted/parted-"
85 version ".tar.xz"))
86 (sha256
87 (base32
88 "0i1xp367wpqw75b20c3jnism3dg3yqj4a7a22p2jb1h1hyyv9qjp"))))
89 (build-system gnu-build-system)
90 (arguments
91 `(#:phases
92 (modify-phases %standard-phases
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)))))
100 (inputs
101 `(("lvm2" ,lvm2)
102 ("readline" ,readline)
103 ("util-linux" ,util-linux)))
104 (native-inputs
105 `(("gettext" ,gettext-minimal)
106 ;; For the tests.
107 ("e2fsprogs" ,e2fsprogs)
108 ("perl" ,perl)
109 ("python" ,python-2)))
110 (home-page "https://www.gnu.org/software/parted/")
111 (synopsis "Disk partition editor")
112 (description
113 "GNU Parted is a package for creating and manipulating disk partition
114 tables. It includes a library and command-line utility.")
115 (license license:gpl3+)))
116
117 (define-public fdisk
118 (package
119 (name "fdisk")
120 (version "2.0.0a1")
121 (source
122 (origin
123 (method url-fetch)
124 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
125 version ".tar.gz"))
126 (sha256
127 (base32
128 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
129 (build-system gnu-build-system)
130 (inputs
131 `(("gettext" ,gettext-minimal)
132 ("guile" ,guile-1.8)
133 ("util-linux" ,util-linux)
134 ("parted" ,parted)))
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"))))
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
153 fdisk. fdisk is used for the creation and manipulation of disk partition
154 tables, and it understands a variety of different formats.")
155 (license license:gpl3+)))
156
157 (define-public gptfdisk
158 (package
159 (name "gptfdisk")
160 (version "1.0.4")
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
168 "13d7gff4prl1nsdknjigmb7bbqhn79165n01v4y9mwbnd0d3jqxn"))))
169 (build-system gnu-build-system)
170 (inputs
171 `(("gettext" ,gettext-minimal)
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)
184 (let* ((out (assoc-ref outputs "out"))
185 (bin (string-append out "/bin"))
186 (man (string-append out "/share/man/man8")))
187 (install-file "gdisk" bin)
188 (install-file "sgdisk" bin)
189 (install-file "cgdisk" bin)
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)))))))
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
198 works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
199 disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
200 scheme.")
201 (license license:gpl2)))
202
203 (define-public ddrescue
204 (package
205 (name "ddrescue")
206 (version "1.24")
207 (source
208 (origin
209 (method url-fetch)
210 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
211 version ".tar.lz"))
212 (sha256
213 (base32 "11qh0bbzf00mfb4yq35gnv5m260k4d7q9ixklry6bqvhvvp3ypab"))))
214 (build-system gnu-build-system)
215 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
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
220 from one file to another, working to rescue data in case of read errors. The
221 program also includes a tool for manipulating its log files, which are used
222 to recover data more efficiently by only reading the necessary blocks.")
223 (license license:gpl3+)))
224
225 (define-public dosfstools
226 (package
227 (name "dosfstools")
228 (version "4.1")
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
237 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
238 (build-system gnu-build-system)
239 (arguments
240 `(#:configure-flags (list "--enable-compat-symlinks")
241 #:make-flags (list (string-append "PREFIX=" %output)
242 "CC=gcc")))
243 (native-inputs
244 `(("xxd" ,xxd))) ; for tests
245 (home-page "https://github.com/dosfstools/dosfstools")
246 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
247 (description
248 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
249 which respectively make and check MS-DOS FAT file systems.")
250 (license license:gpl3+)))
251
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}
283 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
284 (license (package-license dosfstools))))
285
286 (define-public sdparm
287 (package
288 (name "sdparm")
289 (version "1.10")
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
297 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
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
303 SCSI disks, in which case the role of @command{sdparm} is similar to its
304 namesake: the @command{hdparm} utility originally designed for ATA disks.
305 However, @command{sdparm} can be used to access parameters on any device that
306 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
307 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
308 also send commands associated with starting and stopping the media, loading
309 and unloading removable media and some other housekeeping functions.")
310 (license license:bsd-3)))
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
338 present in many Western Digital hard drives. This timer is part of the
339 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
340 the default timer setting is not well suited to Linux or other *nix systems,
341 and can dramatically shorten the lifespan of the drive if left unchecked.")
342 (license license:gpl3+)))
343
344 (define-public gparted
345 (package
346 (name "gparted")
347 (version "1.0.0")
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
354 (base32
355 "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4"))))
356 (build-system gnu-build-system)
357 (arguments
358 ;; Tests require access to paths outside the build container, such
359 ;; as '/dev/disk/by-id'
360 `(#:tests? #f))
361 (inputs
362 `(("util-linux" ,util-linux)
363 ("parted" ,parted)
364 ("glib" ,glib)
365 ("gtkmm" ,gtkmm)
366 ("libxml2" ,libxml2)
367 ("yelp-tools" ,yelp-tools)))
368 (native-inputs
369 `(("intltool" ,intltool)
370 ("itstool" ,itstool)
371 ("lvm2" ,lvm2) ; for tests
372 ("pkg-config" ,pkg-config)))
373 (home-page "https://gparted.org/")
374 (synopsis "Partition editor to graphically manage disk partitions")
375 (description "GParted is a GNOME partition editor for creating,
376 reorganizing, and deleting disk partitions. It uses libparted from the parted
377 project to detect and manipulate partition tables. Optional file system tools
378 permit managing file systems not included in libparted.")
379 ;; The home page says GPLv2, but the source code says GPLv2+.
380 (license license:gpl2+)))
381
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
397 written in Python. It displays the amount of disk space available on the
398 mounted file systems, using different colours for different types of file
399 systems. Output format is completely customizable.")
400 (license license:public-domain)))
401
402 (define-public f3
403 (package
404 (name "f3")
405 (version "7.2")
406 (source
407 (origin
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))
413 (sha256
414 (base32 "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy"))))
415 (build-system gnu-build-system)
416 (arguments
417 '(#:tests? #f ; no check target
418 #:make-flags (list "CC=gcc"
419 (string-append "PREFIX=" %output))
420 #:phases
421 (modify-phases %standard-phases
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))))))
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
435 capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
436 the card and then checks if can read it. It will assure you haven't been sold
437 a card with a smaller capacity than stated.")
438 (license license:gpl3+)))
439
440 (define-public python-parted
441 (package
442 (name "python-parted")
443 (version "3.11.2")
444 (source
445 (origin
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))
451 (sha256
452 (base32 "0r6916n3w4vldxrq30a3z2iagvxgly4vfmlidjm65vwqnyv17bvn"))))
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))
480
481 (define-public duperemove
482 (package
483 (name "duperemove")
484 (version "0.11.1")
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))))
494 (build-system gnu-build-system)
495 (native-inputs
496 `(("pkg-config" ,pkg-config)))
497 (inputs
498 `(("glib" ,glib)
499 ("sqlite" ,sqlite)))
500 (arguments
501 `(#:tests? #f ; no test suite
502 #:phases
503 (modify-phases %standard-phases
504 (delete 'configure)) ; no configure script
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
510 and submitting them for deduplication. When given a list of files it will
511 hash their contents on a block by block basis and compare those hashes to each
512 other, finding and categorizing blocks that match each other. When given the
513 @option{-d} option, duperemove will submit those extents for deduplication
514 using the Linux kernel extent-same @code{ioctl}.
515
516 Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
517 existing hash file, duperemove will only compute hashes for those files which
518 have changed since the last run. Thus you can run duperemove repeatedly on
519 your data as it changes, without having to re-checksum unchanged data.
520
521 Duperemove can also take input from the @command{fdupes} program.")
522 (license license:gpl2)))
523
524 (define-public ranger
525 (package
526 (name "ranger")
527 (version "1.9.2")
528 (source (origin
529 (method url-fetch)
530 (uri (string-append "https://ranger.github.io/"
531 "ranger-" version ".tar.gz"))
532 (sha256
533 (base32
534 "12kbsqakbxs09y0x8hy66mmaf72rk0p850x7ryk2ghkq7wfin78f"))))
535 (build-system python-build-system)
536 (inputs
537 `(("w3m" ,w3m)))
538 (native-inputs
539 `(("which" ,which)
540
541 ;; For tests.
542 ("python-pytest" ,python-pytest)))
543 (arguments
544 '( ;; The 'test' target runs developer tools like pylint, which fail.
545 #:test-target "test_pytest"
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)))
558 #t)))
559 (replace 'check
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))))))
563 (home-page "https://ranger.github.io/")
564 (synopsis "Console file manager")
565 (description "ranger is a console file manager with Vi key bindings. It
566 provides a minimalistic and nice curses interface with a view on the directory
567 hierarchy. It ships with @code{rifle}, a file launcher that is good at
568 automatically finding out which program to use for what file type.")
569 (license license:gpl3)))
570
571 (define-public volume-key
572 (package
573 (name "volume-key")
574 (version "0.3.12")
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
581 "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
582 (build-system gnu-build-system)
583 (native-inputs
584 `(("pkg-config" ,pkg-config)
585 ("util-linux" ,util-linux)
586 ("swig" ,swig)
587 ("python" ,python-3))) ; used to generate the Python bindings
588 (inputs
589 `(("cryptsetup" ,cryptsetup)
590 ("nss" ,nss)
591 ("lvm2" ,lvm2) ; for "-ldevmapper"
592 ("glib" ,glib)
593 ("gpgme" ,gpgme)))
594 (arguments
595 `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
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
608 encryption keys and storing them separately from volumes to handle forgotten
609 passphrases.")
610 (license license:gpl2)))
611
612 (define-public ndctl
613 (package
614 (name "ndctl")
615 (version "67")
616 (source (origin
617 (method git-fetch)
618 (uri (git-reference
619 (url "https://github.com/pmem/ndctl.git")
620 (commit (string-append "v" version))))
621 (file-name (git-file-name name version))
622 (sha256
623 (base32
624 "076jgw1g2aafqgnq705in0wnabysqk46dq5yxdv1qzgjmyhka39n"))))
625 (build-system gnu-build-system)
626 (native-inputs
627 `(("asciidoc" ,asciidoc)
628 ("automake" ,automake)
629 ("autoconf" ,autoconf)
630 ("bash-completion" ,bash-completion)
631 ("docbook-xsl" ,docbook-xsl)
632 ("libtool" ,libtool)
633 ("libxml2" ,libxml2)
634 ("pkg-config" ,pkg-config)
635 ("xmlto" ,xmlto)
636 ;; Required for offline docbook generation.
637 ("which" ,which)))
638 (inputs
639 `(("eudev" ,eudev)
640 ("json-c" ,json-c)
641 ("keyutils" ,keyutils)
642 ("kmod" ,kmod)
643 ("util-linux" ,util-linux)))
644 (arguments
645 `(#:configure-flags
646 (list "--disable-asciidoctor" ; use docbook-xsl instead
647 "--without-systemd")
648 #:phases
649 (modify-phases %standard-phases
650 (add-after 'unpack 'patch-FHS-file-names
651 (lambda _
652 (substitute* "git-version-gen"
653 (("/bin/sh") (which "sh")))
654 (substitute* "git-version"
655 (("/bin/bash") (which "bash")))
656 #t)))
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
665 libnvdimm (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)))
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.
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
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,
707 removal, rebuild and display of properties for ATARAID/DDF1 metadata.
708
709 @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
710 to create devices with respective mappings for the ATARAID sets discovered.")
711 (license license:gpl2+)))
712
713 (define-public libblockdev
714 (package
715 (name "libblockdev")
716 (version "2.23")
717 (source (origin
718 (method url-fetch)
719 (uri (string-append "https://github.com/storaged-project/"
720 "libblockdev/releases/download/"
721 version "-1/libblockdev-" version ".tar.gz"))
722 (sha256
723 (base32
724 "15c7g2gbkahmy8c6677pvbvblan5h8jxcqqmn6nlvqwqynq2mkjm"))))
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
753 manipulation of block devices. It has a plugin-based architecture where each
754 technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
755 plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
756 LVM D-Bus API).")
757 (license license:lgpl2.1+)))
758
759 (define-public rmlint
760 (package
761 (name "rmlint")
762 (version "2.9.0")
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
771 "1b5cziam14h80xrfb285fmfrzz2rligxcpsq1xsig14xf4l2875i"))))
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")
814 (synopsis "Remove duplicates and other lint from the file system")
815 (description "@command{rmlint} finds space waste and other broken things
816 on your file system and offers to remove it. @command{rmlint} can find:
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+)))