summary refs log tree commit diff
path: root/pkgs/os-specific/linux/libsemanage/default.nix
blob: 587349e4067e8fd12e7417511bc7a6ad1f979d39 (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
25
26
27
28
29
30
31
32
33
{ stdenv, fetchurl, bison, flex, libsepol, libselinux, ustr, bzip2, libaudit }:

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

  src = fetchurl {
    url = "${se_url}/${se_release}/libsemanage-${version}.tar.gz";
    sha256 = "1134ka4mi4387ac5yv68bpp2y7ln5xxhwp07xhqnay0nxzjaqk0s";
  };

  nativeBuildInputs = [ bison flex ];
  buildInputs = [ libsepol libselinux ustr bzip2 libaudit ];

  NIX_CFLAGS_COMPILE = [
    "-fstack-protector-all"
    "-std=gnu89"
    # these were added to fix build with gcc7. review on update
    "-Wno-error=format-truncation"
    "-Wno-error=implicit-fallthrough"
  ];

  preBuild = ''
    makeFlagsArray+=("PREFIX=$out")
    makeFlagsArray+=("DESTDIR=$out")
  '';

  meta = libsepol.meta // {
    description = "Policy management tools for SELinux";
    license = stdenv.lib.licenses.lgpl21;
  };
}