From af9f765b1f5f4243a0b1b247e66de4849705225c Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 21 Jun 2018 11:48:33 +0200 Subject: [PATCH] libselinux: split package --- pkgs/os-specific/linux/libselinux/default.nix | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) 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";