projects/guix·blob ruby-team · refs

2029 lines · 80.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2015 Mathieu Lirzin <[email protected]>
4;;; Copyright © 2015 Mark H Weaver <[email protected]>
5;;; Copyright © 2016, 2018–2022 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2016, 2019-2021, 2023, 2025 Efraim Flashner <[email protected]>
7;;; Copyright © 2016, 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
8;;; Copyright © 2016 Roel Janssen <[email protected]>
9;;; Copyright © 2016, 2017 Marius Bakke <[email protected]>
10;;; Copyright © 2017 Hartmut Goebel <[email protected]>
11;;; Copyright © 2017 Stefan Reichör <[email protected]>
12;;; Copyright © 2018 Vasile Dumitrascu <[email protected]>
13;;; Copyright © 2018 Eric Bavier <[email protected]>
14;;; Copyright © 2018 Rutger Helling <[email protected]>
15;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <[email protected]>
16;;; Copyright © 2019, 2021 Leo Famulari <[email protected]>
17;;; Copyright © 2019 Pierre Langlois <[email protected]>
18;;; Copyright © 2020 Pkill -9 <[email protected]>
19;;; Copyright © 2020 Vincent Legoll <[email protected]>
20;;; Copyright © 2020 Raghav Gururajan <[email protected]>
21;;; Copyright © 2021 Michael Rohleder <[email protected]>
22;;; Copyright © 2021 Mathieu Othacehe <[email protected]>
23;;; Copyright © 2021 Brice Waegeneire <[email protected]>
24;;; Copyright © 2021 Justin Veilleux <[email protected]>
25;;; Copyright © 2021 Sarah Morgensen <[email protected]>
26;;; Copyright © 2014, 2022 Ludovic Courtès <[email protected]>
27;;; Copyright © 2022, 2025 Maxim Cournoyer <[email protected]>
28;;; Copyright © 2022 Disseminate Dissent <[email protected]>
29;;; Copyright © 2023 Timotej Lazar <[email protected]>
30;;; Copyright © 2023 Morgan Smith <[email protected]>
31;;; Copyright © 2023 Zheng Junjie <[email protected]>
32;;; Copyright © 2024-2025 Sharlatan Hellseher <[email protected]>
33;;; Copyright © 2025 Ashish SHUKLA <[email protected]>
34;;; Copyright © 2025, 2026 Vinicius Monego <[email protected]>
35;;; Copyright © 2025 Grigory Shepelev <[email protected]>
36;;; Copyright © 2026 Luis Guilherme Coelho <[email protected]>
37
38;;;
39;;; This file is part of GNU Guix.
40;;;
41;;; GNU Guix is free software; you can redistribute it and/or modify it
42;;; under the terms of the GNU General Public License as published by
43;;; the Free Software Foundation; either version 3 of the License, or (at
44;;; your option) any later version.
45;;;
46;;; GNU Guix is distributed in the hope that it will be useful, but
47;;; WITHOUT ANY WARRANTY; without even the implied warranty of
48;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49;;; GNU General Public License for more details.
50;;;
51;;; You should have received a copy of the GNU General Public License
52;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
53
54(define-module (gnu packages disk)
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix build-system glib-or-gtk)
57 #:use-module (guix build-system gnu)
58 #:use-module (guix build-system go)
59 #:use-module (guix build-system meson)
60 #:use-module (guix build-system perl)
61 #:use-module (guix build-system pyproject)
62 #:use-module (guix build-system qt)
63 #:use-module (guix build-system scons)
64 #:use-module (guix build-system trivial)
65 #:use-module (guix download)
66 #:use-module (guix gexp)
67 #:use-module (guix git-download)
68 #:use-module (guix packages)
69 #:use-module (guix utils)
70 #:use-module (gnu packages)
71 #:use-module (gnu packages admin)
72 #:use-module (gnu packages autotools)
73 #:use-module (gnu packages base)
74 #:use-module (gnu packages bash)
75 #:use-module (gnu packages build-tools)
76 #:use-module (gnu packages c)
77 #:use-module (gnu packages nss)
78 #:use-module (gnu packages check)
79 #:use-module (gnu packages compression)
80 #:use-module (gnu packages crypto)
81 #:use-module (gnu packages cryptsetup)
82 #:use-module (gnu packages databases)
83 #:use-module (gnu packages digest)
84 #:use-module (gnu packages docbook)
85 #:use-module (gnu packages documentation)
86 #:use-module (gnu packages elf)
87 #:use-module (gnu packages file)
88 #:use-module (gnu packages file-systems)
89 #:use-module (gnu packages fontutils)
90 #:use-module (gnu packages freedesktop)
91 #:use-module (gnu packages gettext)
92 #:use-module (gnu packages glib)
93 #:use-module (gnu packages gnome)
94 #:use-module (gnu packages gnupg)
95 #:use-module (gnu packages golang-build)
96 #:use-module (gnu packages golang-check)
97 #:use-module (gnu packages golang-compression)
98 #:use-module (gnu packages golang-xyz)
99 #:use-module (gnu packages graphics)
100 #:use-module (gnu packages gtk)
101 #:use-module (gnu packages guile)
102 #:use-module (gnu packages hurd)
103 #:use-module (gnu packages image)
104 #:use-module (gnu packages imagemagick)
105 #:use-module (gnu packages libbsd)
106 #:use-module (gnu packages linux)
107 #:use-module (gnu packages ncurses)
108 #:use-module (gnu packages nss)
109 #:use-module (gnu packages perl)
110 #:use-module (gnu packages perl-web)
111 #:use-module (gnu packages pkg-config)
112 #:use-module (gnu packages popt)
113 #:use-module (gnu packages python)
114 #:use-module (gnu packages python-build)
115 #:use-module (gnu packages python-crypto)
116 #:use-module (gnu packages python-web)
117 #:use-module (gnu packages python-xyz)
118 #:use-module (gnu packages qt)
119 #:use-module (gnu packages readline)
120 #:use-module (gnu packages samba)
121 #:use-module (gnu packages serialization)
122 #:use-module (gnu packages sphinx)
123 #:use-module (gnu packages sqlite)
124 #:use-module (gnu packages swig)
125 #:use-module (gnu packages terminals)
126 #:use-module (gnu packages textutils)
127 #:use-module (gnu packages tls)
128 #:use-module (gnu packages vim)
129 #:use-module (gnu packages w3m)
130 #:use-module (gnu packages web)
131 #:use-module (gnu packages xml)
132 #:use-module (gnu packages xorg))
133
134(define-public bcache-tools
135 ;; The 1.1 release is a year old and missing new features & documentation.
136 (let ((commit "096d205a9f1be8540cbc5a468c0da8203023de70")
137 (revision "0"))
138 (package
139 (name "bcache-tools")
140 (version (git-version "1.1" revision commit))
141 (source
142 (origin
143 (method git-fetch)
144 (uri (git-reference
145 (url (string-append "https://git.kernel.org/pub/scm/"
146 "linux/kernel/git/colyli/bcache-tools.git"))
147 (commit commit)))
148 (file-name (git-file-name name version))
149 (sha256
150 (base32 "0r0vwg4vacz5zgsafk360xn7gi2scy01c79mkmjrdyxjfij5z3iy"))))
151 (build-system gnu-build-system)
152 (arguments
153 `(#:tests? #f ; no test suite
154 #:make-flags
155 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
156 (string-append "UDEVLIBDIR=" (assoc-ref %outputs "out")
157 "/lib/udev")
158 (string-append "DRACUTLIBDIR=" (assoc-ref %outputs "out")
159 "/lib/dracut")
160 (string-append "CC=" ,(cc-for-target)))
161 #:phases
162 (modify-phases %standard-phases
163 (delete 'configure) ; no configure script
164 (add-before 'install 'fix-hard-coded-file-names
165 (lambda _
166 ;; Some rules still hard-code /usr.
167 (substitute* "Makefile"
168 (("/usr") "${PREFIX}"))
169 #t))
170 (add-before 'install 'create-target-directories
171 (lambda* (#:key outputs #:allow-other-keys)
172 (let* ((out (assoc-ref outputs "out")))
173 (for-each (lambda (dir)
174 (mkdir-p (string-append out dir)))
175 (list "/lib/udev/rules.d"
176 "/sbin"
177 "/share/man/man8"))
178 #t))))))
179 (native-inputs
180 (list pkg-config))
181 (inputs
182 `(("util-linux:lib" ,util-linux "lib"))) ; libblkid
183 (home-page "https://bcache.evilpiepirate.org")
184 (synopsis "Tools for the Linux kernel block layer cache")
185 (description
186 "This package contains user-space utilities to create and inspect bcache
187partitions. It's rather minimal as bcache is designed to work well without
188configuration on any system.
189
190Linux's @acronym{bcache, block layer cache} lets one or more fast block devices,
191such as flash-based @acronym{SSDs, solid state drives}, to act as a cache for
192one or more slower (and inexpensive) devices, such as hard disk drives or
193redundant storage arrays. In fact, bcache intends to be a superior alternative
194to battery-backed RAID controllers.
195
196Bcache is designed around the performance characteristics of SSDs and tries to
197minimize write inflation. It's file-system agnostic and does both write-through
198and write-back caching.")
199 (license license:gpl2))))
200
201(define-public udevil
202 (package
203 (name "udevil")
204 (version "0.4.4")
205 (source
206 (origin
207 (method git-fetch)
208 (uri
209 (git-reference
210 (url "https://github.com/IgnorantGuru/udevil")
211 (commit version)))
212 (file-name (git-file-name name version))
213 (sha256
214 (base32 "0x9mjr9abvbxzfa9mrip5264iz1qxvsl01k3ybz95q4a7xl4jcb3"))))
215 (build-system gnu-build-system)
216 (arguments
217 `(#:configure-flags
218 (list
219 "--disable-systemd"
220 (string-append "--sysconfdir="
221 (assoc-ref %outputs "out")
222 "/etc")
223 ;; udevil expects these programs to be run with an UID of root.
224 ;; mount and umount are %default-privileged-programs on Guix System;
225 ;; the others must be explicitly added if desired.
226 "--with-mount-prog=/run/privileged/bin/mount"
227 "--with-umount-prog=/run/privileged/bin/umount"
228 "--with-losetup-prog=/run/privileged/bin/losetup"
229 "--with-setfacl-prog=/run/privileged/bin/setfacl")
230 #:phases
231 (modify-phases %standard-phases
232 (add-after 'unpack 'remove-root-reference
233 (lambda _
234 (substitute* "src/Makefile.in"
235 (("-o root -g root") ""))
236 #t))
237 (add-after 'unpack 'patch-udevil-reference
238 ;; udevil expects itself to be run with uid set as root.
239 ;; devmon also expects udevil to be run with uid set as root.
240 ;; user has to manually add udevil to privileged-programs.
241 (lambda _
242 (substitute* "src/udevil.c"
243 (("/usr/bin/udevil") "/run/privileged/bin/udevil"))
244 (substitute* "src/devmon"
245 (("`which udevil 2>/dev/null`") "/run/privileged/bin/udevil"))
246 #t)))))
247 (native-inputs
248 (list intltool pkg-config))
249 (inputs
250 (list cifs-utils
251 curlftpfs
252 eudev
253 fakeroot
254 glib
255 sshfs))
256 (synopsis "Device and file system manager")
257 (description "udevil is a command line program that mounts and unmounts
258removable devices without a password, shows device info, and monitors device
259changes. It can also mount ISO files, NFS, SMB, FTP, SSH and WebDAV URLs, and
260tmpfs/ramfs filesystems.")
261 (home-page "https://ignorantguru.github.io/udevil/")
262 (license license:gpl3+)))
263
264(define-public parted
265 (package
266 (name "parted")
267 (version "3.7")
268 (source (origin
269 (method url-fetch)
270 (uri (string-append "mirror://gnu/parted/parted-"
271 version ".tar.xz"))
272 (sha256
273 (base32
274 "0yzga4cjq3yplqs47dl9714vwc3v3v8nxrj80rdc5wx4c5syb380"))))
275 (build-system gnu-build-system)
276 (arguments
277 (list
278 #:configure-flags (if (target-hurd?)
279 #~'("--disable-device-mapper")
280 #~'())
281 #:tests? (not (or (target-hurd?)
282 (%current-target-system)))
283 #:phases
284 #~(modify-phases %standard-phases
285 (add-after 'unpack 'fix-locales-and-python
286 (lambda _
287 (substitute* "tests/msdos-overlap"
288 (("/usr/bin/python") (which "python"))))))))
289 (inputs
290 `(,@(if (target-hurd?)
291 (list hurd-minimal)
292 (list lvm2))
293 ,readline
294 (,util-linux "lib")))
295 (native-inputs
296 (list gettext-minimal
297 pkg-config
298
299 ;; For the tests.
300 e2fsprogs
301 perl
302 python-wrapper
303 util-linux))
304 (outputs '("out" "debug"))
305 (home-page "https://www.gnu.org/software/parted/")
306 (synopsis "Disk partition editor")
307 (description
308 "GNU Parted is a package for creating and manipulating disk partition
309tables. It includes a library and command-line utility.")
310 (license license:gpl3+)))
311
312(define-public fdisk
313 (package
314 (name "fdisk")
315 (version "2.0.0a1")
316 (source
317 (origin
318 (method url-fetch)
319 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
320 version ".tar.gz"))
321 (sha256
322 (base32
323 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
324 (build-system gnu-build-system)
325 (inputs
326 `(("gettext" ,gettext-minimal)
327 ("guile" ,guile-1.8)
328 ("libxcrypt" ,libxcrypt)
329 ("util-linux" ,util-linux "lib")
330 ("parted" ,parted)))
331 ;; The build neglects to look for its own headers in its own tree. A next
332 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
333 (arguments
334 `(#:phases
335 (modify-phases %standard-phases
336 (add-after 'unpack 'skip-broken-header-probes
337 (lambda _
338 (substitute* "backend/configure"
339 (("gnufdisk-common.h .*") "\n"))
340 #t)))
341 #:make-flags (list (string-append "CPPFLAGS="
342 " -I../common/include "
343 " -I../debug/include "
344 " -I../exception/include")
345 (string-append
346 "CFLAGS="
347 "-Wno-error=implicit-function-declaration "
348 "-Wno-error=incompatible-pointer-types"))))
349 (home-page "https://www.gnu.org/software/fdisk/")
350 (synopsis "Low-level disk partitioning and formatting")
351 (description
352 "GNU fdisk provides a GNU version of the common disk partitioning tool
353fdisk. fdisk is used for the creation and manipulation of disk partition
354tables, and it understands a variety of different formats.")
355 (license license:gpl3+)))
356
357(define-public findimagedupes
358 (package
359 (name "findimagedupes")
360 (version "2.20.1")
361 (source
362 (origin
363 (method git-fetch)
364 (uri (git-reference
365 (url "https://github.com/jhnc/findimagedupes")
366 (commit version)))
367 (file-name (git-file-name name version))
368 (sha256
369 (base32 "1zfxmc6c1z4hzsq3k85xxida1v291frq4wbmxv9cg4jmw0ddk5ic"))))
370 (build-system perl-build-system)
371 (arguments
372 (list
373 #:tests? #f
374 #:phases #~(modify-phases %standard-phases
375 (delete 'configure)
376 (delete 'build)
377 (replace 'install
378 ;; There's no ‘make install’ target.
379 (lambda* (#:key outputs #:allow-other-keys)
380 (install-file "findimagedupes"
381 (string-append #$output "/bin"))))
382 (add-after 'unpack 'use-image-magick
383 ;; TODO: package perl-graphics-magick and switch this out
384 (lambda _
385 (substitute* "findimagedupes"
386 (("Graphics::Magick")
387 "Image::Magick"))))
388 (add-after 'unpack 'set-inline-dir
389 (lambda _
390 (substitute* "findimagedupes"
391 (("/usr/local")
392 #$output))))
393 (add-after 'install 'inline-generation
394 (lambda _
395 (mkdir-p (string-append #$output "/lib/findimagedupes"))
396 (invoke (string-append #$output "/bin/findimagedupes"))))
397 (add-after 'install 'wrap-findimagedupes
398 (lambda* (#:key outputs #:allow-other-keys)
399 (wrap-program (string-append #$output
400 "/bin/findimagedupes")
401 `("PERL5LIB" ":" prefix
402 (,(getenv "PERL5LIB") ,(string-append #$output
403 "/lib/perl5/site_perl")))))))))
404 (inputs (list bash-minimal perl-db-file perl-file-mimeinfo
405 perl-image-magick perl-inline-c))
406 (home-page "https://github.com/jhnc/findimagedupes")
407 (synopsis "Find visually similar or duplicate images")
408 (description "findimagedupes compares a list of files for visual
409similarity.")
410 (license license:gpl3+)))
411
412(define-public gdu
413 (package
414 (name "gdu")
415 (version "5.36.1")
416 (source
417 (origin
418 (method git-fetch)
419 (uri (git-reference
420 (url "https://github.com/dundee/gdu")
421 (commit (string-append "v" version))))
422 (file-name (git-file-name name version))
423 (sha256
424 (base32 "1wpmflp0jmmpzynn420ywgd0nvgm10ijdwksqgn97f48f1yibllf"))))
425 (build-system go-build-system)
426 (arguments
427 (list
428 #:install-source? #f
429 #:import-path "github.com/dundee/gdu/v5/cmd/gdu"
430 #:unpack-path "github.com/dundee/gdu/v5"
431 #:test-subdirs #~(list "../../...")))
432 (native-inputs
433 (list go-github-com-dgraph-io-badger-v4
434 go-github-com-fatih-color
435 go-github-com-gdamore-tcell-v2
436 go-github-com-h2non-filetype
437 go-github-com-maruel-natural
438 go-github-com-mattn-go-isatty
439 go-github-com-pkg-errors
440 go-github-com-rivo-tview
441 go-github-com-sirupsen-logrus
442 go-github-com-spf13-cobra
443 go-github-com-stretchr-testify
444 go-github-com-ulikunitz-xz
445 go-golang-org-x-sys
446 go-golang-org-x-text
447 go-gopkg-in-yaml-v3
448 go-modernc-org-sqlite))
449 (home-page "https://github.com/dundee/gdu")
450 (synopsis "Disk usage analyzer")
451 (description "Gdu is a disk usage analyzer written in Go. It is intended
452primarily for SSD disks where it can fully utilize parallel processing, but it
453also works on HDDs.")
454 (license license:expat)))
455
456(define-public gpart
457 ;; The latest (0.3) release is from 2015 and is missing a crash fix.
458 (let ((commit "ec03350a01ad69708b5a3e2d47b8e002b0eba6c9")
459 (revision "0"))
460 (package
461 (name "gpart")
462 (version (git-version "0.3" revision commit))
463 (source
464 (origin
465 (method git-fetch)
466 (uri (git-reference
467 (url "https://github.com/baruch/gpart")
468 (commit commit)))
469 (file-name (git-file-name name version))
470 (sha256
471 (base32 "1dassswliaiwhhmx7yz540yyxgk53fvg672dbvgc5q0v6cqrh5jx"))))
472 (build-system gnu-build-system)
473 (arguments
474 `(#:configure-flags
475 (list (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
476 ,name "-" ,version))
477 #:phases
478 (modify-phases %standard-phases
479 (add-after 'unpack 'skip-premature-configuration
480 (lambda _
481 (substitute* "autogen.sh"
482 (("\\./configure") "")))))))
483 (native-inputs
484 (list autoconf automake))
485 (home-page "https://github.com/baruch/gpart")
486 (synopsis "Guess and recover PC-style partition tables")
487 (description
488 "Gpart tries to guess the partitions on a PC-style, MBR-partitioned disk
489after they have been inadvertently deleted or the primary partition table at
490sector 0 damaged. In both cases, the contents of these partitions still exist
491on the disk but the operating system cannot access them.
492
493Gpart ignores the partition table and scans each sector of the device or image
494file for several known file system and partition types. Only partitions which
495have been formatted in some way can be recognized. Several file system guessing
496modules are built in; more can be written and loaded at run time.
497
498The guessed table can be restored manually, for example with @command{fdisk},
499written to a file, or---if you firmly believe it's entirely correct---directly
500to disk.
501
502It should be stressed that gpart does a very heuristic job. It can easily be
503right in its guesswork but it can also be terribly wrong. Never believe its
504output without any plausibility checks.")
505 (license license:gpl2+))))
506
507(define-public gptfdisk
508 (package
509 (name "gptfdisk")
510 (version "1.0.10")
511 (source
512 (origin
513 (method url-fetch)
514 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
515 version "/gptfdisk-" version ".tar.gz"))
516 (sha256
517 (base32 "10m2jgb2m6r0m6snjh0lsxr7ljw0ic5l9h3ki54yrffjqqdxdgia"))))
518 (build-system gnu-build-system)
519 (arguments
520 `(#:test-target "test"
521 #:phases
522 (modify-phases %standard-phases
523 (add-after 'unpack 'fix-include-directory
524 (lambda _
525 (substitute* "gptcurses.cc"
526 (("ncursesw/ncurses.h") "ncurses.h"))))
527 (delete 'configure) ; no configure script
528 (replace 'install
529 ;; There's no ‘make install’ target.
530 (lambda* (#:key outputs #:allow-other-keys)
531 (let* ((out (assoc-ref outputs "out"))
532 (bin (string-append out "/bin"))
533 (man (string-append out "/share/man/man8")))
534 (install-file "gdisk" bin)
535 (install-file "sgdisk" bin)
536 (install-file "cgdisk" bin)
537 (install-file "fixparts" bin)
538 (install-file "cgdisk.8" man)
539 (install-file "fixparts.8" man)
540 (install-file "gdisk.8" man)
541 (install-file "sgdisk.8" man)))))))
542 (native-inputs
543 (list gettext-minimal))
544 (inputs
545 (list ncurses
546 popt
547 `(,util-linux "lib"))) ;libuuid
548 (home-page "https://www.rodsbooks.com/gdisk/")
549 (synopsis "Low-level GPT disk partitioning and formatting")
550 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
551works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
552disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
553scheme.")
554 (license license:gpl2)))
555
556(define-public ddrescue
557 (package
558 (name "ddrescue")
559 (version "1.30")
560 (source
561 (origin
562 (method url-fetch)
563 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
564 version ".tar.lz"))
565 (sha256
566 (base32 "0hjmfj4g5m2w5xqd80mwx64acnc85clli4f1ryhqfv4x60nn4r12"))))
567 (build-system gnu-build-system)
568 (arguments
569 `(#:configure-flags (list (string-append "CXX=" ,(cxx-for-target)))))
570 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
571 (synopsis "Data recovery utility")
572 (native-inputs (list lzip))
573 (description
574 "GNU ddrescue is a fully automated data recovery tool. It copies data
575from one file to another, working to rescue data in case of read errors. The
576program also includes a tool for manipulating its log files, which are used
577to recover data more efficiently by only reading the necessary blocks.")
578 (license license:gpl3+)))
579
580(define-public dosfstools
581 (package
582 (name "dosfstools")
583 (version "4.2")
584 (source
585 (origin
586 (method git-fetch)
587 (uri (git-reference
588 (url "https://github.com/dosfstools/dosfstools")
589 (commit (string-append "v" version))))
590 (file-name (git-file-name name version))
591 (sha256
592 (base32 "1xygsixmmc9l7drxylggnzkqqiks8zmlsbhg3z723ii2ak94236s"))))
593 (build-system gnu-build-system)
594 (arguments
595 `(#:configure-flags (list "--enable-compat-symlinks")
596 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
597 (string-append "CC=" ,(cc-for-target)))))
598 (native-inputs
599 (list autoconf automake
600 ;; For tests.
601 xxd))
602 (home-page "https://github.com/dosfstools/dosfstools")
603 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
604 (description
605 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
606which respectively make and check MS-DOS FAT file systems.")
607 (license license:gpl3+)))
608
609(define dosfstools/static
610 (static-package
611 (package (inherit dosfstools))))
612
613(define-public fatfsck/static
614 (package
615 (name "fatfsck-static")
616 (version (package-version dosfstools))
617 (build-system trivial-build-system)
618 (source #f)
619 (arguments
620 `(#:modules ((guix build utils))
621 #:builder
622 (begin
623 (use-modules (guix build utils))
624 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
625 "/sbin"))
626 (exe "fsck.fat")
627 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
628 (mkdir-p bin)
629 (with-directory-excursion bin
630 (copy-file (string-append src "/" exe) exe)
631 (remove-store-references exe)
632 (chmod exe #o555)
633 ;; Add fsck.vfat symlink to match the Linux driver name.
634 (symlink exe "fsck.vfat")
635 #t)))))
636 (inputs (list dosfstools/static))
637 (home-page (package-home-page dosfstools))
638 (synopsis "Statically linked fsck.fat from dosfstools")
639 (description "This package provides a statically-linked @command{fsck.fat}
640and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
641 (license (package-license dosfstools))))
642
643(define-public fatresize
644 (package
645 (name "fatresize")
646 (version "1.1.0")
647 (source (origin
648 (method git-fetch)
649 (uri (git-reference
650 (url "https://github.com/ya-mouse/fatresize")
651 (commit (string-append "v" version))))
652 (file-name (git-file-name name version))
653 (sha256
654 (base32
655 "1vhz84kxfyl0q7mkqn68nvzzly0a4xgzv76m6db0bk7xyczv1qr2"))))
656 (build-system gnu-build-system)
657 (native-inputs
658 (list pkg-config))
659 (inputs
660 (list parted))
661 (home-page "https://github.com/ya-mouse/fatresize")
662 (synopsis "Resize FAT partitions")
663 (description
664 "This package provides a tool to resize FAT partitions using libparted.")
665 (license license:gpl3+)))
666
667(define-public hdparm
668 (package
669 (name "hdparm")
670 (version "9.65")
671 (source (origin
672 (method url-fetch)
673 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
674 "hdparm-" version ".tar.gz"))
675 (sha256
676 (base32
677 "0jssagggg52ssl9kg99m88afghj7bm1854vyf4p96q6h23wjjjfi"))))
678 (build-system gnu-build-system)
679 (arguments
680 (list #:make-flags
681 #~(list (string-append "binprefix=" #$output)
682 (string-append "manprefix=" #$output)
683 (string-append "CC=" #$(cc-for-target))
684 ;; Let Guix strip binaries and not break cross-compilation.
685 "STRIP=true")
686 #:phases
687 #~(modify-phases %standard-phases
688 (delete 'configure)) ; no configure script
689 #:tests? #f)) ; no test suite
690 (home-page "https://sourceforge.net/projects/hdparm/")
691 (synopsis "View and tune ATA disk drive parameters")
692 (description
693 "@command{hdparm} is a command-line utility to control ATA controllers and
694disk drives. It can increase performance and/or reliability by careful tuning
695of hardware settings like power and acoustic management, DMA modes, and caching.
696It can also display detailed device information, or be used as a simple
697performance benchmarking tool.
698
699@command{hdparm} provides a command line interface to various Linux kernel
700interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
701IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
702Translation (@dfn{SAT}) are also supported.")
703 (license (license:non-copyleft "file://LICENSE.TXT"))))
704
705(define-public sdparm
706 (package
707 (name "sdparm")
708 (version "1.12")
709 (source
710 (origin
711 (method url-fetch)
712 (uri (string-append "http://sg.danny.cz/sg/p/"
713 "sdparm-" version ".tar.xz"))
714 (sha256
715 (base32 "1gmdxr36allrgap2j4dv238d8awkj327ww0jjwpjwrpbvfpyzjf4"))))
716 (build-system gnu-build-system)
717 (home-page "https://sg.danny.cz/sg/sdparm.html")
718 (synopsis "Provide access to SCSI device parameters")
719 (description
720 "Sdparm reads and modifies SCSI device parameters. These devices can be
721SCSI disks, in which case the role of @command{sdparm} is similar to its
722namesake: the @command{hdparm} utility originally designed for ATA disks.
723However, @command{sdparm} can be used to access parameters on any device that
724uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
725transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
726also send commands associated with starting and stopping the media, loading
727and unloading removable media and some other housekeeping functions.")
728 (license license:bsd-3)))
729
730(define-public open-isns
731 (package
732 (name "open-isns")
733 (version "0.103")
734 (source
735 (origin
736 (method git-fetch)
737 (uri (git-reference
738 (url "https://github.com/open-iscsi/open-isns")
739 (commit (string-append "v" version))))
740 (file-name (git-file-name name version))
741 (modules '((guix build utils)))
742 (sha256
743 (base32 "0008f4sv0z3mmqgf5ifx6rp7nwpp41qd3shhi3b2ci1ir8r91skf"))))
744 (build-system meson-build-system)
745 (arguments
746 (list
747 ;; TODO: Figure out how to run tests, "build" directory contains 0 files
748 ;; from "source/tests", attempt to run them from that directorie failed
749 ;; with error: no pid file: /tmp/isns-test/Test01/server0/pid
750 #:tests? #f
751 #:configure-flags
752 #~(list "-Dslp=disabled"
753 (string-append "-Dsystemddir=" #$output "/lib/systemd")
754 "--sharedstatedir=/var")
755 #:phases
756 #~(modify-phases %standard-phases
757 (add-after 'unpack 'fix-meson.build
758 (lambda _
759 (substitute* "meson.build"
760 (("/usr/lib64")
761 (string-append #$output "/lib"))
762 (("/var/lib")
763 (string-append #$output "/lib"))))))))
764 (native-inputs
765 (list meson
766 ninja
767 pkg-config))
768 (inputs
769 (list openssl))
770 (home-page "https://github.com/open-iscsi/open-isns")
771 (synopsis "Linux server and client for iSNS")
772 (description
773 "This package provides a partial implementation of @acronym{iSNS,
774 Internet Storage Name Service}, specified by
775@url{https://www.rfc-editor.org/rfc/rfc3720.html, RFC4171}. It's an
776maintained fork of https://github.com/cleech/open-isns.")
777 (license license:gpl2)))
778
779(define-public open-iscsi
780 (package
781 (name "open-iscsi")
782 (version "2.1.11")
783 (source
784 (origin
785 (method git-fetch)
786 (uri (git-reference
787 (url "https://github.com/open-iscsi/open-iscsi")
788 (commit version)))
789 (file-name (git-file-name name version))
790 (sha256
791 (base32 "0bafxz3vwk0wfa5r3cl3h9sngdfkll10i8467q8d0im4sj489kay"))))
792 (build-system meson-build-system)
793 (arguments
794 (list
795 ;; XXX: 2nd of 4th test fails with iSCSI ERROR: Could not open
796 ;; /run/lock/iscsi: 2: No such file or directory
797 ;; ../source/libopeniscsiusr/idbm.c:_idbm_lock():327
798 #:tests? #f
799 #:configure-flags
800 #~(list "-Dno_systemd=true"
801 (string-append "-Discsi_sbindir="
802 #$output "/sbin")
803 (string-append "--sbindir="
804 #$output "/sbin"))
805 #:phases
806 #~(modify-phases %standard-phases
807 (add-after 'unpack 'dont-install-to-/var
808 (lambda _
809 (substitute* "meson.build"
810 (("install_data\\(iscsi_etc_iface_file_src, install_dir: db_root \\/ 'ifaces'\\)")
811 "")))))))
812 (native-inputs
813 (list meson
814 ninja
815 perl
816 pkg-config))
817 (inputs
818 (list kmod
819 open-isns
820 openssl
821 (list util-linux "lib")))
822 (home-page "https://github.com/open-iscsi/open-iscsi")
823 (synopsis "Linux iSCSI tools")
824 (description
825 "The Open @acronym{iSCSI, Internet Small Computer Systems Interface}
826project is a high-performance, transport independent, multi-platform
827implementation of @url{https://www.rfc-editor.org/rfc/rfc3720.html, RFC3720}
828iSCSI.
829
830Features:
831@itemize
832@item highly optimized and very small-footprint data path
833@item persistent configuration database
834@item SendTargets discovery
835@item provides @acronym{CHAP, Challenge Handshake Authentication Protocol}
836support
837@item @acronym{PDU, Protocol Data Unit} header Digest
838@item multiple sessions
839@end itemize")
840 ;; The daemon and other top-level commands are licensed as GPLv3, while
841 ;; the libopeniscsiusr library used by some of those commmands is licensed
842 ;; as LGPLv3.
843 (license (list license:gpl2+ ;attached license
844 license:gpl3 ;mentioned in README
845 license:lgpl3)))) ;mentioned in README
846
847(define-public idle3-tools
848 (package
849 (name "idle3-tools")
850 (version "0.9.1")
851 (source
852 (origin
853 (method url-fetch)
854 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
855 version ".tgz"))
856 (sha256
857 (base32
858 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
859 (build-system gnu-build-system)
860 (arguments
861 `(#:tests? #f ;no test suite
862 #:phases
863 (modify-phases %standard-phases
864 (delete 'configure))
865 #:make-flags (list "CC=gcc"
866 (string-append "manprefix=")
867 (string-append "DESTDIR="
868 (assoc-ref %outputs "out")))))
869 (home-page "https://idle3-tools.sourceforge.net")
870 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
871 (description
872 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
873present in many Western Digital hard drives. This timer is part of the
874\"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
875the default timer setting is not well suited to Linux or other *nix systems,
876and can dramatically shorten the lifespan of the drive if left unchecked.")
877 (license license:gpl3+)))
878
879(define-public greaseweazle-host-tools
880 (package
881 (name "greaseweazle-host-tools")
882 (version "1.22")
883 (source (origin
884 (method git-fetch)
885 (uri (git-reference
886 (url "https://github.com/keirf/greaseweazle")
887 (commit (string-append "v" version))))
888 (file-name (git-file-name name version))
889 (sha256
890 (base32
891 "1ji5sq9jf0p44982zkb5dj2d3mrpy675k0mkyg3r17q5syz0wbia"))))
892 (build-system pyproject-build-system)
893 (arguments
894 (list
895 #:tests? #f ;XXX: root access is required, see: <scripts/tests/test.sh>
896 #:phases
897 #~(modify-phases %standard-phases
898 (add-after 'install 'install-udev-rules
899 (lambda _
900 (install-file "scripts/49-greaseweazle.rules"
901 (string-append #$output "/lib/udev/rules.d/")))))))
902 (native-inputs
903 (list python-setuptools
904 python-setuptools-scm))
905 (propagated-inputs
906 (list python-bitarray python-crcmod python-pyserial python-requests))
907 (synopsis "Tools for accessing a floppy drive at the raw flux level")
908 (description
909 "This package provides the host tools for controlling a Greaseweazle: an
910Open Source USB device capable of reading and writing raw data on nearly any
911type of floppy disk")
912 (home-page "https://github.com/keirf/greaseweazle")
913 (license license:public-domain)))
914
915(define-public gparted
916 (package
917 (name "gparted")
918 (version "1.6.0")
919 (source
920 (origin
921 (method url-fetch)
922 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
923 version "/gparted-" version ".tar.gz"))
924 (sha256
925 (base32 "0nzaqvbdwq3daddby79k9rh3d560g5kaxqamkasxqka9rsrm37wv"))))
926 (build-system glib-or-gtk-build-system)
927 (arguments
928 ;; Tests require access to files outside the build container, such
929 ;; as ‘/dev/disk/by-id/’.
930 `(#:tests? #f))
931 (inputs
932 (list `(,util-linux "lib") parted glib gtkmm-3 lvm2 libxml2))
933 (native-inputs
934 (list intltool
935 itstool
936 yelp-tools
937 pkg-config))
938 (home-page "https://gparted.org/")
939 (synopsis "Partition editor to graphically manage disk partitions")
940 (description "GParted is a GNOME partition editor for creating,
941reorganizing, and deleting disk partitions. It uses libparted from the parted
942project to detect and manipulate partition tables. Optional file system tools
943permit managing file systems not included in libparted.")
944 ;; The home page says GPLv2, but the source code says GPLv2+.
945 (license license:gpl2+)))
946
947(define-public testdisk
948 (package
949 (name "testdisk")
950 (version "7.2")
951 (source (origin
952 (method url-fetch)
953 (uri (string-append "https://www.cgsecurity.org/testdisk-"
954 version ".tar.bz2"))
955 (sha256
956 (base32
957 "0gr87j0ynbwzb958j443dnp013rr33cvrqx2j5fiq05l1ki3nd7q"))))
958 (build-system gnu-build-system)
959 (inputs
960 (list ntfs-3g
961 `(,util-linux "lib")
962 openssl
963 ;; FIXME: add reiserfs.
964 zlib
965 e2fsprogs
966 libjpeg-turbo
967 ncurses))
968 (home-page "https://www.cgsecurity.org/wiki/TestDisk")
969 (synopsis "Data recovery tool")
970 (description "TestDisk is primarily designed to help recover lost
971partitions and/or make non-booting disks bootable again when these symptoms
972were caused by faulty software or human error (such as accidentally deleting a
973partition table). TestDisk can:
974@enumerate
975@item Fix partition table, recover deleted partition
976@item Recover FAT32 boot sector from its backup
977@item Rebuild FAT12/FAT16/FAT32 boot sector
978@item Fix FAT tables
979@item Rebuild NTFS boot sector
980@item Recover NTFS boot sector from its backup
981@item Fix MFT using MFT mirror
982@item Locate ext2/ext3/ext4 Backup SuperBlock
983@item Un-delete files from FAT, exFAT, NTFS and ext2 file systems
984@item Copy files from deleted FAT, exFAT, NTFS and ext2/ext3/ext4 partitions.
985@end enumerate
986This package also includes the @command{photorec} command, described below.
987
988PhotoRec is file data recovery software designed to recover lost files
989including video, documents and archives from hard disks, CD-ROMs, and lost
990pictures (thus the Photo Recovery name) from digital camera memory. PhotoRec
991ignores the file system and goes after the underlying data, so it will still
992work even if your media's file system has been severely damaged or
993reformatted. It can recover lost files from at least:
994@enumerate
995@item FAT
996@item NTFS
997@item exFAT
998@item ext2/ext3/ext4 file system
999@item HFS+
1000@end enumerate")
1001 (license license:gpl2+)))
1002
1003(define-public pydf
1004 (let ((commit "af38bb3b7aacbcc32271e6dafa8b8b0a77ffead8")
1005 (revision "0"))
1006 (package
1007 (name "pydf")
1008 (version (git-version "15" revision commit))
1009 (source
1010 (origin
1011 (method git-fetch)
1012 (uri (git-reference
1013 (url "https://github.com/garabik/pydf")
1014 (commit commit)))
1015 (file-name (git-file-name name version))
1016 (sha256
1017 (base32 "18ljigg8zm9pc3qg3alpyh3n4a4f1wcza4p36cchjn2vd4466jf4"))))
1018 (build-system pyproject-build-system)
1019 (arguments (list #:tests? #f)) ; No tests.
1020 (native-inputs (list python-setuptools))
1021 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
1022 (synopsis "Colourised @command{df} clone")
1023 (description
1024 "All-singing, all-dancing, fully colourised @command{df} clone written
1025in Python. It displays the amount of disk space available on the mounted file
1026systems, using different colours for different types of file systems. Output
1027format is completely customizable.")
1028 (license license:public-domain))))
1029
1030(define-public f3
1031 (package
1032 (name "f3")
1033 (version "9.0")
1034 (source
1035 (origin
1036 (method git-fetch)
1037 (uri (git-reference
1038 (url "https://github.com/AltraMayor/f3")
1039 (commit (string-append "v" version))))
1040 (file-name (git-file-name name version))
1041 (sha256
1042 (base32 "0k9299phdxp0yag0mm58sfrbqmb19zvia57wgcaqawf9clafba35"))))
1043 (build-system gnu-build-system)
1044 (arguments
1045 (list #:tests? #f ; no check target
1046 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1047 (string-append "PREFIX=" #$output))
1048 #:phases
1049 #~(modify-phases %standard-phases
1050 (delete 'configure) ; no configure script
1051 (add-after 'build 'build-extra
1052 (lambda* (#:key make-flags #:allow-other-keys)
1053 (apply invoke "make" "extra" make-flags)))
1054 (add-after 'build 'install-extra
1055 (lambda* (#:key make-flags #:allow-other-keys)
1056 (apply invoke "make" "install-extra" make-flags))))))
1057 (inputs
1058 (list eudev parted))
1059 (home-page "http://oss.digirati.com.br/f3/")
1060 (synopsis "Test real capacity of flash memory cards and such")
1061 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
1062capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
1063the card and then checks if can read it. It will assure you haven't been sold
1064a card with a smaller capacity than stated.")
1065 (license license:gpl3+)))
1066
1067(define-public python-pyparted
1068 (package
1069 (name "python-pyparted")
1070 (version "3.13.0")
1071 (source
1072 (origin
1073 (method git-fetch)
1074 (uri (git-reference
1075 (url "https://github.com/dcantrell/pyparted")
1076 (commit (string-append "v" version))))
1077 (file-name (git-file-name name version))
1078 (sha256
1079 (base32 "09gjp60sr8l0v41anmdfnh9lizfz1mbb7mxvqq73s30vn4504982"))))
1080 (build-system pyproject-build-system)
1081 (native-inputs
1082 (list e2fsprogs
1083 pkg-config
1084 python-pytest
1085 python-setuptools
1086 python-wheel))
1087 (inputs
1088 (list parted))
1089 (home-page "https://github.com/dcantrell/pyparted")
1090 (synopsis "Parted bindings for Python")
1091 (description "This package provides @code{parted} bindings for Python.")
1092 (license license:gpl2+)))
1093
1094(define-public duperemove
1095 (package
1096 (name "duperemove")
1097 (version "0.15.2")
1098 (source
1099 (origin
1100 (method git-fetch)
1101 (uri (git-reference
1102 (url "https://github.com/markfasheh/duperemove")
1103 (commit (string-append "v" version))))
1104 (sha256
1105 (base32 "0dsjw7nqflxapsb1fkxbqncqzq6aa8dxklc5igcvfv5mmsmchwb3"))
1106 (file-name (git-file-name name version))))
1107 (build-system gnu-build-system)
1108 (native-inputs (list xxhash libbsd pkg-config))
1109 (inputs (list glib sqlite))
1110 (arguments
1111 `(#:tests? #f ;no test suite
1112 #:phases (modify-phases %standard-phases
1113 (delete 'configure)) ;no configure script
1114 #:make-flags (list (string-append "PREFIX=" %output)
1115 (string-append "CC="
1116 ,(cc-for-target))
1117 ;; Set to <next release>dev by default.
1118 (string-append "VER="
1119 ,version))))
1120 (home-page "https://github.com/markfasheh/duperemove")
1121 (synopsis "Tools for de-duplicating file system data")
1122 (description
1123 "Duperemove is a simple tool for finding duplicated extents
1124and submitting them for deduplication. When given a list of files it will
1125hash their contents on a block by block basis and compare those hashes to each
1126other, finding and categorizing blocks that match each other. When given the
1127@option{-d} option, duperemove will submit those extents for deduplication
1128using the Linux kernel extent-same @code{ioctl}.
1129
1130Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
1131existing hash file, duperemove will only compute hashes for those files which
1132have changed since the last run. Thus you can run duperemove repeatedly on
1133your data as it changes, without having to re-checksum unchanged data.
1134
1135Duperemove can also take input from the @command{fdupes} program.")
1136 (license license:gpl2)))
1137
1138(define-public ranger
1139 (package
1140 (name "ranger")
1141 (version "1.9.4")
1142 (source
1143 (origin
1144 (method url-fetch)
1145 (uri (string-append "https://ranger.fm/ranger-" version ".tar.gz"))
1146 (sha256
1147 (base32 "128ggxfhfmckl7x89flwxks7gxq0m02insdizcsp62193c6mxmvs"))))
1148 (build-system pyproject-build-system)
1149 (arguments
1150 (list
1151 #:phases
1152 #~(modify-phases %standard-phases
1153 (add-after 'unpack 'set-paths
1154 (lambda _
1155 (substitute* (find-files "ranger" "\\.py$")
1156 (("\"file\"")
1157 (simple-format #f "~s"
1158 #$(file-append (this-package-input "file")
1159 "/bin/file"))))))
1160 (add-after 'install 'wrap-program
1161 ;; Tell 'ranger' where 'w3mimgdisplay' is.
1162 (lambda _
1163 (let* ((ranger (string-append #$output "/bin/ranger"))
1164 (w3m #$(this-package-input "w3m"))
1165 (w3mimgdisplay (string-append w3m
1166 "/libexec/w3m/w3mimgdisplay")))
1167 (wrap-program ranger
1168 `("W3MIMGDISPLAY_PATH" ":" prefix
1169 (,w3mimgdisplay)))))))))
1170 (native-inputs (list python-pytest python-setuptools python-wheel))
1171 (inputs (list bash-minimal file w3m))
1172 (home-page "https://ranger.fm")
1173 (synopsis "Console file manager")
1174 (description
1175 "ranger is a console file manager with Vi key bindings. It provides a
1176minimalistic and nice curses interface with a view on the directory hierarchy.
1177It ships with @code{rifle}, a file launcher that is good at automatically
1178finding out which program to use for what file type.")
1179 (license license:gpl3)))
1180
1181(define-public fff
1182 (package
1183 (name "fff")
1184 (version "2.2")
1185 (source (origin
1186 (method git-fetch)
1187 (uri (git-reference
1188 (url "https://github.com/dylanaraps/fff")
1189 (commit version)))
1190 (file-name (git-file-name name version))
1191 (sha256
1192 (base32
1193 "14ymdw6l6phnil0xf1frd5kgznaiwppcic0v4hb61s1zpf4wrshg"))))
1194 (build-system gnu-build-system)
1195 (inputs
1196 (list bash
1197 file))
1198 (arguments
1199 (list
1200 #:tests? #f ; no tests
1201 #:make-flags
1202 #~(list
1203 (string-append "PREFIX=" #$output))
1204 #:phases
1205 #~(modify-phases %standard-phases
1206 (add-after 'unpack 'refer-to-inputs
1207 (lambda* (#:key inputs #:allow-other-keys)
1208 (let ((file (assoc-ref inputs "file")))
1209 (substitute* "fff"
1210 (("\\bfile [-\"]" match)
1211 (string-append file "/bin/" match))))))
1212 (delete 'configure)))) ; no configure script
1213 (home-page "https://github.com/dylanaraps/fff")
1214 (synopsis "Simple file manager written in bash")
1215 (description
1216 "@command{fff} (fast file-manager) is a simple, blazing fast and minimal
1217file manager for Linux, written in bash. It only requires bash and coreutils,
1218and its highly optimized now for efficient performance.")
1219 (license license:expat)))
1220
1221(define-public volume-key
1222 (package
1223 (name "volume-key")
1224 (version "0.3.12")
1225 (source
1226 (origin
1227 (method git-fetch)
1228 (uri (git-reference
1229 (url "https://pagure.io/volume_key")
1230 (commit (string-append "volume_key-" version))))
1231 (file-name (git-file-name name version))
1232 (sha256
1233 (base32 "0zadzbh26ckk263w02d02r2x3mry2kxbybkhwwaxwpv6jsrm7xr6"))))
1234 (build-system gnu-build-system)
1235 (native-inputs
1236 (list autoconf
1237 automake
1238 gettext-minimal
1239 libtool
1240 pkg-config
1241 python ; used to generate the Python bindings
1242 python-setuptools
1243 swig))
1244 (inputs
1245 (append
1246 (cons cryptsetup-minimal (libcryptsetup-propagated-inputs))
1247 (cons lvm2 (libdevmapper-propagated-inputs))
1248 (list nss
1249 (list util-linux "lib")
1250 glib
1251 gpgme)))
1252 (arguments
1253 (list
1254 #:tests? #f ; not sure how tests are supposed to pass, even when run manually
1255 #:configure-flags
1256 #~(list "--without-python"
1257 (string-append "--with-gpgme-prefix="
1258 #$(this-package-input "gpgme")))
1259 #:phases
1260 #~(modify-phases %standard-phases
1261 (add-before 'configure 'set-python-paths
1262 (lambda* (#:key inputs #:allow-other-keys)
1263 (let ((python #$(this-package-native-input "python")))
1264 (setenv "PYTHON3"
1265 (string-append python "/bin/python3"))
1266 (setenv "PYTHON3_CONFIG"
1267 (string-append python "/bin/python3-config"))))))))
1268 (home-page "https://pagure.io/volume_key")
1269 (synopsis "Manipulate storage volume encryption keys")
1270 (description
1271 "This package provides a library for manipulating storage volume
1272encryption keys and storing them separately from volumes to handle forgotten
1273passphrases.")
1274 (license license:gpl2)))
1275
1276(define-public ndctl
1277 (package
1278 (name "ndctl")
1279 (version "84")
1280 (source (origin
1281 (method git-fetch)
1282 (uri (git-reference
1283 (url "https://github.com/pmem/ndctl")
1284 (commit (string-append "v" version))))
1285 (file-name (git-file-name name version))
1286 (sha256
1287 (base32
1288 "0jal7w4mk5l5j0qfays27kya8n1h2qwkncl0s317rfxp56bkjp6y"))))
1289 (build-system meson-build-system)
1290 (arguments
1291 ;; The test suite runs but SKIPs all tests: do not consider this tested!
1292 (list #:configure-flags
1293 #~(list (string-append "-Drootprefix=" #$output)
1294 (string-append "-Dlibdir=" #$output "/lib")
1295 (string-append "-Dbashcompletiondir=" #$output
1296 "/share/bash-completion/completions")
1297 (string-append "-Dsysconfdir=" #$output "/etc")
1298 (string-append "-Diniparserdir="
1299 #$(this-package-input "iniparser")
1300 "/include")
1301 "-Dasciidoctor=disabled" ; use docbook-xsl instead
1302 "-Dsystemd=disabled")
1303 #:phases
1304 #~(modify-phases %standard-phases
1305 (add-after 'unpack 'fix-version
1306 ;; Our VERSION's always better than the build's poor guess.
1307 (lambda _
1308 (with-output-to-file "version"
1309 (lambda _ (display #$version)))))
1310 (add-after 'unpack 'patch-FHS-file-names
1311 (lambda _
1312 (substitute* "git-version-gen"
1313 (("/bin/sh") (which "sh")))
1314 (substitute* "git-version"
1315 (("/bin/bash") (which "bash"))))))))
1316 (native-inputs
1317 (list asciidoc
1318 bash-completion
1319 docbook-xsl
1320 libxml2
1321 pkg-config
1322 xmlto
1323 ;; Required for offline docbook generation.
1324 which))
1325 (inputs
1326 (list eudev
1327 iniparser
1328 json-c
1329 keyutils
1330 kmod
1331 libtraceevent
1332 libtracefs
1333 `(,util-linux "lib")))
1334 (home-page "https://github.com/pmem/ndctl")
1335 (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
1336 (description
1337 "This package provides a utility library for managing the
1338libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
1339 ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
1340 ;; the effective license. Note that some files under ccan/ are
1341 ;; covered by BSD-3 or public domain, see the individual directories.
1342 (license license:gpl2)))
1343
1344(define-public dmraid
1345 (package
1346 (name "dmraid")
1347 (version "1.0.0.rc16-3")
1348 (source (origin
1349 (method url-fetch)
1350 (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
1351 version ".tar.bz2"))
1352 (sha256
1353 (base32
1354 "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
1355 (build-system gnu-build-system)
1356 (inputs (list lvm2))
1357 (native-inputs (list which))
1358 (arguments
1359 `(#:tests? #f ; No tests.
1360 ;; Prevent a race condition where some target would attempt to link
1361 ;; libdmraid.so before it had been built as reported in
1362 ;; <https://bugs.gnu.org/31999#187>.
1363 #:parallel-build? #f
1364 #:phases (modify-phases %standard-phases
1365 (add-before 'configure 'change-directory
1366 (lambda _
1367 (chdir (string-append ,version "/dmraid"))
1368 (substitute* "make.tmpl.in"
1369 (("/bin/sh") (which "sh")))
1370 #t)))
1371 #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
1372 ;; find libdmraid.so.
1373 (string-append "LDFLAGS=-Wl,-rpath="
1374 (assoc-ref %outputs "out")
1375 "/lib"))))
1376 (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
1377 (synopsis "Device mapper RAID interface")
1378 (description
1379 "This software supports RAID device discovery, RAID set activation, creation,
1380removal, rebuild and display of properties for ATARAID/DDF1 metadata.
1381
1382@command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
1383to create devices with respective mappings for the ATARAID sets discovered.")
1384 (license license:gpl2+)))
1385
1386(define-public libblockdev
1387 (package
1388 (name "libblockdev")
1389 (version "3.3.0")
1390 (source (origin
1391 (method url-fetch)
1392 (uri (string-append "https://github.com/storaged-project/"
1393 "libblockdev/releases/download/"
1394 version "/libblockdev-" version ".tar.gz"))
1395 (sha256
1396 (base32
1397 "19yzidh8i32327h8h7b9yx86yv1hm7kz1y91cn4gxzyypqd8wwy4"))))
1398 (build-system gnu-build-system)
1399 (arguments
1400 (list
1401 #:modules (cons '(ice-9 format) %default-gnu-modules)
1402 #:phases
1403 #~(modify-phases %standard-phases
1404 (add-after 'unpack 'patch-configuration-directory
1405 (lambda _
1406 (substitute* "src/lib/blockdev.c"
1407 (("/etc/libblockdev/conf.d/" path)
1408 (string-append #$output path)))))
1409 (add-after 'unpack 'patch-paths
1410 (lambda* (#:key inputs #:allow-other-keys)
1411 (define* (find-program program #:key fail-if-missing?)
1412 (or (and (string=? "vfat-resize" program)
1413 (string-append #$output "/bin/vfat-resize"))
1414 (false-if-exception
1415 (search-input-file inputs
1416 (string-append "bin/" program)))
1417 (false-if-exception
1418 (search-input-file inputs
1419 (string-append "sbin/" program)))
1420 (if fail-if-missing?
1421 (error "could not find" program)
1422 (begin
1423 (format (current-warning-port)
1424 "warning: program ~s left unpatched~%"
1425 program)
1426 program))))
1427 (substitute* (find-files "src/plugins" "\\.c$")
1428 (("(gchar \\*arg.+\\{\")([^\"]+)" all start program)
1429 (string-append
1430 start (find-program program))))
1431 (substitute* "src/plugins/fs/generic.c"
1432 (("_util = \"([^\"]*)\"" all program)
1433 (format #f "_util = ~s" (find-program program))))
1434 ;; Tip: look for check_deps calls in the source to find where
1435 ;; commands are looked up from PATH.
1436 (let-syntax
1437 ((patch-helpers
1438 (lambda (x)
1439 (syntax-case x ()
1440 ((_ file (helpers ...))
1441 (with-syntax ((pattern (datum->syntax x 'pattern)))
1442 #'(let ((pattern (format #f "\"(~{~a~^|~})\""
1443 '(helpers ...))))
1444 (substitute* file
1445 ((pattern dummy program)
1446 (format
1447 #f "~s"
1448 (find-program
1449 program #:fail-if-missing? #t)))))))))))
1450
1451 (patch-helpers "src/plugins/fs/btrfs.c"
1452 ("mkfs.btrfs" "btrfsck" "btrfs" "btrfstune"))
1453 (patch-helpers "src/plugins/fs/exfat.c"
1454 ("mkfs.exfat" "fsck.exfat" "tune.exfat"))
1455 (patch-helpers "src/plugins/fs/ext.c"
1456 ("mke2fs" "e2fsck" "tune2fs" "resize2fs"))
1457 (patch-helpers "src/plugins/fs/f2fs.c"
1458 ("mkfs.f2fs" "fsck.f2fs" "dump.f2fs"
1459 "resize.f2fs"))
1460 (patch-helpers "src/plugins/fs/nilfs.c"
1461 ("mkfs.nilfs2" "nilfs-tune" "nilfs-resize"))
1462 (patch-helpers "src/plugins/fs/ntfs.c"
1463 ("mkntfs" "ntfsfix" "ntfsresize" "ntfslabel"
1464 "ntfsinfo"))
1465 (patch-helpers "src/plugins/fs/udf.c"
1466 ("mkudffs" "udflabel" "udfinfo"))
1467 (patch-helpers "src/plugins/fs/vfat.c"
1468 ("mkfs.vfat" "fat label" "fsck.vfat"
1469 "vfat-resize" "fatlabel"))
1470 (patch-helpers "src/plugins/fs/xfs.c"
1471 ("mkfs.xfs" "xfs_db" "xfs_repair" "xfs_admin"
1472 "xfs_growfs"))
1473 (patch-helpers "src/plugins/swap.c"
1474 ("mkswap" "swaplabel"))))))))
1475 (native-inputs
1476 (list gobject-introspection
1477 pkg-config
1478 python-wrapper))
1479 (inputs
1480 (append
1481 (cons cryptsetup-minimal (libcryptsetup-propagated-inputs))
1482 (if (supported-package? multipath-tools)
1483 (list multipath-tools)
1484 '())
1485 (list bcache-tools
1486 btrfs-progs
1487 dosfstools
1488 dmraid
1489 e2fsprogs
1490 eudev
1491 exfatprogs
1492 f2fs-tools
1493 glib
1494 gptfdisk
1495 json-glib-minimal
1496 keyutils
1497 kmod
1498 libatasmart
1499 libbytesize
1500 libnvme
1501 libyaml
1502 lvm2
1503 mdadm
1504 ndctl
1505 nilfs-utils
1506 nss
1507 ntfs-3g
1508 parted
1509 udftools
1510 util-linux
1511 volume-key
1512 xfsprogs)))
1513 (home-page "https://github.com/storaged-project/libblockdev")
1514 (synopsis "Library for manipulating block devices")
1515 (description
1516 "libblockdev is a C library supporting GObject introspection for
1517manipulation of block devices. It has a plugin-based architecture where each
1518technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
1519plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
1520LVM D-Bus API).")
1521 (license license:lgpl2.1+)))
1522
1523(define-public rmlint
1524 (package
1525 (name "rmlint")
1526 (version "2.10.3")
1527 (source (origin
1528 (method git-fetch)
1529 (uri (git-reference
1530 (url "https://github.com/sahib/rmlint")
1531 (commit (string-append "v" version))))
1532 (file-name (git-file-name name version))
1533 (sha256
1534 (base32
1535 "1033h99z443wqb66rrh34gmnlnlbjsm5j1sqpg069jdih2ffi6a3"))))
1536 (build-system scons-build-system)
1537 (arguments
1538 (list
1539 #:scons-flags
1540 #~(list (string-append "--prefix=" #$output)
1541 (string-append "--actual-prefix=" #$output))
1542 #:tests? #f ; no tests
1543 #:phases
1544 #~(modify-phases %standard-phases
1545 (add-after 'unpack 'scons-propagate-environment
1546 (lambda* (#:key inputs #:allow-other-keys)
1547 ;; TODO: `rmlint --gui` fails with
1548 ;; "Failed to load shredder: No module named 'shredder'".
1549 ;; The GUI might also need extra dependencies, such as
1550 ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
1551 (substitute* "lib/cmdline.c"
1552 (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
1553 (string-append "const char *commands[] = {\""
1554 (search-input-file inputs "/bin/python")
1555 "\", \"python\", NULL};")))
1556 ;; By design, SCons does not, by default, propagate
1557 ;; environment variables to subprocesses. See:
1558 ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
1559 ;; Here, we modify the SConstruct file to arrange for
1560 ;; environment variables to be propagated.
1561 (substitute* "SConstruct"
1562 (("^env = Environment\\(.*\\)" all)
1563 (string-append all "\nenv['ENV']=os.environ"))))))))
1564 (native-inputs
1565 (list `(,glib "bin") pkg-config python-sphinx))
1566 (inputs
1567 (list elfutils
1568 glib
1569 json-glib
1570 python-wrapper
1571 `(,util-linux "lib")))
1572 (home-page "https://rmlint.rtfd.org")
1573 (synopsis "Remove duplicates and other lint from the file system")
1574 (description "@command{rmlint} finds space waste and other broken things
1575on your file system and offers to remove it. @command{rmlint} can find:
1576
1577@itemize
1578@item duplicate files and duplicate directories,
1579@item non-stripped binaries (i.e. binaries with debug symbols),
1580@item broken symbolic links,
1581@item empty files and directories,
1582@item files with broken user and/or group ID.
1583@end itemize\n")
1584 (license license:gpl3+)))
1585
1586(define-public lf
1587 (package
1588 (name "lf")
1589 (version "41")
1590 (source
1591 (origin
1592 (method git-fetch)
1593 (uri (git-reference
1594 (url "https://github.com/gokcehan/lf")
1595 (commit (string-append "r" version))))
1596 (file-name (git-file-name name version))
1597 (sha256
1598 (base32 "1rrc720ziaf84wz98y414kfjyh80mqb6wsb3x658g9cjhff7vmxk"))))
1599 (build-system go-build-system)
1600 (arguments
1601 (list
1602 #:install-source? #f
1603 #:import-path "github.com/gokcehan/lf"
1604 #:phases
1605 #~(modify-phases %standard-phases
1606 (add-after 'install 'install-man-page
1607 (lambda* (#:key import-path #:allow-other-keys)
1608 (install-file
1609 (string-append "src/" import-path "/lf.1")
1610 (string-append #$output "/share/man/man1"))))
1611 (add-after 'install 'install-desktop-entry
1612 (lambda* (#:key import-path #:allow-other-keys)
1613 (install-file
1614 (string-append "src/" import-path "/lf.desktop")
1615 (string-append #$output "/share/applications")))))))
1616 (native-inputs
1617 (list go-github-com-djherbis-times
1618 go-github-com-fsnotify-fsnotify
1619 go-github-com-gdamore-tcell-v2
1620 go-github-com-mattn-go-runewidth
1621 go-golang-org-x-sys
1622 go-golang-org-x-term))
1623 (home-page "https://github.com/gokcehan/lf")
1624 (synopsis "Console file browser similar to Ranger")
1625 (description
1626 "@code{lf} (as in \"list files\") is a terminal file manager written in
1627Go. It is heavily inspired by @code{ranger} with some missing and extra
1628features. Some of the missing features are deliberately omitted since they
1629are better handled by external tools.")
1630 (license license:expat)))
1631
1632(define-public xfe
1633 (package
1634 (name "xfe")
1635 (version "1.44")
1636 (source
1637 (origin
1638 (method url-fetch)
1639 (uri
1640 (string-append "mirror://sourceforge/xfe/xfe/" version "/"
1641 "xfe-" version ".tar.xz"))
1642 (sha256
1643 (base32 "1dihq03jqjllb69r78d9ihjjadi39v7sgzdf68qpxz5xhp8i8k2r"))))
1644 (build-system gnu-build-system)
1645 (arguments
1646 `(#:phases
1647 (modify-phases %standard-phases
1648 (add-after 'unpack 'patch-potfiles
1649 (lambda _
1650 ;; To add missing entry 'intl/plural.c' to potfiles list.
1651 ;; Refer to https://sourceforge.net/p/xfe/bugs/257/
1652 (substitute* "po/POTFILES.in"
1653 (("src/help.h")
1654 (string-append "src/help.h\n"
1655 "intl/plural.c")))))
1656 (add-after 'unpack 'patch-bin-dirs
1657 (lambda* (#:key inputs #:allow-other-keys)
1658 (let* ((bash (assoc-ref inputs "bash"))
1659 (coreutils (assoc-ref inputs "coreutils"))
1660 (findutils (assoc-ref inputs "findutils"))
1661 (file-prog (assoc-ref inputs "file")))
1662 (with-directory-excursion "src"
1663 (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp"
1664 "startupnotification.cpp" "xfeutils.cpp"
1665 "../st/config.h")
1666 (("/bin/sh" file) (string-append bash file))
1667 (("/bin/ls" file) (string-append coreutils file))
1668 (("/usr(/bin/du)" _ file) (string-append coreutils file))
1669 (("/usr(/bin/sort)" _ file) (string-append coreutils file))
1670 (("/usr(/bin/cut)" _ file) (string-append coreutils file))
1671 (("/usr(/bin/xargs)" _ file) (string-append findutils file))
1672 (("/usr(/bin/file)" _ file) (string-append file-prog file))))
1673 #t)))
1674 (add-after 'unpack 'patch-share-dirs
1675 (lambda* (#:key outputs #:allow-other-keys)
1676 (let* ((out (assoc-ref outputs "out"))
1677 (share (string-append out "/share"))
1678 (xfe (string-append share "/xfe")))
1679 (with-directory-excursion "src"
1680 (substitute* '("foxhacks.cpp" "help.h" "xfedefs.h"
1681 "XFileExplorer.cpp")
1682 (("/(usr|opt)(/local)?/share") share)
1683 (("~/.config/xfe") xfe)))
1684 #t))))))
1685 (native-inputs
1686 (list intltool pkg-config))
1687 (inputs
1688 `(("bash" ,bash)
1689 ("coreutils" ,coreutils)
1690 ("file" ,file)
1691 ("findutils" ,findutils)
1692 ("fox" ,fox)
1693 ("freetype" ,freetype)
1694 ("x11" ,libx11)
1695 ("xcb" ,libxcb)
1696 ("xcb-util" ,xcb-util)
1697 ("xft" ,libxft)
1698 ("xrandr" ,libxrandr)))
1699 (synopsis "File Manager for X-Based Graphical Systems")
1700 (description "XFE (X File Explorer) is a file manager for X. It is based on
1701the popular but discontinued, X Win Commander. It aims to be the file manager
1702of choice for all light thinking Unix addicts!")
1703 (home-page "http://roland65.free.fr/xfe/")
1704 (license license:gpl2+)))
1705
1706(define-public hddtemp
1707 (package
1708 (name "hddtemp")
1709 ;; <https://savannah.nongnu.org/projects/hddtemp/> advertises the project as
1710 ;; ‘orphaned/unmaintained’. Use a maintained fork/continuation.
1711 (version "0.4.3")
1712 (source
1713 (origin
1714 (method git-fetch)
1715 (uri (git-reference
1716 (url "https://github.com/vitlav/hddtemp")
1717 (commit (string-append "v" version))))
1718 (file-name (git-file-name name version))
1719 (sha256
1720 (base32 "04kylb2ka0jimi238zpfq1yii2caidpmj3ck51rvxz03y5lpq8fw"))))
1721 (build-system gnu-build-system)
1722 (arguments
1723 `(#:configure-flags (list (string-append
1724 "--with-db-path="
1725 (assoc-ref %outputs "out")
1726 "/share/hddtemp/hddtemp.db"))
1727 #:phases
1728 (modify-phases %standard-phases
1729 (add-before 'bootstrap 'delete-autogen.sh
1730 (lambda _
1731 ;; The default 'bootstrap phase works better.
1732 (delete-file "autogen.sh")))
1733 (add-after 'install 'install-db
1734 (lambda* (#:key outputs #:allow-other-keys)
1735 (let ((out (assoc-ref outputs "out")))
1736 (install-file "data/hddtemp.db"
1737 (string-append out "/share/hddtemp"))))))))
1738 (native-inputs
1739 `(("autoconf" ,autoconf)
1740 ("automake" ,automake)
1741 ("gettext" ,gettext-minimal)))
1742 (home-page "https://github.com/vitlav/hddtemp")
1743 (synopsis "Report the temperature of hard drives from S.M.A.R.T. information")
1744 (description "@command{hddtemp} is a small utility that gives you the
1745temperature of your hard drive by reading S.M.A.R.T. information (for drives
1746that support this feature).")
1747 (license license:gpl2+)))
1748
1749(define-public memkind
1750 (package
1751 (name "memkind")
1752 (version "1.13.0")
1753 (source (origin
1754 (method git-fetch)
1755 (uri (git-reference
1756 (url "https://github.com/memkind/memkind")
1757 (commit (string-append "v" version))))
1758 (file-name (git-file-name name version))
1759 (sha256
1760 (base32 "0zbil6xqmsrnh773ihxyfna6pvvxv3kczdb3g863ssflwwvv7h4w"))))
1761 (build-system gnu-build-system)
1762 (inputs
1763 (list ;; memkind patched jemalloc to add je_arenalookupx,
1764 ;; je_check_reallocatex--i.e. they forked jemalloc.
1765 ;("jemalloc" ,jemalloc)
1766 ndctl numactl))
1767 (native-inputs
1768 (list autoconf automake libtool))
1769 (arguments
1770 `(#:configure-flags
1771 (list (string-append "--docdir=" (assoc-ref %outputs "out")
1772 "/share/doc/" ,name "-" ,version))
1773 #:parallel-build? #f ;fails otherwise
1774 #:tests? #f ; Tests require a NUMA-enabled system.
1775 #:phases
1776 (modify-phases %standard-phases
1777 (add-before 'build 'autogen-jemalloc
1778 (lambda _
1779 (with-directory-excursion "jemalloc"
1780 (substitute* "Makefile.in"
1781 (("/bin/sh") (which "sh")))
1782 (invoke "autoconf")
1783 (substitute* "configure"
1784 (("/bin/sh") (which "sh")))))))))
1785 (home-page "https://github.com/memkind/memkind")
1786 (synopsis "Heap manager with memory kinds (for NUMA)")
1787 (description "This package provides a user-extensible heap manager
1788built on top of jemalloc which enables control of memory characteristics
1789and a partitioning of the heap between kinds of memory (for NUMA).")
1790 (license license:bsd-3)))
1791
1792(define-public mmc-utils
1793 (let ((commit "3969aa4804edb8aed7bcb3c958e49d0c7388b067")
1794 (revision "1"))
1795 (package
1796 (name "mmc-utils")
1797 (version (git-version "0.1" revision commit))
1798 (source
1799 (origin
1800 (method git-fetch)
1801 (uri (git-reference
1802 (url "https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git")
1803 (commit commit)))
1804 (file-name (git-file-name name version))
1805 (sha256
1806 (base32 "0pvcm685x63afvp8795jd4vn4zs8psh8bs6j2yvk1kgrawpyk10g"))))
1807 (build-system gnu-build-system)
1808 (arguments
1809 `(#:tests? #f ; No test suite
1810 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))
1811 (string-append "CC=" ,(cc-for-target)))
1812 #:phases
1813 (modify-phases %standard-phases
1814 ;; No ./configure script
1815 (delete 'configure)
1816 ;; The Makefile's "install-man" target is a no-op.
1817 (add-after 'install 'install-doc
1818 (lambda* (#:key outputs #:allow-other-keys)
1819 (let* ((out (assoc-ref outputs "out"))
1820 (man1 (string-append out "/share/man/man1")))
1821 (install-file "man/mmc.1" man1)))))))
1822 (home-page
1823 "https://www.kernel.org/doc/html/latest/driver-api/mmc/mmc-tools.html")
1824 (synopsis "Configure MMC storage devices from userspace")
1825 (description "mmc-utils is a command-line tool for configuring and
1826inspecting MMC storage devices from userspace.")
1827 (license license:gpl2))))
1828
1829(define-public duc
1830 (package
1831 (name "duc")
1832 (version "1.4.5")
1833 (source (origin
1834 (method git-fetch)
1835 (uri (git-reference
1836 (url "https://github.com/zevv/duc")
1837 (commit version)))
1838 (file-name (git-file-name name version))
1839 (sha256
1840 (base32
1841 "0sglcn38rgn6y3m5ahngizyn3x2rzhqjphs7g0ppnlinkz56rcv4"))
1842 (patches
1843 (search-patches "duc-fix-test-sh.patch"))))
1844 (build-system gnu-build-system)
1845 (arguments
1846 (list
1847 #:phases
1848 #~(modify-phases %standard-phases
1849 (add-after 'unpack 'patch
1850 (lambda* (#:key outputs #:allow-other-keys)
1851 (let* ((out (assoc-ref outputs "out")))
1852 (substitute* "src/duc/cmd-ui.c"
1853 (("ncursesw/ncurses.h") "ncurses.h"))
1854 (substitute* "examples/index.cgi"
1855 (("/usr/local/bin/duc")
1856 (string-append out "/bin/duc"))))))
1857 (add-after 'install 'install-examples
1858 (lambda* (#:key outputs #:allow-other-keys)
1859 (let* ((out (assoc-ref outputs "out"))
1860 (doc (string-append out "/share/doc/" #$name "-" #$version)))
1861 (copy-recursively "examples" (string-append doc "/examples")))))
1862 (replace 'check
1863 (lambda* (#:key tests? #:allow-other-keys)
1864 (substitute* "test.sh"
1865 ;; Keep the test logs where --keep-failed can see them.
1866 (("^(DUC_TEST_DIR=).*" _ assign)
1867 (format #f "~a~a/test-directory~%" assign (getcwd)))
1868 ;; XXX ‘actual size’ differed on my system (a consistent 348160
1869 ;; bytes where the tests expect 540672). However, the ‘apparent
1870 ;; size’ matches, as does the actual test output. Good enough…?
1871 ((" [0-9]*B actual") " [0-9]*B actual"))
1872 (when tests?
1873 (invoke "./test.sh"))))))) ; no ‘check’ target
1874 (native-inputs
1875 (list autoconf automake libtool pkg-config))
1876 (inputs
1877 (list cairo pango tokyocabinet ncurses))
1878 (home-page "https://duc.zevv.nl")
1879 (synopsis "Library and suite of tools for inspecting disk usage")
1880 (description "Duc maintains a database of accumulated sizes of
1881directories of the file system, and allows you to query this database with
1882some tools, or create fancy graphs showing you where your bytes are.
1883
1884Duc comes with console utilities, ncurses and X11 user interfaces and a CGI
1885wrapper for disk usage querying and visualisation.")
1886 (license license:lgpl3+)))
1887
1888(define-public qdirstat
1889 (package
1890 (name "qdirstat")
1891 (version "1.9")
1892 (source (origin
1893 (method git-fetch)
1894 (uri (git-reference
1895 (url "https://github.com/shundhammer/qdirstat")
1896 (commit version)))
1897 (file-name (git-file-name name version))
1898 (sha256
1899 (base32
1900 "09amjkg0h097kahscap59imyg4wpjy43lkaiqw60ady3s6b6c1x7"))))
1901 (build-system qt-build-system)
1902 (arguments
1903 (list
1904 #:tests? #f
1905 #:modules '((guix build qt-build-system)
1906 ((guix build gnu-build-system) #:prefix gnu:)
1907 (guix build utils))
1908 #:phases
1909 #~(modify-phases %standard-phases
1910 (replace 'configure
1911 (lambda _
1912 (system* "qmake" (string-append "INSTALL_PREFIX=" #$output))))
1913 (replace 'build (assoc-ref gnu:%standard-phases 'build))
1914 (replace 'install (assoc-ref gnu:%standard-phases 'install))
1915 (add-after 'install 'wrap
1916 (lambda _
1917 (wrap-program (string-append #$output
1918 "/bin/qdirstat-cache-writer")
1919 `("PERL5LIB" ":" prefix
1920 (,(string-append
1921 #$(this-package-input "perl-uri-escape")
1922 "/lib/perl5/site_perl")))))))))
1923 (inputs
1924 (list bash-minimal
1925 perl
1926 perl-uri-escape
1927 qtbase-5
1928 qtwayland-5
1929 zlib))
1930 (home-page "https://github.com/shundhammer/qdirstat")
1931 (synopsis "Storage utilisation visualization tool")
1932 (description
1933 "QDirStat is a graphical application to show where your disk space has
1934gone and to help you to clean it up.")
1935 (license license:gpl2)))
1936
1937(define-public nwipe
1938 (package
1939 (name "nwipe")
1940 (version "0.36")
1941 (source
1942 (origin
1943 (method git-fetch)
1944 (uri (git-reference
1945 (url "https://github.com/martijnvanbrummelen/nwipe")
1946 (commit (string-append "v" version))))
1947 (file-name (git-file-name name version))
1948 (sha256
1949 (base32 "075zwakv3lva46v6wab00l5x7bs2k73mzzhwlbvm839r8a6gm0dh"))))
1950 (build-system gnu-build-system)
1951 (arguments
1952 (list #:phases
1953 #~(modify-phases %standard-phases
1954 (add-after 'install 'wrap
1955 (lambda* (#:key inputs outputs #:allow-other-keys)
1956 (wrap-program (search-input-file outputs "bin/nwipe")
1957 (list "PATH" ":" 'prefix
1958 (map (lambda (p) (dirname (search-input-file inputs p)))
1959 '("sbin/dmidecode"
1960 "sbin/hdparm"
1961 "sbin/smartctl")))))))))
1962 (inputs
1963 (list bash-minimal
1964 dmidecode
1965 hdparm
1966 libconfig
1967 ncurses
1968 parted
1969 smartmontools))
1970 (native-inputs
1971 (list autoconf automake libtool pkg-config))
1972 (home-page "https://github.com/martijnvanbrummelen/nwipe")
1973 (synopsis "Secure disk wiping utility")
1974 (description
1975 "@command{nwipe} securely erases disks using a variety of methods to
1976ensure the data cannot be recovered. It can wipe multiple drives in parallel
1977and can be used noninteractively or with a text-based user interface.")
1978 (license
1979 (list license:gpl2
1980 license:bsd-3 ; mt19937ar-cok
1981 license:public-domain)))) ; {isaac_rand,PDFGen}
1982
1983(define-public wipe
1984 (package
1985 (name "wipe")
1986 (version "2.3.1")
1987 (source (origin
1988 (method url-fetch)
1989 (uri (string-append "mirror://sourceforge/wipe/wipe/" version
1990 "/wipe-" version ".tar.bz2"))
1991 (sha256
1992 (base32
1993 "180snqvh6k6il6prb19fncflf2jcvkihlb4w84sbndcv1wvicfa6"))))
1994 (build-system gnu-build-system)
1995 (arguments
1996 (list
1997 #:tests? #f ;no tests
1998 #:phases
1999 #~(modify-phases %standard-phases
2000 (add-after 'unpack 'patch-makefile
2001 (lambda _
2002 (substitute* "Makefile.in"
2003 ;; The Makefile.in uses install -o root, but during the
2004 ;; build there is no root user, so if we leave that in,
2005 ;; the build fails with the following error:
2006 ;; /gnu/[...]/install: invalid user ‘root’
2007 (("-o root") "")
2008 ;; It's up to the distribution to strip the binaries or
2009 ;; not.
2010 (("\\$\\(INSTALL_BIN\\) -s ")
2011 "$(INSTALL_BIN) "))))
2012 (add-after 'unpack 'force-autotools-bootstrap
2013 (lambda _
2014 ;; Rebuild the build system scripts, as the ones in bundles are
2015 ;; very old and do not support all the options used by Guix.
2016 (delete-file "configure"))))))
2017 (native-inputs (list autoconf automake libtool))
2018 (home-page "https://wipe.sourceforge.net")
2019 (synopsis "Secure file/block device wiping utility")
2020 (description
2021 "Wipe can erase files and block devices securely. To work properly it
2022relies on several assumptions like having the block device write the correct
2023sectors, etc. For files it also doesn't work on log-structured file systems
2024such as F2FS, JFFS, LogFS, etc. You should @emph{not} trust @command{wipe} to
2025work as advertised until you have manually verified that all its assumption
2026hold true on your system. To overwrite data it uses the Mersenne Twister
2027pseudo-random number generator (PRNG) that is seeded with @file{/dev/urandom}
2028or, if unavailable, @file{/dev/random}.")
2029 (license license:gpl2+)))