From 6b01739d3fda5c512bc96d046678051627a7cdec Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Sun, 9 Jun 2024 21:36:18 +0200 Subject: [PATCH] docopts: migrate to buildGoModule Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com> --- pkgs/by-name/do/docopts/package.nix | 34 +++++++++++++++++++ .../tools/misc/docopts/default.nix | 31 ----------------- pkgs/development/tools/misc/docopts/deps.nix | 11 ------ pkgs/top-level/all-packages.nix | 2 -- 4 files changed, 34 insertions(+), 44 deletions(-) create mode 100644 pkgs/by-name/do/docopts/package.nix delete mode 100644 pkgs/development/tools/misc/docopts/default.nix delete mode 100644 pkgs/development/tools/misc/docopts/deps.nix diff --git a/pkgs/by-name/do/docopts/package.nix b/pkgs/by-name/do/docopts/package.nix new file mode 100644 index 000000000000..f2d0033e035d --- /dev/null +++ b/pkgs/by-name/do/docopts/package.nix @@ -0,0 +1,34 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, fetchpatch +}: +buildGoModule rec { + pname = "docopts"; + version = "0.6.4-with-no-mangle-double-dash"; + + src = fetchFromGitHub { + owner = "docopt"; + repo = "docopts"; + rev = "refs/tags/v${version}"; + sha256 = "sha256-GIBrJ5qexeJ6ul5ek9LJZC4J3cNExsTrnxdzRCfoqn8="; + }; + + patches = [ + # Migrate project to Go modules. + (fetchpatch { + url = "https://github.com/docopt/docopts/pull/74/commits/2c516165e72b35516a64c4529dbc938c0aaa9442.patch"; + sha256 = "sha256-Tp05B3tmctnSYIQzCxCc/fhcAWWuEz2ifu/CQZt0XPU="; + }) + ]; + + vendorHash = "sha256-+pMgaHB69itbQ+BDM7/oaJg3HrT1UN+joJL7BO/2vxE="; + + meta = { + homepage = "https://github.com/docopt/docopts"; + description = "Shell interpreter for docopt, the command-line interface description language"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.confus ]; + platforms = lib.platforms.unix; + }; +} diff --git a/pkgs/development/tools/misc/docopts/default.nix b/pkgs/development/tools/misc/docopts/default.nix deleted file mode 100644 index 1b7834318772..000000000000 --- a/pkgs/development/tools/misc/docopts/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ lib, buildGoPackage, fetchFromGitHub }: - -buildGoPackage rec { - pname = "docopts"; - version = "0.6.4-with-no-mangle-double-dash"; - - src = fetchFromGitHub { - owner = "docopt"; - repo = pname; - rev = "v${version}"; - sha256 = "0zxax0kl8wqpkzmw9ij4qgfhjbk4r7996pjyp9xf5icyk8knp00q"; - }; - - goPackagePath = "github.com/docopt/${pname}"; - - goDeps = ./deps.nix; - - subPackages = [ "./" ]; - - postInstall = '' - install -D -m 755 ./go/src/$goPackagePath/docopts.sh $out/bin/docopts.sh - ''; - - meta = with lib; { - homepage = "https://github.com/docopt/${pname}"; - description = "docopt CLI tool for shell scripting"; - license = licenses.mit; - maintainers = [ maintainers.confus ]; - platforms = platforms.unix; - }; -} diff --git a/pkgs/development/tools/misc/docopts/deps.nix b/pkgs/development/tools/misc/docopts/deps.nix deleted file mode 100644 index 8cc1686de7d6..000000000000 --- a/pkgs/development/tools/misc/docopts/deps.nix +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - goPackagePath = "github.com/docopt/docopt-go"; - fetch = { - type = "git"; - url = "https://github.com/docopt/docopt.go"; - rev = "ee0de3bc6815ee19d4a46c7eb90f829db0e014b1"; # "0.6.2"; - sha256 = "sha256-0mCKIC5x7aauBL8ahXB9ExMfoTJl55HaafWWWPNRmUI="; - }; - } -] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dfafa2ffcc0c..7ed799b159d0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20513,8 +20513,6 @@ with pkgs; docopt_cpp = callPackage ../development/libraries/docopt_cpp { }; - docopts = callPackage ../development/tools/misc/docopts { }; - dotconf = callPackage ../development/libraries/dotconf { }; draco = callPackage ../development/libraries/draco {