mdadm: Clean up package expression.

Let's use makeFlags directly instead of stitching together a
makeFlagsArray in preBuild.

This should make the expression much more readable and clean.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-12-09 20:02:37 +01:00
parent bcd31d0acb
commit 5e227e6f1d
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -19,22 +19,21 @@ stdenv.mkDerivation rec {
patches = [ ./no-self-references.patch ];
makeFlags = [
"NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin"
"MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm"
] ++ stdenv.lib.optionals (stdenv ? cross) [
"CROSS_COMPILE=${stdenv.cross.config}-"
];
nativeBuildInputs = [ groff ];
# Attempt removing if building with gcc5 when updating
NIX_CFLAGS_COMPILE = "-std=gnu89";
preConfigure = "sed -e 's@/lib/udev@\${out}/lib/udev@' -e 's@ -Werror @ @' -i Makefile";
# Force mdadm to use /var/run/mdadm.map for its map file (or
# /dev/.mdadm/map as a fallback).
preBuild =
''
makeFlagsArray=(NIXOS=1 INSTALL=install INSTALL_BINDIR=$out/sbin MANDIR=$out/share/man RUN_DIR=/dev/.mdadm)
if [[ -n "$crossConfig" ]]; then
makeFlagsArray+=(CROSS_COMPILE=$crossConfig-)
fi
'';
preConfigure = ''
sed -e 's@/lib/udev@''${out}/lib/udev@' -e 's@ -Werror @ @' -i Makefile
'';
meta = {
description = "Programs for managing RAID arrays under Linux";