git.iko.soy/typeable/nixpkgs
on master help sign in
libselinux: 2.4 -> 2.7
commitea7507b9dc990814ca6d69997add7fe7c9e36f7b authorxeji <xeji@cat3.de> dateWed 14 Mar 2018, 13:25 (9 years ago) parent880d8c1
1 file changed+11−25
pkgs/os-specific/linux/libselinux/default.nix+11−25
pkgs/os-specific/linux/libselinux/default.nix+11−25
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, fetchpatch, pkgconfig, libsepol, pcre
1+{ stdenv, fetchurl, pcre, pkgconfig, libsepol
22, enablePython ? true, swig ? null, python ? null
33}:
44
@@ -8,48 +8,34 @@ with stdenv.lib;
88
99stdenv.mkDerivation rec {
1010 name = "libselinux-${version}";
11− version = "2.4";
11+ version = "2.7";
1212 inherit (libsepol) se_release se_url;
1313
1414 src = fetchurl {
1515 url = "${se_url}/${se_release}/libselinux-${version}.tar.gz";
16− sha256 = "0yqg73ns97jwjh1iyv0jr5qxb8k5sqq5ywfkx11lzfn5yj8k0126";
16+ sha256 = "0mwcq78v6ngbq06xmb9dvilpg0jnl2vs9fgrpakhmmiskdvc1znh";
1717 };
1818
1919 nativeBuildInputs = [ pkgconfig ];
2020 buildInputs = [ libsepol pcre ]
2121 ++ optionals enablePython [ swig python ];
2222
23− # Avoid this false warning:
24− # avc_internal.c: In function 'avc_netlink_receive':
25− # avc_internal.c:105:25: error: cast increases required alignment of target type [-Werror=cast-align]
26− # struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
27− # ^
28−
29− NIX_CFLAGS_COMPILE = "-std=gnu89 -Wno-error=cast-align";
30−
31− # Unreleased upstream patch that fixes Python package issue arising
32− # from recent SWIG changes.
33− patches = optional enablePython (fetchpatch {
34− name = "fix-python-swig.patch";
35− url = "https://github.com/SELinuxProject/selinux/commit/a9604c30a5e2f71007d31aa6ba41cf7b95d94822.patch";
36− sha256 = "0mjrclh0sd8m7vq0wvl6pg29ss415j3kn0266v8ixy4fprafagfp";
37− stripLen = 1;
38− });
23+ # drop fortify here since package uses it by default, leading to compile error:
24+ # command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
25+ hardeningDisable = [ "fortify" ];
3926
4027 postPatch = optionalString enablePython ''
4128 sed -i -e 's|\$(LIBDIR)/libsepol.a|${libsepol}/lib/libsepol.a|' src/Makefile
42− ''
43− + ''
44− sed '1i#include <sys/uio.h>' -i src/setrans_client.c
4529 '';
4630
31+ # fix install locations
4732 preBuild = ''
48− # Build fails without this precreated
49− mkdir -p $out/include
50−
5133 makeFlagsArray+=("PREFIX=$out")
5234 makeFlagsArray+=("DESTDIR=$out")
35+ makeFlagsArray+=("MAN3DIR=$out/share/man/man3")
36+ makeFlagsArray+=("MAN5DIR=$out/share/man/man5")
37+ makeFlagsArray+=("MAN8DIR=$out/share/man/man8")
38+ makeFlagsArray+=("PYSITEDIR=$out/lib/python2.7/site-packages")
5339 '';
5440
5541 installTargets = [ "install" ] ++ optional enablePython "install-pywrap";