1{ lib, 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 pname = "diffutils";
10 version = "3.8";
11
12 src = fetchurl {
13 url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz";
14 sha256 = "sha256-pr3X0bMSZtEcT03mwbdI1GB6sCMa9RiPwlM9CuJDj+w=";
15 };
16
17 outputs = [ "out" "info" ];
18
19 nativeBuildInputs = [ xz.bin ];
20 /* If no explicit coreutils is given, use the one from stdenv. */
21 buildInputs = [ coreutils ];
22
23 configureFlags =
24 # "pr" need not be on the PATH as a run-time dep, so we need to tell
25 # configure where it is. Covers the cross and native case alike.
26 lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
27 ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes";
28
29 meta = with lib; {
30 homepage = "https://www.gnu.org/software/diffutils/diffutils.html";
31 description = "Commands for showing the differences between files (diff, cmp, etc.)";
32 license = licenses.gpl3;
33 platforms = platforms.unix;
34 };
35}