diff options
-rw-r--r-- | pkgs/build-support/fetchpatch/default.nix | 12 | ||||
-rw-r--r-- | pkgs/tools/text/patchutils/0.3.3.nix | 7 | ||||
-rw-r--r-- | pkgs/tools/text/patchutils/default.nix | 30 | ||||
-rw-r--r-- | pkgs/tools/text/patchutils/generic.nix | 27 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
5 files changed, 49 insertions, 29 deletions
diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index 89d72f512f7f..2fb32b2324f2 100644 --- a/pkgs/build-support/fetchpatch/default.nix +++ b/pkgs/build-support/fetchpatch/default.nix @@ -5,6 +5,10 @@ # stripLen acts as the -p parameter when applying a patch. { lib, fetchurl, buildPackages }: +let + # 0.3.4 would change hashes: https://github.com/NixOS/nixpkgs/issues/25154 + patchutils = buildPackages.patchutils_0_3_3; +in { stripLen ? 0, extraPrefix ? null, excludes ? [], includes ? [], revert ? false, ... }@args: fetchurl ({ @@ -14,10 +18,10 @@ fetchurl ({ echo "error: Fetched patch file '$out' is empty!" 1>&2 exit 1 fi - "${buildPackages.patchutils}/bin/lsdiff" "$out" \ + "${patchutils}/bin/lsdiff" "$out" \ | sort -u | sed -e 's/[*?]/\\&/g' \ | xargs -I{} \ - "${buildPackages.patchutils}/bin/filterdiff" \ + "${patchutils}/bin/filterdiff" \ --include={} \ --strip=${toString stripLen} \ ${lib.optionalString (extraPrefix != null) '' @@ -32,7 +36,7 @@ fetchurl ({ cat "$out" 1>&2 exit 1 fi - ${buildPackages.patchutils}/bin/filterdiff \ + ${patchutils}/bin/filterdiff \ -p1 \ ${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \ ${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg x}") includes)} \ @@ -46,7 +50,7 @@ fetchurl ({ exit 1 fi '' + lib.optionalString revert '' - ${buildPackages.patchutils}/bin/interdiff "$out" /dev/null > "$tmpfile" + ${patchutils}/bin/interdiff "$out" /dev/null > "$tmpfile" mv "$tmpfile" "$out" '' + (args.postFetch or ""); meta.broken = excludes != [] && includes != []; diff --git a/pkgs/tools/text/patchutils/0.3.3.nix b/pkgs/tools/text/patchutils/0.3.3.nix new file mode 100644 index 000000000000..b324137be6aa --- /dev/null +++ b/pkgs/tools/text/patchutils/0.3.3.nix @@ -0,0 +1,7 @@ +{ callPackage, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "0.3.3"; + sha256 = "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"; + patches = [ ./drop-comments.patch ]; # we would get into a cycle when using fetchpatch on this one +}) diff --git a/pkgs/tools/text/patchutils/default.nix b/pkgs/tools/text/patchutils/default.nix index 238676020e8b..eab0e98f95c7 100644 --- a/pkgs/tools/text/patchutils/default.nix +++ b/pkgs/tools/text/patchutils/default.nix @@ -1,26 +1,6 @@ -{ stdenv, fetchurl }: +{ callPackage, ... } @ args: -stdenv.mkDerivation rec { - name = "patchutils-0.3.3"; - - src = fetchurl { - url = "http://cyberelk.net/tim/data/patchutils/stable/${name}.tar.xz"; - sha256 = "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"; - }; - - patches = [ ./drop-comments.patch ]; # we would get into a cycle when using fetchpatch on this one - - hardeningDisable = [ "format" ]; - - doCheck = false; # fails - - meta = with stdenv.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" ]; - }; -} +callPackage ./generic.nix (args // rec { + version = "0.3.4"; + sha256 = "0xp8mcfyi5nmb5a2zi5ibmyshxkb1zv1dgmnyn413m7ahgdx8mfg"; +}) diff --git a/pkgs/tools/text/patchutils/generic.nix b/pkgs/tools/text/patchutils/generic.nix new file mode 100644 index 000000000000..87d925e333f6 --- /dev/null +++ b/pkgs/tools/text/patchutils/generic.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchurl +, version, sha256, patches ? [] +, ... +}: +stdenv.mkDerivation rec { + pname = "patchutils"; + inherit version patches; + + src = fetchurl { + url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz"; + inherit sha256; + }; + + hardeningDisable = [ "format" ]; + + doCheck = false; # fails + + meta = with stdenv.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" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a4deb15ac75f..0b4fd137f81a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5030,6 +5030,8 @@ in patchutils = callPackage ../tools/text/patchutils { }; + patchutils_0_3_3 = callPackage ../tools/text/patchutils/0.3.3.nix { }; + parted = callPackage ../tools/misc/parted { }; paulstretch = callPackage ../applications/audio/paulstretch { }; |