diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix index a172e45e7faa..a464e7cbf715 100644 --- a/pkgs/os-specific/linux/libselinux/default.nix +++ b/pkgs/os-specific/linux/libselinux/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { version = "2.7"; inherit (libsepol) se_release se_url; + outputs = [ "bin" "out" "dev" "man" "py" ]; + src = fetchurl { url = "${se_url}/${se_release}/libselinux-${version}.tar.gz"; sha256 = "0mwcq78v6ngbq06xmb9dvilpg0jnl2vs9fgrpakhmmiskdvc1znh"; @@ -27,19 +29,19 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; - postPatch = optionalString enablePython '' - sed -i -e 's|\$(LIBDIR)/libsepol.a|${libsepol}/lib/libsepol.a|' src/Makefile - ''; + makeFlags = [ + "PREFIX=$(out)" + "INCDIR=$(dev)/include/selinux" + "INCLUDEDIR=$(dev)/include" + "MAN3DIR=$(man)/share/man/man3" + "MAN5DIR=$(man)/share/man/man5" + "MAN8DIR=$(man)/share/man/man8" + "PYSITEDIR=$(py)/${python.sitePackages}" + "SBINDIR=$(bin)/sbin" + "SHLIBDIR=$(out)/lib" - # fix install locations - preBuild = '' - makeFlagsArray+=("PREFIX=$out") - makeFlagsArray+=("DESTDIR=$out") - makeFlagsArray+=("MAN3DIR=$out/share/man/man3") - makeFlagsArray+=("MAN5DIR=$out/share/man/man5") - makeFlagsArray+=("MAN8DIR=$out/share/man/man8") - makeFlagsArray+=("PYSITEDIR=$out/lib/${python.libPrefix}/site-packages") - ''; + "LIBSEPOLA=${stdenv.lib.getLib libsepol}/lib/libsepol.a" + ]; installTargets = [ "install" ] ++ optional enablePython "install-pywrap";