1 { lib, stdenv, fetchurl, fetchpatch, lvm2 }:
3 stdenv.mkDerivation rec {
5 version = "1.0.0.rc16";
8 url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/dmraid-${version}.tar.bz2";
9 sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq";
12 patches = [ ./hardening-format.patch ]
13 ++ lib.optionals stdenv.hostPlatform.isMusl [
15 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch";
16 sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w";
18 extraPrefix = "1.0.0.rc16/";
21 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch";
22 sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k";
24 extraPrefix = "1.0.0.rc16/";
29 sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in
30 '' + lib.optionalString stdenv.hostPlatform.isMusl ''
31 NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE"
34 preConfigure = "cd */";
36 buildInputs = [ lvm2 ];
38 # Hand-written Makefile does not have full dependencies to survive
40 # tools/dmraid.c:12:10: fatal error: dmraid/dmraid.h: No such file
41 enableParallelBuilding = false;
44 description = "Old-style RAID configuration utility";
46 Old RAID configuration utility (still under development, though).
47 It is fully compatible with modern kernels and mdadm recognizes
48 its volumes. May be needed for rescuing an older system or nuking
49 the metadata when reformatting.
51 maintainers = [ lib.maintainers.raskin ];
52 platforms = lib.platforms.linux;
53 license = lib.licenses.gpl2Plus;