docopts: migrate to buildGoModule

Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
This commit is contained in:
Moritz Sanft 2024-06-09 21:36:18 +02:00
parent bff605542a
commit 6b01739d3f
No known key found for this signature in database
GPG Key ID: 335D28368B1DA615
4 changed files with 34 additions and 44 deletions

View File

@ -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;
};
}

View File

@ -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;
};
}

View File

@ -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=";
};
}
]

View File

@ -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 {