1 { lib, stdenv, fetchurl
5 # Note: this package is used for bootstrapping fetchurl, and thus
6 # cannot use fetchpatch! All mutable patches (generated by GitHub or
7 # cgit) that are needed here should be included directly in Nixpkgs as
10 stdenv.mkDerivation rec {
15 url = "mirror://gnu/findutils/${pname}-${version}.tar.xz";
16 sha256 = "sha256-or+4wJ1DZ3DtxZ9Q+kg+eFsWGjt7nVR1c8sIBl/UYv4=";
20 substituteInPlace xargs/xargs.c --replace 'char default_cmd[] = "echo";' 'char default_cmd[] = "${coreutils}/bin/echo";'
23 patches = [ ./no-install-statedir.patch ];
25 buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort
27 # Since glibc-2.25 the i686 tests hang reliably right after test-sleep.
29 = !stdenv.hostPlatform.isDarwin
30 && !(stdenv.hostPlatform.libc == "glibc" && stdenv.hostPlatform.isi686)
31 && (stdenv.hostPlatform.libc != "musl")
32 && stdenv.hostPlatform == stdenv.buildPlatform;
34 outputs = [ "out" "info" "locate"];
37 # "sort" need not be on the PATH as a run-time dep, so we need to tell
38 # configure where it is. Covers the cross and native case alike.
39 "SORT=${coreutils}/bin/sort"
40 "--localstatedir=/var/cache"
43 CFLAGS = lib.optionals stdenv.isDarwin [
44 # TODO: Revisit upstream issue https://savannah.gnu.org/bugs/?59972
45 # https://github.com/Homebrew/homebrew-core/pull/69761#issuecomment-770268478
46 "-D__nonnull\\(params\\)="
50 moveToOutput bin/locate $locate
51 moveToOutput bin/updatedb $locate
54 # can't move man pages in postInstall because the multi-output hook will move them back to $out
56 moveToOutput share/man/man5 $locate
57 moveToOutput share/man/man1/locate.1.gz $locate
58 moveToOutput share/man/man1/updatedb.1.gz $locate
61 enableParallelBuilding = true;
64 homepage = "https://www.gnu.org/software/findutils/";
65 description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system";
68 The GNU Find Utilities are the basic directory searching
69 utilities of the GNU operating system. These programs are
70 typically used in conjunction with other programs to provide
71 modular and powerful directory search and file locating
72 capabilities to other commands.
74 The tools supplied with this package are:
76 * find - search for files in a directory hierarchy;
77 * xargs - build and execute command lines from standard input.
79 The following are available in the locate output:
81 * locate - list files in databases that match a pattern;
82 * updatedb - update a file name database;
85 platforms = lib.platforms.all;
87 license = lib.licenses.gpl3Plus;