git-bug: don't build unneeded packages, misc changes

* install fish completions
* meta.license update based on note in README
This commit is contained in:
D Anzorge 2022-12-20 03:23:56 +01:00
parent e320029847
commit c4682d250d

View file

@ -1,42 +1,43 @@
{ lib, buildGoModule, fetchFromGitHub }: { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec { buildGoModule rec {
pname = "git-bug"; pname = "git-bug";
version = "0.8.0"; # the `rev` below pins the version of the source to get version = "0.8.0";
rev = "v0.8.0";
src = fetchFromGitHub { src = fetchFromGitHub {
inherit rev;
owner = "MichaelMure"; owner = "MichaelMure";
repo = "git-bug"; repo = "git-bug";
rev = "v${version}";
sha256 = "12byf6nsamwz0ssigan1z299s01cyh8bhgj86bibl90agd4zs9n8"; sha256 = "12byf6nsamwz0ssigan1z299s01cyh8bhgj86bibl90agd4zs9n8";
}; };
vendorSha256 = "sha256-32kNDoBE50Jx1Ef9YwhDk7nd3CaTSnHPlu7PgWPUGfE="; vendorSha256 = "sha256-32kNDoBE50Jx1Ef9YwhDk7nd3CaTSnHPlu7PgWPUGfE=";
nativeBuildInputs = [ installShellFiles ];
doCheck = false; doCheck = false;
excludedPackages = [ "doc" "misc" ];
ldflags = [ ldflags = [
"-X github.com/MichaelMure/git-bug/commands.GitCommit=${rev}" "-X github.com/MichaelMure/git-bug/commands.GitCommit=v${version}"
"-X github.com/MichaelMure/git-bug/commands.GitLastTag=${version}" "-X github.com/MichaelMure/git-bug/commands.GitLastTag=${version}"
"-X github.com/MichaelMure/git-bug/commands.GitExactTag=${version}" "-X github.com/MichaelMure/git-bug/commands.GitExactTag=${version}"
]; ];
postInstall = '' postInstall = ''
install -D -m 0644 misc/completion/bash/git-bug "$out/share/bash-completion/completions/git-bug" installShellCompletion \
install -D -m 0644 misc/completion/zsh/git-bug "$out/share/zsh/site-functions/git-bug" --bash misc/completion/bash/git-bug \
install -D -m 0644 -t "$out/share/man/man1" doc/man/* --zsh misc/completion/zsh/git-bug \
--fish misc/completion/fish/git-bug
# not sure why the following executables are in $out/bin/ installManPage doc/man/*
rm -f $out/bin/cmd
rm -f $out/bin/completion
rm -f $out/bin/doc
''; '';
meta = with lib; { meta = with lib; {
description = "Distributed bug tracker embedded in Git"; description = "Distributed bug tracker embedded in Git";
homepage = "https://github.com/MichaelMure/git-bug"; homepage = "https://github.com/MichaelMure/git-bug";
license = licenses.gpl3Only; license = licenses.gpl3Plus;
maintainers = with maintainers; [ royneary ]; maintainers = with maintainers; [ royneary DeeUnderscore ];
}; };
} }