From c8afc263df71303d0e26c795354bcf1a5aa29423 Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Sat, 13 Apr 2019 23:09:44 +0200 Subject: [PATCH] patchutils: generalize package --- pkgs/tools/text/patchutils/0.3.3.nix | 7 +++++++ .../text/patchutils/{default.nix => generic.nix} | 15 ++++++++------- pkgs/top-level/all-packages.nix | 4 +++- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 pkgs/tools/text/patchutils/0.3.3.nix rename pkgs/tools/text/patchutils/{default.nix => generic.nix} (63%) 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/generic.nix similarity index 63% rename from pkgs/tools/text/patchutils/default.nix rename to pkgs/tools/text/patchutils/generic.nix index 238676020e8b..87d925e333f6 100644 --- a/pkgs/tools/text/patchutils/default.nix +++ b/pkgs/tools/text/patchutils/generic.nix @@ -1,15 +1,16 @@ -{ stdenv, fetchurl }: - +{ stdenv, fetchurl +, version, sha256, patches ? [] +, ... +}: stdenv.mkDerivation rec { - name = "patchutils-0.3.3"; + pname = "patchutils"; + inherit version patches; src = fetchurl { - url = "http://cyberelk.net/tim/data/patchutils/stable/${name}.tar.xz"; - sha256 = "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"; + url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz"; + inherit sha256; }; - patches = [ ./drop-comments.patch ]; # we would get into a cycle when using fetchpatch on this one - hardeningDisable = [ "format" ]; doCheck = false; # fails diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c048f4431612..261283800d75 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4881,7 +4881,9 @@ in parcellite = callPackage ../tools/misc/parcellite { }; - patchutils = callPackage ../tools/text/patchutils { }; + patchutils = patchutils_0_3_3; + + patchutils_0_3_3 = callPackage ../tools/text/patchutils/0.3.3.nix { }; parted = callPackage ../tools/misc/parted { };