about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/paxctl/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/paxctl/default.nix')
-rw-r--r--pkgs/os-specific/linux/paxctl/default.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/paxctl/default.nix b/pkgs/os-specific/linux/paxctl/default.nix
index 270be695f03a..52e4c512f9a2 100644
--- a/pkgs/os-specific/linux/paxctl/default.nix
+++ b/pkgs/os-specific/linux/paxctl/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv }:
+{ fetchurl, stdenv, elf-header }:
 
 stdenv.mkDerivation rec {
   name = "paxctl-${version}";
@@ -9,7 +9,17 @@ stdenv.mkDerivation rec {
     sha256 = "0biw882fp1lmgs6kpxznp1v6758r7dg9x8iv5a06k0b82bcdsc53";
   };
 
-  preBuild = ''
+  # TODO Always do first way next mass rebuild.
+  buildInputs = stdenv.lib.optional
+    (!stdenv.hostPlatform.isLinux || !stdenv.buildPlatform.isLinux)
+    elf-header;
+
+  # TODO Always do first way next mass rebuild.
+  preBuild = if !stdenv.hostPlatform.isLinux || !stdenv.buildPlatform.isLinux then ''
+    sed -i Makefile \
+      -e 's|--owner 0 --group 0||g' \
+      -e '/CC:=gcc/d'
+  '' else ''
     sed "s|--owner 0 --group 0||g" -i Makefile
   '';
 
@@ -24,7 +34,7 @@ stdenv.mkDerivation rec {
     description = "A tool for controlling PaX flags on a per binary basis";
     homepage    = "https://pax.grsecurity.net";
     license     = licenses.gpl2;
-    platforms   = platforms.linux;
+    platforms   = platforms.all;
     maintainers = with maintainers; [ thoughtpolice ];
   };
 }