2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, xz, coreutils ? null }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "diffutils";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "3.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-05-20 23:08:51 +00:00
|
|
|
url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-kOXpPMck5OvhLt6A3xY0Bjx6hVaSaFkZv+YLVWyb0J4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "info" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [ (lib.getBin xz) ];
|
2020-04-24 23:36:52 +00:00
|
|
|
/* If no explicit coreutils is given, use the one from stdenv. */
|
|
|
|
buildInputs = [ coreutils ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Disable stack-related gnulib tests on x86_64-darwin because they have problems running under
|
|
|
|
# Rosetta 2: test-c-stack hangs, test-sigsegv-catch-stackoverflow fails.
|
|
|
|
postPatch = if (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) then ''
|
|
|
|
sed -i -E 's:test-c-stack2?\.sh::g' gnulib-tests/Makefile.in
|
|
|
|
sed -i -E 's:test-sigsegv-catch-stackoverflow[12]::g' gnulib-tests/Makefile.in
|
|
|
|
'' else null;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags =
|
|
|
|
# "pr" need not be on the PATH as a run-time dep, so we need to tell
|
|
|
|
# configure where it is. Covers the cross and native case alike.
|
2021-01-15 22:18:51 +00:00
|
|
|
lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
|
|
|
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.gnu.org/software/diffutils/diffutils.html";
|
|
|
|
description = "Commands for showing the differences between files (diff, cmp, etc.)";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ das_j ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|