1{ stdenv, fetchurl, xz, coreutils ? null }:
2
3# Note: this package is used for bootstrapping fetchurl, and thus
4# cannot use fetchpatch! All mutable patches (generated by GitHub or
5# cgit) that are needed here should be included directly in Nixpkgs as
6# files.
7
8stdenv.mkDerivation rec {
9 name = "diffutils-3.7";
10
11 src = fetchurl {
12 url = "mirror://gnu/diffutils/${name}.tar.xz";
13 sha256 = "09isrg0isjinv8c535nxsi1s86wfdfzml80dbw41dj9x3hiad9xk";
14 };
15
16 outputs = [ "out" "info" ];
17
18 nativeBuildInputs = [ xz.bin ];
19 /* If no explicit coreutils is given, use the one from stdenv. */
20 buildInputs = [ coreutils ];
21
22 configureFlags =
23 # "pr" need not be on the PATH as a run-time dep, so we need to tell
24 # configure where it is. Covers the cross and native case alike.
25 stdenv.lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
26 ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes";
27
28 meta = with stdenv.lib; {
29 homepage = "https://www.gnu.org/software/diffutils/diffutils.html";
30 description = "Commands for showing the differences between files (diff, cmp, etc.)";
31 license = licenses.gpl3;
32 platforms = platforms.unix;
33 };
34}