Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 65 lines 2.0 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 fetchpatch, 6 lvm2, 7}: 8 9stdenv.mkDerivation rec { 10 pname = "dmraid"; 11 version = "1.0.0.rc16"; 12 13 src = fetchurl { 14 url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/dmraid-${version}.tar.bz2"; 15 sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq"; 16 }; 17 18 patches = [ 19 ./hardening-format.patch 20 ./fix-dmevent_tool.patch 21 ] 22 ++ lib.optionals stdenv.hostPlatform.isMusl [ 23 (fetchpatch { 24 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch"; 25 sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w"; 26 stripLen = 2; 27 extraPrefix = "1.0.0.rc16/"; 28 }) 29 (fetchpatch { 30 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch"; 31 sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k"; 32 stripLen = 2; 33 extraPrefix = "1.0.0.rc16/"; 34 }) 35 ]; 36 37 postPatch = '' 38 sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in 39 '' 40 + lib.optionalString stdenv.hostPlatform.isMusl '' 41 NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE" 42 ''; 43 44 preConfigure = "cd */"; 45 46 buildInputs = [ lvm2 ]; 47 48 # Hand-written Makefile does not have full dependencies to survive 49 # parallel build: 50 # tools/dmraid.c:12:10: fatal error: dmraid/dmraid.h: No such file 51 enableParallelBuilding = false; 52 53 meta = { 54 description = "Old-style RAID configuration utility"; 55 longDescription = '' 56 Old RAID configuration utility (still under development, though). 57 It is fully compatible with modern kernels and mdadm recognizes 58 its volumes. May be needed for rescuing an older system or nuking 59 the metadata when reformatting. 60 ''; 61 maintainers = [ lib.maintainers.raskin ]; 62 platforms = lib.platforms.linux; 63 license = lib.licenses.gpl2Plus; 64 }; 65}