2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, util-linux, coreutils, fetchurl, groff, system-sendmail }:
|
2018-10-27 10:34:56 +01:00
|
|
|
|
2010-05-15 19:43:24 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-08-27 15:47:49 +01:00
|
|
|
pname = "mdadm";
|
|
|
|
version = "4.1";
|
2011-10-06 14:15:09 +01:00
|
|
|
|
2007-01-10 21:47:03 +00:00
|
|
|
src = fetchurl {
|
2021-08-27 15:47:49 +01:00
|
|
|
url = "mirror://kernel/linux/utils/raid/mdadm/mdadm-${version}.tar.xz";
|
2018-10-28 10:39:13 +00:00
|
|
|
sha256 = "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb";
|
2007-01-10 21:47:03 +00:00
|
|
|
};
|
|
|
|
|
2015-12-09 18:17:30 +00:00
|
|
|
patches = [ ./no-self-references.patch ];
|
|
|
|
|
2015-12-09 19:02:37 +00:00
|
|
|
makeFlags = [
|
2019-07-25 14:29:39 +01:00
|
|
|
"NIXOS=1" "INSTALL=install" "BINDIR=$(out)/sbin"
|
2019-07-25 14:36:05 +01:00
|
|
|
"SYSTEMD_DIR=$(out)/lib/systemd/system"
|
2015-12-09 19:02:37 +00:00
|
|
|
"MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
|
2017-07-19 13:59:40 +01:00
|
|
|
"STRIP="
|
2021-01-15 14:45:37 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2017-11-25 18:43:57 +00:00
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
2015-12-09 19:02:37 +00:00
|
|
|
];
|
|
|
|
|
2019-07-25 14:36:05 +01:00
|
|
|
installFlags = [ "install-systemd" ];
|
|
|
|
|
2019-07-25 14:29:39 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2012-12-28 18:20:09 +00:00
|
|
|
nativeBuildInputs = [ groff ];
|
2010-05-15 19:43:24 +01:00
|
|
|
|
2019-07-25 14:29:39 +01:00
|
|
|
postPatch = ''
|
2016-05-04 12:20:39 +01:00
|
|
|
sed -e 's@/lib/udev@''${out}/lib/udev@' \
|
|
|
|
-e 's@ -Werror @ @' \
|
2019-09-18 19:12:58 +01:00
|
|
|
-e 's@/usr/sbin/sendmail@${system-sendmail}/bin/sendmail@' -i Makefile
|
2019-07-25 14:29:39 +01:00
|
|
|
sed -i \
|
|
|
|
-e 's@/usr/bin/basename@${coreutils}/bin/basename@g' \
|
2020-11-24 15:29:28 +00:00
|
|
|
-e 's@BINDIR/blkid@${util-linux}/bin/blkid@g' \
|
2019-07-25 14:29:39 +01:00
|
|
|
*.rules
|
|
|
|
'';
|
|
|
|
|
|
|
|
# This is to avoid self-references, which causes the initrd to explode
|
|
|
|
# in size and in turn prevents mdraid systems from booting.
|
|
|
|
postFixup = ''
|
|
|
|
grep -r $out $out/bin && false || true
|
2015-12-09 19:02:37 +00:00
|
|
|
'';
|
2007-01-10 21:47:03 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2007-01-10 21:47:03 +00:00
|
|
|
description = "Programs for managing RAID arrays under Linux";
|
2020-04-01 02:11:51 +01:00
|
|
|
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;
|
2007-01-10 21:47:03 +00:00
|
|
|
};
|
|
|
|
}
|