Skip to content

Commit

Permalink
Merge pull request #236229 from trofi/gnugrep-parallel
Browse files Browse the repository at this point in the history
gnugrep: enable parallel build and tests
  • Loading branch information
trofi authored Jun 11, 2023
2 parents b7d4899 + bf442ea commit a4d88ee
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit a4d88ee

Please sign in to comment.