summary refs log tree commit diff
path: root/pkgs/os-specific/linux/apparmor
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-01 17:51:21 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-01 18:57:43 +0200
commite05c4c654108dbac59ac5f856af02dfcd20442fc (patch)
treeed4f6b5f0f8c461cf7cb98eb3f6edc94b8ca5e93 /pkgs/os-specific/linux/apparmor
parentcf26f610aa56269ac9c73096c351b77aac00a74d (diff)
downloadnixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.tar
nixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.tar.gz
nixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.tar.bz2
nixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.tar.lz
nixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.tar.xz
nixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.tar.zst
nixlib-e05c4c654108dbac59ac5f856af02dfcd20442fc.zip
libapparmor: Move python stuff to a separate output
This prevents systemd and by extension a zillion other packages from
having Python 2.7 in their closure. For example, the closure of
systemd dropped from 133 MiB to 85 MiB.
Diffstat (limited to 'pkgs/os-specific/linux/apparmor')
-rw-r--r--pkgs/os-specific/linux/apparmor/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix
index f90601073406..f58a7557ce35 100644
--- a/pkgs/os-specific/linux/apparmor/default.nix
+++ b/pkgs/os-specific/linux/apparmor/default.nix
@@ -32,6 +32,8 @@ let
     substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man"
   '';
 
+  # FIXME: convert these to a single multiple-outputs package?
+
   libapparmor = stdenv.mkDerivation {
     name = "libapparmor-${apparmor-version}";
     src = apparmor-sources;
@@ -61,6 +63,13 @@ let
     postPatch = "cd ./libraries/libapparmor";
     configureFlags = "--with-python --with-perl";
 
+    outputs = [ "out" "python" ];
+
+    postInstall = ''
+      mkdir -p $python/lib
+      mv $out/lib/python* $python/lib/
+    '';
+
     meta = apparmor-meta "library";
   };
 
@@ -75,6 +84,7 @@ let
       pythonPackages.python
       pythonPackages.readline
       libapparmor
+      libapparmor.python
     ];
 
     prePatch = prePatchCommon;