571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
40 lines
1021 B
Nix
40 lines
1021 B
Nix
{ lib, fetchFromGitHub, python3
|
|
, libsepol, libselinux, checkpolicy
|
|
, withGraphics ? false
|
|
}:
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
pname = "setools";
|
|
version = "4.5.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "SELinuxProject";
|
|
repo = pname;
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-/6dOzSz2Do4d6TSS50fuak0CysoQ532zJ0bJ532BUCE=";
|
|
};
|
|
|
|
nativeBuildInputs = [ python3.pkgs.cython ];
|
|
buildInputs = [ libsepol ];
|
|
propagatedBuildInputs = with python3.pkgs; [ enum34 libselinux networkx setuptools ]
|
|
++ lib.optionals withGraphics [ pyqt5 ];
|
|
|
|
nativeCheckInputs = [ python3.pkgs.tox checkpolicy ];
|
|
preCheck = ''
|
|
export CHECKPOLICY=${checkpolicy}/bin/checkpolicy
|
|
'';
|
|
|
|
setupPyBuildFlags = [ "-i" ];
|
|
|
|
preBuild = ''
|
|
export SEPOL="${lib.getLib libsepol}/lib/libsepol.a"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "SELinux Policy Analysis Tools";
|
|
homepage = "https://github.com/SELinuxProject/setools";
|
|
license = licenses.gpl2Only;
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|