Skip to content

Commit

Permalink
Fix sharutils tests in darwin sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
copumpkin committed Nov 9, 2017
1 parent ee0c629 commit d61c612
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkgs/tools/archivers/sharutils/default.nix
Expand Up @@ -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 = {
Expand Down

0 comments on commit d61c612

Please sign in to comment.