forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / se / selinux-python / package.nix
blobc2d91104bf4f531c15f1d6f88121ed9f94b0e490
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";
7   version = "3.3";
9   inherit (libsepol) se_url;
11   src = fetchurl {
12     url = "${se_url}/${version}/selinux-python-${version}.tar.gz";
13     sha256 = "1v244hpb45my303793xa4kcn7qnxjgxn4ja7rdn9k1q361hi1nca";
14   };
16   strictDeps = true;
18   nativeBuildInputs = [ python3 python3.pkgs.wrapPython ];
19   buildInputs = [ libsepol ];
20   propagatedBuildInputs = [ libselinux libsemanage setools python3.pkgs.ipy ];
22   postPatch = ''
23     substituteInPlace sepolicy/Makefile --replace "echo --root" "echo --prefix"
24     substituteInPlace sepolgen/src/share/Makefile --replace "/var/lib/sepolgen" \
25                                                             "\$PREFIX/var/lib/sepolgen"
26   '';
28   makeFlags = [
29     "PREFIX=$(out)"
30     "LOCALEDIR=$(out)/share/locale"
31     "BASHCOMPLETIONDIR=$(out)/share/bash-completion/completions"
32     "PYTHON=python"
33     "PYTHONLIBDIR=$(out)/${python3.sitePackages}"
34     "LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a"
35   ];
38   postFixup = ''
39     wrapPythonPrograms
40   '';
42   meta = with lib; {
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;
48   };