Files
nixpkgs/pkgs/tools/text/gnupatch/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

50 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchurl,
ed,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "patch";
version = "2.8";
src = fetchurl {
url = "mirror://gnu/patch/patch-${version}.tar.xz";
hash = "sha256-+Hzuae7CtPy/YKOWsDCtaqNBXxkqpffuhMrV4R9/WuM=";
};
# This test is filesystem-dependent - observed failing on ZFS
postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD ''
sed -E -i -e '/bad-filenames/d' tests/Makefile.am
'';
nativeBuildInputs = [ autoreconfHook ];
configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"ac_cv_func_strnlen_working=yes"
];
doCheck = stdenv.hostPlatform.libc != "musl"; # not cross;
nativeCheckInputs = [ ed ];
meta = {
description = "GNU Patch, a program to apply differences to files";
mainProgram = "patch";
longDescription = ''
GNU Patch takes a patch file containing a difference listing
produced by the diff program and applies those differences to one or
more original files, producing patched versions.
'';
homepage = "https://savannah.gnu.org/projects/patch";
license = lib.licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.all;
};
}