git.iko.soy/typeable/nixpkgs
on master help sign in
patchutils: add 0.4.2 variant + remove meta.executable + enable tests + fix inter-dependencies by wrapping (#141567)
commit44403b728b3869685fa8bceaa9e491f5b5ad5347 authorArtturi <Artturin@artturin.com> dateMon 25 Oct 2021, 13:13 (5 years ago) parentb0d5803
4 files changed+43−8
pkgs/build-support/fetchpatch/tests.nix+8 pkgs/tools/text/patchutils/0.4.2.nix+8 pkgs/tools/text/patchutils/generic.nix+21−7 pkgs/top-level/all-packages.nix+6−1
pkgs/build-support/fetchpatch/tests.nixnew file+8
@@ -0,0 +1,8 @@
1+{ invalidateFetcherByDrvHash, fetchpatch, ... }:
2+
3+{
4+ simple = invalidateFetcherByDrvHash fetchpatch {
5+ url = "https://github.com/facebook/zstd/pull/2724/commits/e1f85dbca3a0ed5ef06c8396912a0914db8dea6a.patch";
6+ sha256 = "sha256-PuYAqnJWAE+L9bsroOnnBGJhERW8LHrGSLtIEkKU9vg=";
7+ };
8+}
pkgs/tools/text/patchutils/0.4.2.nixnew file+8
@@ -0,0 +1,8 @@
1+{ callPackage, python3, ... } @ args:
2+
3+callPackage ./generic.nix (args // {
4+ version = "0.4.2";
5+ sha256 = "sha256-iHWwll/jPeYriQ9s15O+f6/kGk5VLtv2QfH+1eu/Re0=";
6+ # for gitdiff
7+ extraBuildInputs = [ python3 ];
8+})
pkgs/tools/text/patchutils/generic.nix+21−7
@@ -1,5 +1,5 @@
1−{ lib, stdenv, fetchurl, perl
2−, version, sha256, patches ? []
1+{ lib, stdenv, fetchurl, perl, makeWrapper
2+, version, sha256, patches ? [], extraBuildInputs ? []
33, ...
44}:
55stdenv.mkDerivation rec {
@@ -11,18 +11,32 @@ stdenv.mkDerivation rec {
1111 inherit sha256;
1212 };
1313
14− buildInputs = [ perl ];
14+ nativeBuildInputs = [ makeWrapper ];
15+ buildInputs = [ perl ] ++ extraBuildInputs;
1516 hardeningDisable = [ "format" ];
1617
17− doCheck = false; # fails
18+ postInstall = ''
19+ for bin in $out/bin/{splitdiff,rediff,editdiff,dehtmldiff}; do
20+ wrapProgram "$bin" \
21+ --prefix PATH : "$out/bin"
22+ done
23+ '';
24+
25+ doCheck = lib.versionAtLeast version "0.3.4";
26+
27+ preCheck = ''
28+ patchShebangs tests
29+ chmod +x scripts/*
30+ '' + lib.optionalString (lib.versionOlder version "0.4.2") ''
31+ find tests -type f -name 'run-test' \
32+ -exec sed -i '{}' -e 's|/bin/echo|echo|g' \;
33+ '';
1834
1935 meta = with lib; {
2036 description = "Tools to manipulate patch files";
2137 homepage = "http://cyberelk.net/tim/software/patchutils";
2238 license = licenses.gpl2Plus;
2339 platforms = platforms.all;
24− executables = [ "combinediff" "dehtmldiff" "editdiff" "espdiff"
25− "filterdiff" "fixcvsdiff" "flipdiff" "grepdiff" "interdiff" "lsdiff"
26− "recountdiff" "rediff" "splitdiff" "unwrapdiff" ];
40+ maintainers = with maintainers; [ artturin ];
2741 };
2842}
pkgs/top-level/all-packages.nix+6−1
@@ -507,7 +507,10 @@ with pkgs;
507507
508508 mht2htm = callPackage ../tools/misc/mht2htm { };
509509
510− fetchpatch = callPackage ../build-support/fetchpatch { };
510+ fetchpatch = callPackage ../build-support/fetchpatch { }
511+ // {
512+ tests = callPackages ../build-support/fetchpatch/tests.nix { };
513+ };
511514
512515 fetchs3 = callPackage ../build-support/fetchs3 { };
513516
@@ -8296,6 +8299,8 @@ with pkgs;
82968299
82978300 patchutils_0_3_3 = callPackage ../tools/text/patchutils/0.3.3.nix { };
82988301
8302+ patchutils_0_4_2 = callPackage ../tools/text/patchutils/0.4.2.nix { };
8303+
82998304 parted = callPackage ../tools/misc/parted { };
83008305
83018306 passh = callPackage ../tools/networking/passh { };