libapparmor: Fix cross-compilation.

This commit is contained in:
Shea Levy 2018-02-25 09:38:55 -05:00
parent 42c8776571
commit e21300a6ae
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -8,6 +8,7 @@
, swig
, ncurses
, pam
, buildPackages
}:
let
@ -29,8 +30,8 @@ let
};
prePatchCommon = ''
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man"
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html"
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man"
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html"
substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"
substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man"
'';
@ -70,9 +71,10 @@ let
swig
ncurses
which
perl
];
buildInputs = [
buildInputs = stdenv.lib.optionals (!stdenv.isCross) [
perl
python
];
@ -87,11 +89,12 @@ let
inherit patches;
postPatch = "cd ./libraries/libapparmor";
configureFlags = "--with-python --with-perl";
# https://gitlab.com/apparmor/apparmor/issues/1
configureFlags = stdenv.lib.optionalString (!stdenv.isCross) "--with-python --with-perl";
outputs = [ "out" "python" ];
outputs = if stdenv.isCross then [ "out" ] else [ "out" "python" ];
postInstall = ''
postInstall = stdenv.lib.optionalString (!stdenv.isCross) ''
mkdir -p $python/lib
mv $out/lib/python* $python/lib/
'';