lol
1{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline, perl, python2
2, utillinux, check, enableStatic ? false, hurd ? null }:
3
4stdenv.mkDerivation rec {
5 name = "parted-3.2";
6
7 src = fetchurl {
8 url = "mirror://gnu/parted/${name}.tar.xz";
9 sha256 = "1r3qpg3bhz37mgvp9chsaa3k0csby3vayfvz8ggsqz194af5i2w5";
10 };
11
12 patches = stdenv.lib.optional doCheck ./gpt-unicode-test-fix.patch;
13
14 postPatch = stdenv.lib.optionalString doCheck ''
15 patchShebangs tests
16 '';
17
18 buildInputs = [ libuuid ]
19 ++ stdenv.lib.optional (readline != null) readline
20 ++ stdenv.lib.optional (gettext != null) gettext
21 ++ stdenv.lib.optional (devicemapper != null) devicemapper
22 ++ stdenv.lib.optional (hurd != null) hurd
23 ++ stdenv.lib.optionals doCheck [ check perl python2 ];
24
25 configureFlags =
26 (if (readline != null)
27 then [ "--with-readline" ]
28 else [ "--without-readline" ])
29 ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper"
30 ++ stdenv.lib.optional enableStatic "--enable-static";
31
32 # Tests were previously failing due to Hydra running builds as uid 0.
33 # That should hopefully be fixed now.
34 doCheck = true;
35
36 preCheck =
37 stdenv.lib.optionalString doCheck
38 # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
39 "export PATH=\"${utillinux}/sbin:$PATH\"";
40
41 meta = {
42 description = "Create, destroy, resize, check, and copy partitions";
43
44 longDescription = ''
45 GNU Parted is an industrial-strength package for creating, destroying,
46 resizing, checking and copying partitions, and the file systems on
47 them. This is useful for creating space for new operating systems,
48 reorganising disk usage, copying data on hard disks and disk imaging.
49
50 It contains a library, libparted, and a command-line frontend, parted,
51 which also serves as a sample implementation and script backend.
52 '';
53
54 homepage = http://www.gnu.org/software/parted/;
55 license = stdenv.lib.licenses.gpl3Plus;
56
57 maintainers = [
58 # Add your name here!
59 ];
60
61 # GNU Parted requires libuuid, which is part of util-linux-ng.
62 platforms = stdenv.lib.platforms.linux;
63 };
64}