2024-05-02 00:46:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, xz, coreutils ? null }:
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "diffutils";
|
|
|
|
version = "3.10";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz";
|
|
|
|
hash = "sha256-kOXpPMck5OvhLt6A3xY0Bjx6hVaSaFkZv+YLVWyb0J4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "info" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ (lib.getBin xz) ];
|
2024-05-13 21:24:10 +00:00
|
|
|
# If no explicit coreutils is given, use the one from stdenv.
|
2024-05-02 00:46:19 +00:00
|
|
|
buildInputs = [ coreutils ];
|
|
|
|
|
|
|
|
# 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.
|
2024-05-13 21:24:10 +00:00
|
|
|
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;
|
2024-05-02 00:46:19 +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.
|
|
|
|
lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
|
2024-05-13 21:24:10 +00:00
|
|
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform)
|
|
|
|
"gl_cv_func_getopt_gnu=yes";
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# Test failure on QEMU only (#300550)
|
|
|
|
doCheck = !stdenv.buildPlatform.isRiscV64;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.gnu.org/software/diffutils/diffutils.html";
|
2024-05-13 21:24:10 +00:00
|
|
|
description =
|
|
|
|
"Commands for showing the differences between files (diff, cmp, etc.)";
|
2024-05-02 00:46:19 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ das_j ];
|
|
|
|
};
|
|
|
|
}
|