Merge pull request #318612 from msanft/docopts/build-go-module

docopts: migrate to buildGoModule
This commit is contained in:
Aleksana 2024-06-10 16:14:50 +08:00 committed by GitHub
commit 4882c5e0d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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

@ -20519,8 +20519,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 {