apparmor: updating utilities to fresh python (#34049)

* apparmor: updating utilities to fresh python

* apparmor: better way to depend on python

* apparmor: override python derivation on the top-level
This commit is contained in:
corpix 2018-01-20 08:29:03 +00:00 committed by Frederik Rietdijk
parent b86412d042
commit 0db68e5d42
2 changed files with 41 additions and 10 deletions

View File

@ -2,14 +2,15 @@
, pkgconfig, which , pkgconfig, which
, flex, bison , flex, bison
, linuxHeaders ? stdenv.cc.libc.linuxHeaders , linuxHeaders ? stdenv.cc.libc.linuxHeaders
, pythonPackages , python
, gawk
, perl , perl
, swig , swig
, ncurses
, pam , pam
}: }:
let let
apparmor-series = "2.12"; apparmor-series = "2.12";
apparmor-patchver = "0"; apparmor-patchver = "0";
apparmor-version = apparmor-series + "." + apparmor-patchver; apparmor-version = apparmor-series + "." + apparmor-patchver;
@ -46,12 +47,13 @@ let
flex flex
pkgconfig pkgconfig
swig swig
ncurses
which which
]; ];
buildInputs = [ buildInputs = [
perl perl
pythonPackages.python python
]; ];
# required to build apparmor-parser # required to build apparmor-parser
@ -61,7 +63,6 @@ let
substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h" substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h"
substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h" substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h"
''; '';
postPatch = "cd ./libraries/libapparmor"; postPatch = "cd ./libraries/libapparmor";
configureFlags = "--with-python --with-perl"; configureFlags = "--with-python --with-perl";
@ -83,7 +84,7 @@ let
buildInputs = [ buildInputs = [
perl perl
pythonPackages.python python
libapparmor libapparmor
libapparmor.python libapparmor.python
]; ];
@ -95,7 +96,7 @@ let
postInstall = '' postInstall = ''
for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-status aa-unconfined ; do for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-status aa-unconfined ; do
wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${pythonPackages.python.libPrefix}/site-packages:$PYTHONPATH" wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
done done
for prog in aa-notify ; do for prog in aa-notify ; do
@ -106,6 +107,29 @@ let
meta = apparmor-meta "user-land utilities"; meta = apparmor-meta "user-land utilities";
}; };
apparmor-bin-utils = stdenv.mkDerivation {
name = "apparmor-bin-utils-${apparmor-version}";
src = apparmor-sources;
nativeBuildInputs = [
pkgconfig
libapparmor
gawk
which
];
buildInputs = [
libapparmor
];
prePatch = prePatchCommon;
postPatch = "cd ./binutils";
makeFlags = ''LANGS= USE_SYSTEM=1'';
installFlags = ''DESTDIR=$(out) BINDIR=$(out)/bin'';
meta = apparmor-meta "binary user-land utilities";
};
apparmor-parser = stdenv.mkDerivation { apparmor-parser = stdenv.mkDerivation {
name = "apparmor-parser-${apparmor-version}"; name = "apparmor-parser-${apparmor-version}";
src = apparmor-sources; src = apparmor-sources;
@ -172,6 +196,12 @@ let
in in
{ {
inherit libapparmor apparmor-utils apparmor-parser apparmor-pam inherit
apparmor-profiles apparmor-kernel-patches; libapparmor
apparmor-utils
apparmor-bin-utils
apparmor-parser
apparmor-pam
apparmor-profiles
apparmor-kernel-patches;
} }

View File

@ -12499,8 +12499,9 @@ with pkgs;
microcodeIntel = callPackage ../os-specific/linux/microcode/intel.nix { }; microcodeIntel = callPackage ../os-specific/linux/microcode/intel.nix { };
inherit (callPackages ../os-specific/linux/apparmor { pythonPackages = python27Packages; swig = swig2; }) inherit (callPackages ../os-specific/linux/apparmor { python = python3; })
libapparmor apparmor-pam apparmor-parser apparmor-profiles apparmor-utils; libapparmor apparmor-utils apparmor-bin-utils apparmor-parser apparmor-pam
apparmor-profiles apparmor-kernel-patches;
atop = callPackage ../os-specific/linux/atop { }; atop = callPackage ../os-specific/linux/atop { };