Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 fetchFromGitHub, 4 python3Packages, 5 libsepol, 6 libselinux, 7 checkpolicy, 8 withGraphics ? false, 9}: 10 11python3Packages.buildPythonApplication rec { 12 pname = "setools"; 13 version = "4.5.1"; 14 pyproject = true; 15 16 src = fetchFromGitHub { 17 owner = "SELinuxProject"; 18 repo = "setools"; 19 tag = version; 20 hash = "sha256-/6dOzSz2Do4d6TSS50fuak0CysoQ532zJ0bJ532BUCE="; 21 }; 22 23 build-system = with python3Packages; [ 24 cython 25 setuptools 26 ]; 27 28 buildInputs = [ libsepol ]; 29 30 dependencies = 31 with python3Packages; 32 [ 33 libselinux 34 setuptools 35 ] 36 ++ lib.optionals withGraphics [ pyqt5 ]; 37 38 optional-dependencies = { 39 analysis = with python3Packages; [ 40 networkx 41 pygraphviz 42 ]; 43 }; 44 45 nativeCheckInputs = [ 46 python3Packages.tox 47 checkpolicy 48 ]; 49 50 setupPyBuildFlags = [ "-i" ]; 51 52 preBuild = '' 53 export SEPOL="${lib.getLib libsepol}/lib/libsepol.a" 54 ''; 55 56 preCheck = '' 57 export CHECKPOLICY=${lib.getExe checkpolicy} 58 ''; 59 60 meta = { 61 description = "SELinux Policy Analysis Tools"; 62 homepage = "https://github.com/SELinuxProject/setools"; 63 changelog = "https://github.com/SELinuxProject/setools/blob/${version}/ChangeLog"; 64 license = with lib.licenses; [ 65 gpl2Only 66 lgpl21Plus 67 ]; 68 maintainers = [ ]; 69 platforms = lib.platforms.linux; 70 }; 71}