From 0db68e5d42c4426ccc2933e982836cba0bef0b48 Mon Sep 17 00:00:00 2001 From: corpix Date: Sat, 20 Jan 2018 08:29:03 +0000 Subject: [PATCH] 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 --- pkgs/os-specific/linux/apparmor/default.nix | 46 +++++++++++++++++---- pkgs/top-level/all-packages.nix | 5 ++- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index b026e91cc0bf..29e1357d38a8 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -2,14 +2,15 @@ , pkgconfig, which , flex, bison , linuxHeaders ? stdenv.cc.libc.linuxHeaders -, pythonPackages +, python +, gawk , perl , swig +, ncurses , pam }: let - apparmor-series = "2.12"; apparmor-patchver = "0"; apparmor-version = apparmor-series + "." + apparmor-patchver; @@ -46,12 +47,13 @@ let flex pkgconfig swig + ncurses which ]; buildInputs = [ perl - pythonPackages.python + python ]; # 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.in --replace "/usr/include/netinet/in.h" "${stdenv.cc.libc.dev}/include/netinet/in.h" ''; - postPatch = "cd ./libraries/libapparmor"; configureFlags = "--with-python --with-perl"; @@ -83,7 +84,7 @@ let buildInputs = [ perl - pythonPackages.python + python libapparmor libapparmor.python ]; @@ -95,7 +96,7 @@ let 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 - 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 for prog in aa-notify ; do @@ -106,6 +107,29 @@ let 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 { name = "apparmor-parser-${apparmor-version}"; src = apparmor-sources; @@ -172,6 +196,12 @@ let in { - inherit libapparmor apparmor-utils apparmor-parser apparmor-pam - apparmor-profiles apparmor-kernel-patches; + inherit + libapparmor + apparmor-utils + apparmor-bin-utils + apparmor-parser + apparmor-pam + apparmor-profiles + apparmor-kernel-patches; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a36547af80dd..be045e1189c8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12499,8 +12499,9 @@ with pkgs; microcodeIntel = callPackage ../os-specific/linux/microcode/intel.nix { }; - inherit (callPackages ../os-specific/linux/apparmor { pythonPackages = python27Packages; swig = swig2; }) - libapparmor apparmor-pam apparmor-parser apparmor-profiles apparmor-utils; + inherit (callPackages ../os-specific/linux/apparmor { python = python3; }) + libapparmor apparmor-utils apparmor-bin-utils apparmor-parser apparmor-pam + apparmor-profiles apparmor-kernel-patches; atop = callPackage ../os-specific/linux/atop { };