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

authored by Artturi and committed by GitHub 44403b72 b0d58034

+43 -8
+8
pkgs/build-support/fetchpatch/tests.nix
···
··· 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 + }
+8
pkgs/tools/text/patchutils/0.4.2.nix
···
··· 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 + })
+21 -7
pkgs/tools/text/patchutils/generic.nix
··· 1 - { lib, stdenv, fetchurl, perl 2 - , version, sha256, patches ? [] 3 , ... 4 }: 5 stdenv.mkDerivation rec { ··· 11 inherit sha256; 12 }; 13 14 - buildInputs = [ perl ]; 15 hardeningDisable = [ "format" ]; 16 17 - doCheck = false; # fails 18 19 meta = with lib; { 20 description = "Tools to manipulate patch files"; 21 homepage = "http://cyberelk.net/tim/software/patchutils"; 22 license = licenses.gpl2Plus; 23 platforms = platforms.all; 24 - executables = [ "combinediff" "dehtmldiff" "editdiff" "espdiff" 25 - "filterdiff" "fixcvsdiff" "flipdiff" "grepdiff" "interdiff" "lsdiff" 26 - "recountdiff" "rediff" "splitdiff" "unwrapdiff" ]; 27 }; 28 }
··· 1 + { lib, stdenv, fetchurl, perl, makeWrapper 2 + , version, sha256, patches ? [], extraBuildInputs ? [] 3 , ... 4 }: 5 stdenv.mkDerivation rec { ··· 11 inherit sha256; 12 }; 13 14 + nativeBuildInputs = [ makeWrapper ]; 15 + buildInputs = [ perl ] ++ extraBuildInputs; 16 hardeningDisable = [ "format" ]; 17 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 + ''; 34 35 meta = with lib; { 36 description = "Tools to manipulate patch files"; 37 homepage = "http://cyberelk.net/tim/software/patchutils"; 38 license = licenses.gpl2Plus; 39 platforms = platforms.all; 40 + maintainers = with maintainers; [ artturin ]; 41 }; 42 }
+6 -1
pkgs/top-level/all-packages.nix
··· 507 508 mht2htm = callPackage ../tools/misc/mht2htm { }; 509 510 - fetchpatch = callPackage ../build-support/fetchpatch { }; 511 512 fetchs3 = callPackage ../build-support/fetchs3 { }; 513 ··· 8295 patchutils = callPackage ../tools/text/patchutils { }; 8296 8297 patchutils_0_3_3 = callPackage ../tools/text/patchutils/0.3.3.nix { }; 8298 8299 parted = callPackage ../tools/misc/parted { }; 8300
··· 507 508 mht2htm = callPackage ../tools/misc/mht2htm { }; 509 510 + fetchpatch = callPackage ../build-support/fetchpatch { } 511 + // { 512 + tests = callPackages ../build-support/fetchpatch/tests.nix { }; 513 + }; 514 515 fetchs3 = callPackage ../build-support/fetchs3 { }; 516 ··· 8298 patchutils = callPackage ../tools/text/patchutils { }; 8299 8300 patchutils_0_3_3 = callPackage ../tools/text/patchutils/0.3.3.nix { }; 8301 + 8302 + patchutils_0_4_2 = callPackage ../tools/text/patchutils/0.4.2.nix { }; 8303 8304 parted = callPackage ../tools/misc/parted { }; 8305