gnu: Add emacs-evil-ediff.
[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 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
11 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
12 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
13 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages disk)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system trivial)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages databases)
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages gettext)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages popt)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages guile)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages vim)
56 #:use-module (gnu packages xml))
57
58 (define-public parted
59 (package
60 (name "parted")
61 (version "3.2")
62 (source (origin
63 (method url-fetch)
64 (uri (string-append "mirror://gnu/parted/parted-"
65 version ".tar.xz"))
66 (sha256
67 (base32
68 "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5"))))
69 (build-system gnu-build-system)
70 (arguments
71 `(#:phases
72 (modify-phases %standard-phases
73 (add-after
74 'unpack 'fix-locales-and-python
75 (lambda* (#:key inputs #:allow-other-keys)
76 (substitute* "tests/t0251-gpt-unicode.sh"
77 (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
78 (substitute* "tests/msdos-overlap"
79 (("/usr/bin/python") (which "python"))))))))
80 (inputs
81 `(("lvm2" ,lvm2)
82 ("readline" ,readline)
83 ("util-linux" ,util-linux)))
84 (native-inputs
85 `(("gettext" ,gettext-minimal)
86 ;; For the tests.
87 ("perl" ,perl)
88 ("python" ,python-2)))
89 (home-page "https://www.gnu.org/software/parted/")
90 (synopsis "Disk partition editor")
91 (description
92 "GNU Parted is a package for creating and manipulating disk partition
93 tables. It includes a library and command-line utility.")
94 (license license:gpl3+)))
95
96 (define-public fdisk
97 (package
98 (name "fdisk")
99 (version "2.0.0a1")
100 (source
101 (origin
102 (method url-fetch)
103 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
104 version ".tar.gz"))
105 (sha256
106 (base32
107 "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
108 (build-system gnu-build-system)
109 (inputs
110 `(("gettext" ,gettext-minimal)
111 ("guile" ,guile-1.8)
112 ("util-linux" ,util-linux)
113 ("parted" ,parted)))
114 ;; The build neglects to look for its own headers in its own tree. A next
115 ;; release should fix this, but may never come: GNU fdisk looks abandoned.
116 (arguments
117 `(#:phases
118 (modify-phases %standard-phases
119 (add-after 'unpack 'skip-broken-header-probes
120 (lambda _
121 (substitute* "backend/configure"
122 (("gnufdisk-common.h .*") "\n"))
123 #t)))
124 #:make-flags (list (string-append "CPPFLAGS="
125 " -I../common/include "
126 " -I../debug/include "
127 " -I../exception/include"))))
128 (home-page "https://www.gnu.org/software/fdisk/")
129 (synopsis "Low-level disk partitioning and formatting")
130 (description
131 "GNU fdisk provides a GNU version of the common disk partitioning tool
132 fdisk. fdisk is used for the creation and manipulation of disk partition
133 tables, and it understands a variety of different formats.")
134 (license license:gpl3+)))
135
136 (define-public gptfdisk
137 (package
138 (name "gptfdisk")
139 (version "1.0.3")
140 (source
141 (origin
142 (method url-fetch)
143 (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
144 version "/" name "-" version ".tar.gz"))
145 (sha256
146 (base32
147 "0p0vr67lnqdsgdv2y144xmjqa1a2nijrrd3clc8dc2f46pn5mzc9"))))
148 (build-system gnu-build-system)
149 (inputs
150 `(("gettext" ,gettext-minimal)
151 ("ncurses" ,ncurses)
152 ("popt" ,popt)
153 ("util-linux" ,util-linux))) ; libuuid
154 (arguments
155 `(#:test-target "test"
156 #:phases
157 (modify-phases %standard-phases
158 ;; no configure script
159 (delete 'configure)
160 ;; no install target
161 (replace 'install
162 (lambda* (#:key outputs #:allow-other-keys)
163 (let* ((out (assoc-ref outputs "out"))
164 (bin (string-append out "/bin"))
165 (man (string-append out "/share/man/man8")))
166 (install-file "gdisk" bin)
167 (install-file "sgdisk" bin)
168 (install-file "cgdisk" bin)
169 (install-file "fixparts" bin)
170 (install-file "cgdisk.8" man)
171 (install-file "fixparts.8" man)
172 (install-file "gdisk.8" man)
173 (install-file "sgdisk.8" man)))))))
174 (home-page "http://www.rodsbooks.com/gdisk/")
175 (synopsis "Low-level GPT disk partitioning and formatting")
176 (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
177 works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
178 disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
179 scheme.")
180 (license license:gpl2)))
181
182 (define-public ddrescue
183 (package
184 (name "ddrescue")
185 (version "1.23")
186 (source
187 (origin
188 (method url-fetch)
189 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
190 version ".tar.lz"))
191 (sha256
192 (base32
193 "13cd6c0x91zq10vdlyl6r5rib47bmsn5sshmkin3igwj8pa2vbm9"))))
194 (build-system gnu-build-system)
195 (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
196 (synopsis "Data recovery utility")
197 (native-inputs `(("lzip" ,lzip)))
198 (description
199 "GNU ddrescue is a fully automated data recovery tool. It copies data
200 from one file to another, working to rescue data in case of read errors. The
201 program also includes a tool for manipulating its log files, which are used
202 to recover data more efficiently by only reading the necessary blocks.")
203 (license license:gpl3+)))
204
205 (define-public dosfstools
206 (package
207 (name "dosfstools")
208 (version "4.1")
209 (source
210 (origin
211 (method url-fetch)
212 (uri (string-append "https://github.com/" name "/" name
213 "/releases/download/v" version "/"
214 name "-" version ".tar.xz"))
215 (sha256
216 (base32
217 "0wy13i3i4x2bw1hf5m4fd0myh61f9bcrs035fdlf6gyc1jksrcp6"))))
218 (build-system gnu-build-system)
219 (arguments
220 `(#:make-flags (list (string-append "PREFIX=" %output)
221 "CC=gcc")))
222 (native-inputs
223 `(("xxd" ,xxd))) ; for tests
224 (home-page "https://github.com/dosfstools/dosfstools")
225 (synopsis "Utilities for making and checking MS-DOS FAT file systems")
226 (description
227 "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
228 which respectively make and check MS-DOS FAT file systems.")
229 (license license:gpl3+)))
230
231 (define dosfstools/static
232 (static-package
233 (package (inherit dosfstools))))
234
235 (define-public fatfsck/static
236 (package
237 (name "fatfsck-static")
238 (version (package-version dosfstools))
239 (build-system trivial-build-system)
240 (source #f)
241 (arguments
242 `(#:modules ((guix build utils))
243 #:builder
244 (begin
245 (use-modules (guix build utils))
246 (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
247 "/sbin"))
248 (exe "fsck.fat")
249 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
250 (mkdir-p bin)
251 (with-directory-excursion bin
252 (copy-file (string-append src "/" exe) exe)
253 (remove-store-references exe)
254 (chmod exe #o555)
255 ;; Add fsck.vfat symlink to match the Linux driver name.
256 (symlink exe "fsck.vfat")
257 #t)))))
258 (inputs `(("dosfstools" ,dosfstools/static)))
259 (home-page (package-home-page dosfstools))
260 (synopsis "Statically linked fsck.fat from dosfstools")
261 (description "This package provides a statically-linked @command{fsck.fat}
262 and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
263 (license (package-license dosfstools))))
264
265 (define-public sdparm
266 (package
267 (name "sdparm")
268 (version "1.10")
269 (source
270 (origin
271 (method url-fetch)
272 (uri (string-append "http://sg.danny.cz/sg/p/"
273 name "-" version ".tar.xz"))
274 (sha256
275 (base32
276 "1jjq3lzgfy4r76rc26q02lv4wm5cb4dx5nh913h489zjrr4f3jbx"))))
277 (build-system gnu-build-system)
278 (home-page "http://sg.danny.cz/sg/sdparm.html")
279 (synopsis "Provide access to SCSI device parameters")
280 (description
281 "Sdparm reads and modifies SCSI device parameters. These devices can be
282 SCSI disks, in which case the role of @command{sdparm} is similar to its
283 namesake: the @command{hdparm} utility originally designed for ATA disks.
284 However, @command{sdparm} can be used to access parameters on any device that
285 uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
286 transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
287 also send commands associated with starting and stopping the media, loading
288 and unloading removable media and some other housekeeping functions.")
289 (license license:bsd-3)))
290
291 (define-public idle3-tools
292 (package
293 (name "idle3-tools")
294 (version "0.9.1")
295 (source
296 (origin
297 (method url-fetch)
298 (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
299 version ".tgz"))
300 (sha256
301 (base32
302 "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
303 (build-system gnu-build-system)
304 (arguments
305 `(#:tests? #f ;no test suite
306 #:phases
307 (modify-phases %standard-phases
308 (delete 'configure))
309 #:make-flags (list "CC=gcc"
310 (string-append "manprefix=")
311 (string-append "DESTDIR="
312 (assoc-ref %outputs "out")))))
313 (home-page "http://idle3-tools.sourceforge.net")
314 (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
315 (description
316 "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
317 present in many Western Digital hard drives. This timer is part of the
318 \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
319 the default timer setting is not well suited to Linux or other *nix systems,
320 and can dramatically shorten the lifespan of the drive if left unchecked.")
321 (license license:gpl3+)))
322
323 (define-public gparted
324 (package
325 (name "gparted")
326 (version "0.31.0")
327 (source
328 (origin
329 (method url-fetch)
330 (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
331 version "/gparted-" version ".tar.gz"))
332 (sha256
333 (base32 "1fh7rpgb4xxdhgyjsirb83zvjfc5mfngb8a1pjbv7r6r6jj4jyrv"))))
334 (build-system gnu-build-system)
335 (arguments
336 `(#:tests? #f ; tests require a network connection
337 #:configure-flags '("--disable-scrollkeeper")))
338 (inputs
339 `(("util-linux" ,util-linux)
340 ("parted" ,parted)
341 ("glib" ,glib)
342 ("gtkmm" ,gtkmm-2)
343 ("libxml2" ,libxml2)
344 ("libxslt" ,libxslt)
345 ("gnome-doc-utils" ,gnome-doc-utils)
346 ("docbook-xml" ,docbook-xml-4.2)
347 ("python" ,python-2)
348 ("python-libxml2" ,python2-libxml2)
349 ("which" ,which)))
350 (native-inputs
351 `(("intltool" ,intltool)
352 ("pkg-config" ,pkg-config)))
353 (home-page "https://gparted.org/")
354 (synopsis "Partition editor to graphically manage disk partitions")
355 (description "GParted is a GNOME partition editor for creating,
356 reorganizing, and deleting disk partitions. It uses libparted from the parted
357 project to detect and manipulate partition tables. Optional file system tools
358 permit managing file systems not included in libparted.")
359 ;; The home page says GPLv2, but the source code says GPLv2+.
360 (license license:gpl2+)))
361
362 (define-public pydf
363 (package
364 (name "pydf")
365 (version "12")
366 (source
367 (origin
368 (method url-fetch)
369 (uri (pypi-uri "pydf" version))
370 (sha256
371 (base32
372 "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
373 (build-system python-build-system)
374 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
375 (synopsis "Colourised @command{df} clone")
376 (description "All-singing, all-dancing, fully colourised @command{df} clone
377 written in Python. It displays the amount of disk space available on the
378 mounted file systems, using different colours for different types of file
379 systems. Output format is completely customizable.")
380 (license license:public-domain)))
381
382 (define-public f3
383 (package
384 (name "f3")
385 (version "6.0")
386 (source
387 (origin
388 (method url-fetch)
389 (uri (string-append "https://github.com/AltraMayor/f3/archive/"
390 "v" version ".tar.gz"))
391 (file-name (string-append name "-" version ".tar.gz"))
392 (sha256
393 (base32
394 "1mgbzc1swvgil45md1336j0aqkmkhwmpxical0ln5g09b2qxsanp"))))
395 (build-system gnu-build-system)
396 (arguments
397 '(#:tests? #f ; no check target
398 #:make-flags (list "CC=gcc"
399 (string-append "PREFIX=" %output))
400 #:phases
401 (modify-phases %standard-phases
402 (delete 'configure)
403 (add-before 'build 'fix-makefile
404 (lambda _
405 (substitute* "Makefile"
406 ;; Install without setting owner and group
407 (("\\$\\(INSTALL\\) -oroot -groot ") "$(INSTALL) ")
408 ;; also build and install experimental tools
409 (("^all: ") "all: $(EXPERIMENTAL_TARGETS) ")
410 (("^install: ") "install-all: ")
411 (("^install-experimental: ") "install: install-all "))
412 #t)))))
413 (inputs
414 `(("eudev" ,eudev)
415 ("parted" ,parted)))
416 (home-page "http://oss.digirati.com.br/f3/")
417 (synopsis "Test real capacity of flash memory cards and such.")
418 (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
419 capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
420 the card and then checks if can read it. It will assure you haven't been sold
421 a card with a smaller capacity than stated.")
422 (license license:gpl3+)))
423
424 (define-public python-parted
425 (package
426 (name "python-parted")
427 (version "3.11.1")
428 (source
429 (origin
430 (method url-fetch)
431 (uri (string-append "https://github.com/dcantrell/pyparted/archive/v"
432 version ".tar.gz"))
433 (sha256
434 (base32
435 "0r1nyjj40nacnfnv17x2mnsj6ga1qplyxyza82v2809dfhim2fwq"))))
436 (build-system python-build-system)
437 (arguments
438 `(#:phases
439 (modify-phases %standard-phases
440 (delete 'check)
441 (add-after 'install 'check
442 (lambda* (#:key outputs inputs #:allow-other-keys)
443 (add-installed-pythonpath inputs outputs)
444 ;; See <https://github.com/dcantrell/pyparted/issues/47>.
445 (substitute* "tests/test__ped_ped.py"
446 (("\"/tmp/temp-device-\"") "self.path"))
447 (invoke "python" "-m" "unittest" "discover" "-v")
448 #t)))))
449 (native-inputs
450 `(("e2fsprogs" ,e2fsprogs)
451 ("pkg-config" ,pkg-config)))
452 (propagated-inputs
453 `(("python-six" ,python-six)))
454 (inputs
455 `(("parted" ,parted)))
456 (home-page "https://github.com/dcantrell/pyparted")
457 (synopsis "Parted bindings for Python")
458 (description "This package provides @code{parted} bindings for Python.")
459 (license license:gpl2+)))
460
461 (define-public python2-parted
462 (package-with-python2 python-parted))
463
464 (define-public duperemove
465 (package
466 (name "duperemove")
467 (version "0.11")
468 (source (origin
469 (method url-fetch)
470 (uri (string-append
471 "https://github.com/markfasheh/duperemove/archive/v"
472 version ".tar.gz"))
473 (sha256
474 (base32
475 "0rjmmh42yqw9a5j6sp31cqwxk3s97dsi4xz0wpxpllj7bsp3aiw5"))
476 (file-name (string-append name "-" version ".tar.gz"))))
477 (build-system gnu-build-system)
478 (native-inputs
479 `(("pkg-config" ,pkg-config)))
480 (inputs
481 `(("glib" ,glib)
482 ("sqlite" ,sqlite)))
483 (arguments
484 `(#:tests? #f ; no test suite
485 #:phases
486 (modify-phases %standard-phases
487 (delete 'configure)) ; no configure script
488 #:make-flags (list (string-append "PREFIX=" %output)
489 "CC=gcc")))
490 (home-page "https://github.com/markfasheh/duperemove")
491 (synopsis "Tools for de-duplicating file system data")
492 (description "Duperemove is a simple tool for finding duplicated extents
493 and submitting them for deduplication. When given a list of files it will
494 hash their contents on a block by block basis and compare those hashes to each
495 other, finding and categorizing blocks that match each other. When given the
496 @option{-d} option, duperemove will submit those extents for deduplication
497 using the Linux kernel extent-same @code{ioctl}.
498
499 Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
500 existing hash file, duperemove will only compute hashes for those files which
501 have changed since the last run. Thus you can run duperemove repeatedly on
502 your data as it changes, without having to re-checksum unchanged data.
503
504 Duperemove can also take input from the @command{fdupes} program.")
505 (license license:gpl2)))
506
507 (define-public ranger
508 (package
509 (name "ranger")
510 (version "1.9.1")
511 (source (origin
512 (method url-fetch)
513 (uri (string-append "https://ranger.github.io/"
514 "ranger-" version ".tar.gz"))
515 (sha256
516 (base32
517 "1lnzkrxcnlwnyi3z0v8ybyp8d5rm26qm35rr68kbs2lbs06inha0"))))
518 (build-system python-build-system)
519 (native-inputs ;for tests
520 `(("python-pytest" ,python-pytest)
521 ("python-pylint" ,python-pylint)
522 ("python-flake8" ,python-flake8)
523 ("which" ,which)))
524 (arguments '(#:test-target "test"))
525 (home-page "https://ranger.github.io/")
526 (synopsis "Console file manager")
527 (description "ranger is a console file manager with Vi key bindings. It
528 provides a minimalistic and nice curses interface with a view on the directory
529 hierarchy. It ships with @code{rifle}, a file launcher that is good at
530 automatically finding out which program to use for what file type.")
531 (license license:gpl3)))