2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, buildGoPackage, fetchFromGitHub, git, groff, installShellFiles, util-linux, nixosTests }:
|
2012-12-12 05:45:43 +00:00
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
buildGoPackage rec {
|
2019-02-17 16:54:29 +00:00
|
|
|
pname = "hub";
|
2020-03-12 09:20:00 +00:00
|
|
|
version = "2.14.2";
|
2012-12-12 05:45:43 +00:00
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
goPackagePath = "github.com/github/hub";
|
|
|
|
|
2019-02-17 16:54:29 +00:00
|
|
|
# Only needed to build the man-pages
|
|
|
|
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
|
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "github";
|
2019-02-17 16:54:29 +00:00
|
|
|
repo = pname;
|
2018-06-21 23:12:52 +01:00
|
|
|
rev = "v${version}";
|
2020-03-12 09:20:00 +00:00
|
|
|
sha256 = "1qjab3dpia1jdlszz3xxix76lqrm4zbmqzd9ymld7h06awzsg2vh";
|
2012-12-12 05:45:43 +00:00
|
|
|
};
|
|
|
|
|
2020-11-24 15:29:28 +00:00
|
|
|
nativeBuildInputs = [ groff installShellFiles util-linux ];
|
2015-02-18 03:30:59 +00:00
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
postPatch = ''
|
2015-02-18 03:30:59 +00:00
|
|
|
patchShebangs .
|
2020-12-29 16:12:03 +00:00
|
|
|
substituteInPlace git/git.go --replace "cmd.New(\"git\")" "cmd.New(\"${git}/bin/git\")"
|
|
|
|
substituteInPlace commands/args.go --replace "Executable: \"git\"" "Executable: \"${git}/bin/git\""
|
2012-12-12 05:45:43 +00:00
|
|
|
'';
|
|
|
|
|
2018-06-21 23:12:52 +01:00
|
|
|
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]
|
2012-12-12 05:45:43 +00:00
|
|
|
'';
|
|
|
|
|
2020-12-29 16:13:26 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) hub; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
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;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://hub.github.com/";
|
2020-05-09 10:25:07 +01:00
|
|
|
maintainers = with maintainers; [ globin ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; unix;
|
2012-12-12 05:45:43 +00:00
|
|
|
};
|
|
|
|
}
|