azure-storage-azcopy: 10.27.1 -> 10.28.0 (#377459)
[NixPkgs.git] / pkgs / by-name / le / leetgo / package.nix
blob8293ff5bd89aa5b81fe57f475058bc112dec75aa
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   installShellFiles,
6 }:
8 buildGoModule rec {
9   pname = "leetgo";
10   version = "1.4.13";
12   src = fetchFromGitHub {
13     owner = "j178";
14     repo = "leetgo";
15     rev = "v${version}";
16     hash = "sha256-KEfRsaBsMCKO66HW71gNzHzZkun1yo6a05YqAvafomM=";
17   };
19   vendorHash = "sha256-pdGsvwEppmcsWyXxkcDut0F2Ak1nO42Hnd36tnysE9w=";
21   nativeBuildInputs = [ installShellFiles ];
23   ldflags = [
24     "-s"
25     "-w"
26     "-X=github.com/j178/leetgo/constants.Version=${version}"
27   ];
29   subPackages = [ "." ];
31   postInstall = ''
32     installShellCompletion --cmd leetgo \
33       --bash <($out/bin/leetgo completion bash) \
34       --fish <($out/bin/leetgo completion fish) \
35       --zsh <($out/bin/leetgo completion zsh)
36   '';
38   meta = with lib; {
39     description = "A command-line tool for LeetCode";
40     homepage = "https://github.com/j178/leetgo";
41     changelog = "https://github.com/j178/leetgo/releases/tag/v${version}";
42     license = licenses.mit;
43     maintainers = with maintainers; [ Ligthiago ];
44     mainProgram = "leetgo";
45   };