summary refs log tree commit diff
path: root/pkgs/os-specific/linux/apparmor
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-02-25 09:38:55 -0500
committerShea Levy <shea@shealevy.com>2018-02-25 09:38:55 -0500
commite21300a6ae8997895f2b902e52eef5f11c98ec8a (patch)
tree90955753b1f17397d6076aee1fa9f5a3130333d4 /pkgs/os-specific/linux/apparmor
parent42c87765713500722b12ca8eab72826d6b279802 (diff)
downloadnixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.tar
nixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.tar.gz
nixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.tar.bz2
nixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.tar.lz
nixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.tar.xz
nixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.tar.zst
nixpkgs-e21300a6ae8997895f2b902e52eef5f11c98ec8a.zip
libapparmor: Fix cross-compilation.
Diffstat (limited to 'pkgs/os-specific/linux/apparmor')
-rw-r--r--pkgs/os-specific/linux/apparmor/default.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix
index 0bb5561e957..c8e58dfbf6f 100644
--- a/pkgs/os-specific/linux/apparmor/default.nix
+++ b/pkgs/os-specific/linux/apparmor/default.nix
@@ -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/
     '';