Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / le / leetgo / package.nix
blob1b2b8e33767e81d045197445d7260ac51d2a4ed0
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 }:
7 buildGoModule rec {
8   pname = "leetgo";
9   version = "1.4.7";
11   src = fetchFromGitHub {
12     owner = "j178";
13     repo = "leetgo";
14     rev = "v${version}";
15     hash = "sha256-K/PaQakX0ZLu2Uh906kZ4p8J+GV7ewAeSVFMMQiKYBA=";
16   };
18   vendorHash = "sha256-4QSfZzYLjPdGKLySP57fK9n6WXdCYzb3sWibfP85jLE=";
20   nativeBuildInputs = [ installShellFiles ];
22   ldflags = [
23     "-s"
24     "-w"
25     "-X=github.com/j178/leetgo/constants.Version=${version}"
26   ];
28   subPackages = [ "." ];
30   postInstall = ''
31     installShellCompletion --cmd leetgo \
32       --bash <($out/bin/leetgo completion bash) \
33       --fish <($out/bin/leetgo completion fish) \
34       --zsh <($out/bin/leetgo completion zsh)
35   '';
37   meta = with lib; {
38     description = "A command-line tool for LeetCode";
39     homepage = "https://github.com/j178/leetgo";
40     changelog = "https://github.com/j178/leetgo/releases/tag/v${version}";
41     license = licenses.mit;
42     maintainers = with maintainers; [ Ligthiago ];
43     mainProgram = "leetgo";
44   };