2017-06-28 22:39:12 +02:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl, groff
|
|
|
|
, buildPlatform, hostPlatform
|
|
|
|
}:
|
2017-01-10 14:06:52 +01:00
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "mdadm-4.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://kernel/linux/utils/raid/mdadm/${name}.tar.xz";
|
|
|
|
sha256 = "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx";
|
|
|
|
};
|
|
|
|
|
|
|
|
# This is to avoid self-references, which causes the initrd to explode
|
|
|
|
# in size and in turn prevents mdraid systems from booting.
|
|
|
|
allowedReferences = [ stdenv.glibc.out ];
|
|
|
|
|
|
|
|
patches = [ ./no-self-references.patch ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin"
|
|
|
|
"MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
|
2017-09-04 17:55:57 +02:00
|
|
|
"STRIP="
|
2017-06-28 22:39:12 +02:00
|
|
|
] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
|
|
|
|
"CROSS_COMPILE=${stdenv.cc.prefix}"
|
2017-01-10 14:06:52 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ groff ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -e 's@/lib/udev@''${out}/lib/udev@' \
|
|
|
|
-e 's@ -Werror @ @' \
|
2017-01-29 11:11:01 +01:00
|
|
|
-e 's@/usr/sbin/sendmail@/run/wrappers/bin/sendmail@' -i Makefile
|
2017-01-10 14:06:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Programs for managing RAID arrays under Linux";
|
|
|
|
homepage = http://neil.brown.name/blog/mdadm;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|