patchutils: add 0.4.2 variant + remove meta.executable + enable tests + fix inter-dependencies by wrapping (#141567)

This commit is contained in:
Artturi 2021-10-25 13:13:22 +03:00 committed by GitHub
parent b0d5803400
commit 44403b728b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 8 deletions

View file

@ -0,0 +1,8 @@
{ invalidateFetcherByDrvHash, fetchpatch, ... }:
{
simple = invalidateFetcherByDrvHash fetchpatch {
url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch";
sha256 = "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg=";
};
}

View file

@ -0,0 +1,8 @@
{ callPackage, python3, ... } @ args:
callPackage ./generic.nix (args // {
version = "0.4.2";
sha256 = "sha256-iHWwll/jPeYriQ9s15O+f6/kGk5VLtv2QfH+1eu/Re0=";
# for gitdiff
extraBuildInputs = [ python3 ];
})

View file

@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, perl
, version, sha256, patches ? []
{ lib, stdenv, fetchurl, perl, makeWrapper
, version, sha256, patches ? [], extraBuildInputs ? []
, ...
}:
stdenv.mkDerivation rec {
@ -11,18 +11,32 @@ stdenv.mkDerivation rec {
inherit sha256;
};
buildInputs = [ perl ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ] ++ extraBuildInputs;
hardeningDisable = [ "format" ];
doCheck = false; # fails
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 = with lib; {
description = "Tools to manipulate patch files";
homepage = "http://cyberelk.net/tim/software/patchutils";
license = licenses.gpl2Plus;
platforms = platforms.all;
executables = [ "combinediff" "dehtmldiff" "editdiff" "espdiff"
"filterdiff" "fixcvsdiff" "flipdiff" "grepdiff" "interdiff" "lsdiff"
"recountdiff" "rediff" "splitdiff" "unwrapdiff" ];
maintainers = with maintainers; [ artturin ];
};
}

View file

@ -507,7 +507,10 @@ with pkgs;
mht2htm = callPackage ../tools/misc/mht2htm { };
fetchpatch = callPackage ../build-support/fetchpatch { };
fetchpatch = callPackage ../build-support/fetchpatch { }
// {
tests = callPackages ../build-support/fetchpatch/tests.nix { };
};
fetchs3 = callPackage ../build-support/fetchs3 { };
@ -8296,6 +8299,8 @@ with pkgs;
patchutils_0_3_3 = callPackage ../tools/text/patchutils/0.3.3.nix { };
patchutils_0_4_2 = callPackage ../tools/text/patchutils/0.4.2.nix { };
parted = callPackage ../tools/misc/parted { };
passh = callPackage ../tools/networking/passh { };