Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pkgs/tools/text/gnugrep/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ stdenv.mkDerivation {
hash = "sha256-HbKu3eidDepCsW2VKPiUyNFdrk4ZC1muzHj1qVEnbqs=";
};

# Some gnulib tests fail on Musl: https://github.com/NixOS/nixpkgs/pull/228714
postPatch = if stdenv.hostPlatform.isMusl then ''
# Some gnulib tests fail
# - on Musl: https://github.com/NixOS/nixpkgs/pull/228714
# - on x86_64-darwin: https://github.com/NixOS/nixpkgs/pull/228714#issuecomment-1576826330
postPatch = if stdenv.hostPlatform.isMusl || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) then ''
sed -i 's:gnulib-tests::g' Makefile.in
'' else null;

Expand All @@ -28,14 +30,17 @@ stdenv.mkDerivation {

# cygwin: FAIL: multibyte-white-space
# freebsd: FAIL mb-non-UTF8-performance
doCheck = !stdenv.isCygwin && !stdenv.isFreeBSD;
# x86_64-darwin: fails 'stack-overflow' tests on Rosetta 2 emulator
doCheck = !stdenv.isCygwin && !stdenv.isFreeBSD && !(stdenv.isDarwin && stdenv.hostPlatform.isx86_64);

# On macOS, force use of mkdir -p, since Grep's fallback
# (./install-sh) is broken.
preConfigure = ''
export MKDIR_P="mkdir -p"
'';

enableParallelBuilding = true;

# Fix reference to sh in bootstrap-tools, and invoke grep via
# absolute path rather than looking at argv[0].
postInstall =
Expand Down