From ac951a6469d3cbf7acd0a43e5bc19bbb91e9093e Mon Sep 17 00:00:00 2001 From: Evgeny Egorochkin Date: Sun, 27 Mar 2011 04:46:25 +0000 Subject: [PATCH] coreutils: add SELinux support svn path=/nixpkgs/trunk/; revision=26543 --- pkgs/tools/misc/coreutils/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 21ce92150176..c4295e7b47a8 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -1,8 +1,11 @@ -{ stdenv, fetchurl, aclSupport ? false, acl ? null, perl, gmp ? null}: +{ stdenv, fetchurl, perl, gmp ? null +, aclSupport ? false, acl ? null +, selinuxSupport? false, libselinux ? null, libsepol ? null }: assert aclSupport -> acl != null; +assert selinuxSupport -> ( (libselinux != null) && (libsepol != null) ); -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { name = "coreutils-8.7"; src = fetchurl { @@ -11,11 +14,16 @@ stdenv.mkDerivation rec { }; buildNativeInputs = [ perl ]; - buildInputs = [ gmp ] ++ stdenv.lib.optional aclSupport acl; + buildInputs = [ gmp ] + ++ stdenv.lib.optional aclSupport acl + ++ stdenv.lib.optional selinuxSupport libselinux + ++ stdenv.lib.optional selinuxSupport libsepol; crossAttrs = { buildInputs = [ gmp ] ++ stdenv.lib.optional aclSupport acl.hostDrv + ++ stdenv.lib.optional selinuxSupport libselinux.hostDrv + ++ stdenv.lib.optional selinuxSupport libsepol.hostDrv ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv) stdenv.gccCross.libc.libiconv.hostDrv; @@ -48,4 +56,5 @@ stdenv.mkDerivation rec { maintainers = [ stdenv.lib.maintainers.ludo ]; }; -} +} // (if selinuxSupport then { NIX_LDFLAGS = "-lsepol"; } else { } ) ) +