3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/git-and-tools/hub/default.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

2021-08-12 20:36:42 +01:00
{ lib, buildGoPackage, fetchFromGitHub, git, groff, installShellFiles, unixtools, nixosTests }:
buildGoPackage rec {
pname = "hub";
version = "2.14.2";
goPackagePath = "github.com/github/hub";
# Only needed to build the man-pages
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
src = fetchFromGitHub {
owner = "github";
repo = pname;
rev = "v${version}";
sha256 = "1qjab3dpia1jdlszz3xxix76lqrm4zbmqzd9ymld7h06awzsg2vh";
};
2021-08-12 20:36:42 +01:00
nativeBuildInputs = [ groff installShellFiles unixtools.col ];
postPatch = ''
patchShebangs .
substituteInPlace git/git.go --replace "cmd.New(\"git\")" "cmd.New(\"${git}/bin/git\")"
substituteInPlace commands/args.go --replace "Executable: \"git\"" "Executable: \"${git}/bin/git\""
'';
postInstall = ''
cd go/src/${goPackagePath}
2020-04-26 04:16:53 +01:00
installShellCompletion --zsh --name _hub etc/hub.zsh_completion
installShellCompletion --bash --name hub etc/hub.bash_completion.sh
installShellCompletion --fish --name hub.fish etc/hub.fish_completion
2015-01-03 23:28:38 +00:00
2019-02-27 21:37:23 +00:00
LC_ALL=C.UTF8 \
make man-pages
2020-04-26 04:16:53 +01:00
installManPage share/man/man[1-9]/*.[1-9]
'';
2020-12-29 16:13:26 +00:00
passthru.tests = { inherit (nixosTests) hub; };
meta = with lib; {
2015-01-03 23:28:38 +00:00
description = "Command-line wrapper for git that makes you better at GitHub";
license = licenses.mit;
homepage = "https://hub.github.com/";
maintainers = with maintainers; [ globin ];
platforms = with platforms; unix;
};
}