Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, fetchpatch, lvm2 }: 2 3stdenv.mkDerivation rec { 4 pname = "dmraid"; 5 version = "1.0.0.rc16"; 6 7 src = fetchurl { 8 url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/dmraid-${version}.tar.bz2"; 9 sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq"; 10 }; 11 12 patches = [ ./hardening-format.patch ] 13 ++ lib.optionals stdenv.hostPlatform.isMusl [ 14 (fetchpatch { 15 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch"; 16 sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w"; 17 stripLen = 2; 18 extraPrefix = "1.0.0.rc16/"; 19 }) 20 (fetchpatch { 21 url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch"; 22 sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k"; 23 stripLen = 2; 24 extraPrefix = "1.0.0.rc16/"; 25 }) 26 ]; 27 28 postPatch = '' 29 sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in 30 '' + lib.optionalString stdenv.hostPlatform.isMusl '' 31 NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE" 32 ''; 33 34 preConfigure = "cd */"; 35 36 buildInputs = [ lvm2 ]; 37 38 # Hand-written Makefile does not have full dependencies to survive 39 # parallel build: 40 # tools/dmraid.c:12:10: fatal error: dmraid/dmraid.h: No such file 41 enableParallelBuilding = false; 42 43 meta = { 44 description = "Old-style RAID configuration utility"; 45 longDescription = '' 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. 50 ''; 51 maintainers = [ lib.maintainers.raskin ]; 52 platforms = lib.platforms.linux; 53 license = lib.licenses.gpl2Plus; 54 }; 55}