depot/third_party/nixpkgs/pkgs/by-name/le/leetgo/package.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

45 lines
1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "leetgo";
version = "1.4.9";
src = fetchFromGitHub {
owner = "j178";
repo = "leetgo";
rev = "v${version}";
hash = "sha256-FlQYTNz1Fh0igwnufjVXN4bsUYBB1kls19D+/v7Ztps=";
};
vendorHash = "sha256-DdAe9yyusA6Ac8ioKqLiM5lcOt9Xy7F77gMG6yBTl7Q=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X=github.com/j178/leetgo/constants.Version=${version}"
];
subPackages = [ "." ];
postInstall = ''
installShellCompletion --cmd leetgo \
--bash <($out/bin/leetgo completion bash) \
--fish <($out/bin/leetgo completion fish) \
--zsh <($out/bin/leetgo completion zsh)
'';
meta = with lib; {
description = "A command-line tool for LeetCode";
homepage = "https://github.com/j178/leetgo";
changelog = "https://github.com/j178/leetgo/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ Ligthiago ];
mainProgram = "leetgo";
};
}