gnu: Merge Parted, fdisk, and ddrescue in (gnu packages disk).
[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 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages disk)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages check)
25 #:use-module (gnu packages gettext)
26 #:use-module (gnu packages linux)
27 #:use-module (gnu packages readline)
28 #:use-module (gnu packages guile)
29 #:use-module ((gnu packages compression)
30 #:select (lzip)))
31
32 (define-public parted
33 (package
34 (name "parted")
35 (version "3.1")
36 (source
37 (origin
38 (method url-fetch)
39 (uri (string-append "mirror://gnu/parted/parted-"
40 version ".tar.xz"))
41 (sha256
42 (base32
43 "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y"))))
44 (build-system gnu-build-system)
45 (arguments `(#:configure-flags '("--disable-device-mapper")
46 #:phases (alist-cons-before
47 'configure 'fix-mkswap
48 (lambda* (#:key inputs #:allow-other-keys)
49 (let ((util-linux (assoc-ref inputs
50 "util-linux")))
51 (substitute*
52 "tests/t9050-partition-table-types.sh"
53 (("mkswap")
54 (string-append util-linux "/sbin/mkswap")))))
55 %standard-phases)))
56 (inputs
57 ;; XXX: add 'lvm2'.
58 `(("check" ,check)
59
60 ;; With Readline 6.3, parted/ui.c fails to build because it uses the
61 ;; now undefined 'CPPFunction' type.
62 ("readline" ,readline-6.2)
63
64 ("util-linux" ,util-linux)))
65 (native-inputs
66 `(("gettext" ,gnu-gettext)))
67 (home-page "http://www.gnu.org/software/parted/")
68 (synopsis "Disk partition editor")
69 (description
70 "GNU Parted is a package for creating and manipulating disk partition
71 tables. It includes a library and command-line utility.")
72 (license gpl3+)))
73
74 (define-public fdisk
75 (package
76 (name "fdisk")
77 (version "2.0.0a")
78 (source
79 (origin
80 (method url-fetch)
81 (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
82 version ".tar.gz"))
83 (sha256
84 (base32
85 "04nd7civ561x2lwcmxhsqbprml3178jfc58fy1v7hzqg5k4nbhy3"))))
86 (build-system gnu-build-system)
87 (inputs
88 `(("gettext" ,gnu-gettext)
89 ("guile" ,guile-1.8)
90 ("util-linux" ,util-linux)
91 ("parted" ,parted)))
92 (home-page "https://www.gnu.org/software/fdisk/")
93 (synopsis "Low-level disk partitioning and formatting")
94 (description
95 "GNU fdisk provides a GNU version of the common disk partitioning tool
96 fdisk. fdisk is used for the creation and manipulation of disk partition
97 tables, and it understands a variety of different formats.")
98 (license gpl3+)))
99
100 (define-public ddrescue
101 (package
102 (name "ddrescue")
103 (version "1.17")
104 (source
105 (origin
106 (method url-fetch)
107 (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
108 version ".tar.lz"))
109 (sha256
110 (base32
111 "0bvmsbzli2j4czwkabzs978n1y6vx31axh02kpgcf7033cc6rydy"))))
112 (build-system gnu-build-system)
113 (home-page "http://www.gnu.org/software/ddrescue/ddrescue.html")
114 (synopsis "Data recovery utility")
115 (native-inputs `(("lzip" ,lzip)))
116 (description
117 "GNU ddrescue is a fully automated data recovery tool. It copies data
118 from one file to another, working to rescue data in case of read errors. The
119 program also includes a tool for manipulating its log files, which are used
120 to recover data more efficiently by only reading the necessary blocks.")
121 (license gpl3+)))