3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/mdadm/default.nix

41 lines
1.2 KiB
Nix
Raw Normal View History

2018-10-27 10:34:56 +01:00
{ stdenv, writeScript, fetchurl, groff, system-sendmail }:
stdenv.mkDerivation rec {
2018-10-28 10:39:13 +00:00
name = "mdadm-4.1";
src = fetchurl {
url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.xz";
2018-10-28 10:39:13 +00:00
sha256 = "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb";
};
# This is to avoid self-references, which causes the initrd to explode
# in size and in turn prevents mdraid systems from booting.
2018-10-27 10:34:56 +01:00
allowedReferences = [ stdenv.cc.libc.out system-sendmail ];
patches = [ ./no-self-references.patch ];
makeFlags = [
"NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin"
"MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
"STRIP="
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
nativeBuildInputs = [ groff ];
preConfigure = ''
sed -e 's@/lib/udev@''${out}/lib/udev@' \
-e 's@ -Werror @ @' \
2018-10-27 10:34:56 +01:00
-e 's@/usr/sbin/sendmail@${system-sendmail}@' -i Makefile
'';
2018-08-17 21:40:20 +01:00
meta = with stdenv.lib; {
description = "Programs for managing RAID arrays under Linux";
homepage = http://neil.brown.name/blog/mdadm;
2018-08-17 21:40:20 +01:00
license = licenses.gpl2;
2018-10-28 10:39:13 +00:00
maintainers = with maintainers; [ ekleog ];
2018-08-17 21:40:20 +01:00
platforms = platforms.linux;
};
}