Simplify FORCE_UNSAFE_CONFIGURE by making it an optional string.

postInstall references ${self} and requires self to be a derivation.
This commit is contained in:
Danny Wilson 2015-11-17 18:28:51 +01:00
parent 62ff7367d5
commit 590eec7945

View File

@ -11,7 +11,7 @@ assert selinuxSupport -> libselinux != null && libsepol != null;
with { inherit (stdenv.lib) optional optionals optionalString optionalAttrs; }; with { inherit (stdenv.lib) optional optionals optionalString optionalAttrs; };
let let
self = rec { self = stdenv.mkDerivation rec {
name = "coreutils-8.24"; name = "coreutils-8.24";
src = fetchurl { src = fetchurl {
@ -82,6 +82,7 @@ let
enableParallelBuilding = false; enableParallelBuilding = false;
NIX_LDFLAGS = optionalString selinuxSupport "-lsepol"; NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1";
makeFlags = optionalString stdenv.isDarwin "CFLAGS=-D_FORTIFY_SOURCE=0"; makeFlags = optionalString stdenv.isDarwin "CFLAGS=-D_FORTIFY_SOURCE=0";
@ -104,7 +105,4 @@ let
}; };
}; };
in in
stdenv.mkDerivation (self self;
// stdenv.lib.optionalAttrs (stdenv.system == "armv7l-linux" || stdenv.isSunOS) {
FORCE_UNSAFE_CONFIGURE = 1;
})