e755a8a27d
Certain tools, e.g. compilers, are customarily prefixed with the name of their target platform so that multiple builds can be used at once without clobbering each other on the PATH. I was using identifiers named `prefix` for this purpose, but that conflicts with the standard use of `prefix` to mean the directory where something is installed. To avoid conflict and confusion, I renamed those to `targetPrefix`.
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ stdenv
|
|
, fetchurl, groff
|
|
, buildPlatform, hostPlatform
|
|
}:
|
|
|
|
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"
|
|
"STRIP="
|
|
] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
];
|
|
|
|
nativeBuildInputs = [ groff ];
|
|
|
|
preConfigure = ''
|
|
sed -e 's@/lib/udev@''${out}/lib/udev@' \
|
|
-e 's@ -Werror @ @' \
|
|
-e 's@/usr/sbin/sendmail@/run/wrappers/bin/sendmail@' -i Makefile
|
|
'';
|
|
|
|
meta = {
|
|
description = "Programs for managing RAID arrays under Linux";
|
|
homepage = http://neil.brown.name/blog/mdadm;
|
|
platforms = stdenv.lib.platforms.linux;
|
|
};
|
|
}
|