summary refs log tree commit diff
path: root/pkgs/os-specific/linux/checkpolicy/default.nix
blob: 6ea73c9ac6c324d5d5d2b9d87778693a82247a46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ stdenv, fetchurl, bison, flex, libsepol }:

stdenv.mkDerivation rec {
  name = "checkpolicy-${version}";
  version = "2.7";
  inherit (libsepol) se_release se_url;

  src = fetchurl {
    url = "${se_url}/${se_release}/checkpolicy-${version}.tar.gz";
    sha256 = "009j9jc0hi4l7k8f21hn8fm25n0mqgzdpd4nk30nds6d3nglf4sl";
  };

  nativeBuildInputs = [ bison flex ];
  buildInputs = [ libsepol ];

  preBuild = ''
    makeFlagsArray+=("LIBDIR=${libsepol}/lib")
    makeFlagsArray+=("PREFIX=$out")
  '';

  meta = libsepol.meta // {
    description = "SELinux policy compiler";
  };
}