nixpkgs-suyu/pkgs/os-specific/linux/checkpolicy/default.nix

33 lines
744 B
Nix
Raw Normal View History

2015-07-31 21:40:46 +02:00
{ stdenv, fetchurl, bison, flex, libsepol }:
2015-07-31 21:40:46 +02:00
stdenv.mkDerivation rec {
name = "checkpolicy-${version}";
2015-07-31 21:40:46 +02:00
version = "2.4";
inherit (libsepol) se_release se_url;
src = fetchurl {
url = "${se_url}/${se_release}/checkpolicy-${version}.tar.gz";
2015-07-31 21:40:46 +02:00
sha256 = "1m5wjm43lzp6bld8higsvdm2dkddydihhwv9qw2w9r4dm0largcv";
};
2015-07-31 21:40:46 +02:00
nativeBuildInputs = [ bison flex ];
buildInputs = [ libsepol ];
2015-07-31 22:02:41 +02:00
NIX_CFLAGS_COMPILE = "-fstack-protector-all";
2015-07-31 21:40:46 +02:00
# Don't build tests
postPatch = ''
sed -i '/-C test/d' Makefile
'';
preBuild = ''
2015-07-31 21:40:46 +02:00
makeFlagsArray+=("LEX=flex")
makeFlagsArray+=("LIBDIR=${libsepol}/lib")
makeFlagsArray+=("PREFIX=$out")
'';
2015-07-31 21:40:46 +02:00
meta = libsepol.meta // {
description = "SELinux policy compiler";
};
}