summary refs log tree commit diff
diff options
context:
space:
mode:
authorDan Peebles <pumpkin@me.com>2017-10-30 12:25:07 +0100
committerDan Peebles <pumpkin@me.com>2017-11-08 22:02:01 -0500
commitd61c612768b857a1b0f1d1c11a19d2d6df9d9761 (patch)
treedebc4ab1f4e31f1dfa5544d203050a46d2f1e0b9
parentee0c6293250c95ba1434c50d03632c6a424b3e63 (diff)
downloadnixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.tar
nixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.tar.gz
nixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.tar.bz2
nixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.tar.lz
nixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.tar.xz
nixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.tar.zst
nixlib-d61c612768b857a1b0f1d1c11a19d2d6df9d9761.zip
Fix sharutils tests in darwin sandbox
-rw-r--r--pkgs/tools/archivers/sharutils/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix
index 77ab8a1cb033..11072fc28dea 100644
--- a/pkgs/tools/archivers/sharutils/default.nix
+++ b/pkgs/tools/archivers/sharutils/default.nix
@@ -13,6 +13,16 @@ stdenv.mkDerivation rec {
   # GNU Gettext is needed on non-GNU platforms.
   buildInputs = [ coreutils gettext ];
 
+  # These tests try to hit /etc/passwd to find out your username if pass in a submitter
+  # name on the command line. Since we block access to /etc/passwd on the Darwin sandbox
+  # that cause shar to just segfault. It isn't a problem on Linux because their sandbox
+  # remaps /etc/passwd to a trivial file, but we can't do that on Darwin so I do this
+  # instead. In this case, I pass in the very imaginative "submitter" as the submitter name
+  patchPhase = ''
+    substituteInPlace tests/shar-1 --replace '$''\{SHAR}' '$''\{SHAR} -s submitter'
+    substituteInPlace tests/shar-2 --replace '$''\{SHAR}' '$''\{SHAR} -s submitter'
+  '';
+
   doCheck = true;
 
   crossAttrs = {