1{ stdenv, fetchurl, fetchpatch, lvm2 }:
2
3stdenv.mkDerivation rec {
4 name = "dmraid-1.0.0.rc16";
5
6 src = fetchurl {
7 url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2";
8 sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq";
9 };
10
11 patches = [ ./hardening-format.patch ]
12 ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
13 (fetchpatch {
14 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch";
15 sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w";
16 stripLen = 2;
17 extraPrefix = "1.0.0.rc16/";
18 })
19 (fetchpatch {
20 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch";
21 sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k";
22 stripLen = 2;
23 extraPrefix = "1.0.0.rc16/";
24 })
25 ];
26
27 postPatch = ''
28 sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in
29 '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
30 NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE"
31 '';
32
33 preConfigure = "cd */";
34
35 buildInputs = [ lvm2 ];
36
37 meta = {
38 description = "Old-style RAID configuration utility";
39 longDescription = ''
40 Old RAID configuration utility (still under development, though).
41 It is fully compatible with modern kernels and mdadm recognizes
42 its volumes. May be needed for rescuing an older system or nuking
43 the metadata when reformatting.
44 '';
45 maintainers = [ stdenv.lib.maintainers.raskin ];
46 platforms = stdenv.lib.platforms.linux;
47 license = stdenv.lib.licenses.gpl2Plus;
48 };
49}