Files
nixpkgs/pkgs/tools/text/patchutils/generic.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

55 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchurl,
perl,
makeWrapper,
version,
sha256,
patches ? [ ],
extraBuildInputs ? [ ],
...
}:
stdenv.mkDerivation rec {
pname = "patchutils";
inherit version patches;
src = fetchurl {
url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz";
inherit sha256;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ] ++ extraBuildInputs;
hardeningDisable = [ "format" ];
# tests fail when building in parallel
enableParallelBuilding = false;
postInstall = ''
for bin in $out/bin/{splitdiff,rediff,editdiff,dehtmldiff}; do
wrapProgram "$bin" \
--prefix PATH : "$out/bin"
done
'';
doCheck = lib.versionAtLeast version "0.3.4";
preCheck = ''
patchShebangs tests
chmod +x scripts/*
''
+ lib.optionalString (lib.versionOlder version "0.4.2") ''
find tests -type f -name 'run-test' \
-exec sed -i '{}' -e 's|/bin/echo|echo|g' \;
'';
meta = {
description = "Tools to manipulate patch files";
homepage = "http://cyberelk.net/tim/software/patchutils";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ artturin ];
};
}