1 { lib, stdenv, fetchurl, python3
2 , libselinux, libsemanage, libsepol, setools }:
4 # this is python3 only because setools only supports python3
5 stdenv.mkDerivation rec {
6 pname = "selinux-python";
9 inherit (libsepol) se_url;
12 url = "${se_url}/${version}/selinux-python-${version}.tar.gz";
13 sha256 = "1v244hpb45my303793xa4kcn7qnxjgxn4ja7rdn9k1q361hi1nca";
18 nativeBuildInputs = [ python3 python3.pkgs.wrapPython ];
19 buildInputs = [ libsepol ];
20 propagatedBuildInputs = [ libselinux libsemanage setools python3.pkgs.ipy ];
23 substituteInPlace sepolicy/Makefile --replace "echo --root" "echo --prefix"
24 substituteInPlace sepolgen/src/share/Makefile --replace "/var/lib/sepolgen" \
25 "\$PREFIX/var/lib/sepolgen"
30 "LOCALEDIR=$(out)/share/locale"
31 "BASHCOMPLETIONDIR=$(out)/share/bash-completion/completions"
33 "PYTHONLIBDIR=$(out)/${python3.sitePackages}"
34 "LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a"
43 description = "SELinux policy core utilities written in Python";
44 license = licenses.gpl2Plus;
45 homepage = "https://selinuxproject.org";
46 maintainers = with lib.maintainers; [ RossComputerGuy ];
47 platforms = platforms.linux;