libselinux: split package

This commit is contained in:
Jan Tojnar 2018-06-21 11:48:33 +02:00
parent 84fc0622cf
commit af9f765b1f
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -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";