3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/selinux-python/default.nix

52 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-15 14:45:37 +00:00
{ lib, stdenv, fetchurl, python3
, libselinux, libsemanage, libsepol, setools }:
# this is python3 only because setools only supports python3
2021-01-15 14:45:37 +00:00
with lib;
stdenv.mkDerivation rec {
pname = "selinux-python";
version = "3.3";
2019-08-17 17:13:30 +01:00
inherit (libsepol) se_url;
src = fetchurl {
url = "${se_url}/${version}/selinux-python-${version}.tar.gz";
sha256 = "1v244hpb45my303793xa4kcn7qnxjgxn4ja7rdn9k1q361hi1nca";
};
2021-11-12 11:28:15 +00:00
strictDeps = true;
nativeBuildInputs = [ python3 python3.pkgs.wrapPython ];
buildInputs = [ libsepol ];
propagatedBuildInputs = [ libselinux libsemanage setools python3.pkgs.ipy ];
postPatch = ''
substituteInPlace sepolicy/Makefile --replace "echo --root" "echo --prefix"
2019-08-17 17:13:30 +01:00
substituteInPlace sepolgen/src/share/Makefile --replace "/var/lib/sepolgen" \
"\$PREFIX/var/lib/sepolgen"
'';
2019-08-17 17:13:30 +01:00
makeFlags = [
"PREFIX=$(out)"
"LOCALEDIR=$(out)/share/locale"
"BASHCOMPLETIONDIR=$(out)/share/bash-completion/completions"
"PYTHON=python"
2021-11-12 11:28:15 +00:00
"PYTHONLIBDIR=$(out)/${python3.sitePackages}"
2021-01-15 14:45:37 +00:00
"LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a"
2019-08-17 17:13:30 +01:00
];
postFixup = ''
wrapPythonPrograms
'';
meta = {
description = "SELinux policy core utilities written in Python";
license = licenses.gpl2;
homepage = "https://selinuxproject.org";
platforms = platforms.linux;
};
}