1 { lib, stdenv, fetchurl, flex }:
3 stdenv.mkDerivation rec {
6 se_url = "https://github.com/SELinuxProject/selinux/releases/download";
8 outputs = [ "bin" "out" "dev" "man" ];
11 url = "${se_url}/${version}/libsepol-${version}.tar.gz";
12 sha256 = "sha256-zXQeJSROfvbNk01jNhQTGiZsPq6rM9i/pF6Kk7RcyQE=";
15 postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
16 substituteInPlace src/Makefile --replace 'all: $(LIBA) $(LIBSO)' 'all: $(LIBA)'
17 sed -i $'/^\t.*LIBSO/d' src/Makefile
20 nativeBuildInputs = [ flex ];
25 "INCDIR=$(dev)/include/sepol"
26 "INCLUDEDIR=$(dev)/include"
27 "MAN3DIR=$(man)/share/man/man3"
28 "MAN8DIR=$(man)/share/man/man8"
32 env.NIX_CFLAGS_COMPILE = "-Wno-error";
34 enableParallelBuilding = true;
36 passthru = { inherit se_url; };
39 description = "SELinux binary policy manipulation library";
40 homepage = "http://userspace.selinuxproject.org";
41 platforms = platforms.linux;
42 maintainers = with maintainers; [ RossComputerGuy ];
43 license = lib.licenses.gpl2Plus;
44 pkgConfigModules = [ "libselinux" ];