2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchpatch
|
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, groff
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, unixtools
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "hub";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "unstable-2022-04-04";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "github";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "363513a0f822a8bde5b620e5de183702280d4ace";
|
|
|
|
sha256 = "sha256-jipZHmGtPTsztTeVZofaMReU4AEU9k6mdw9YC4KKB1Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
patchShebangs script/
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
vendorSha256 = "sha256-wQH8V9jRgh45JGs4IfYS1GtmCIYdo93JG1UjJ0BGxXk=";
|
|
|
|
|
|
|
|
# Only needed to build the man-pages
|
|
|
|
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
groff
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
unixtools.col
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
installShellCompletion --cmd hub \
|
|
|
|
--bash etc/hub.bash_completion.sh \
|
|
|
|
--fish etc/hub.fish_completion \
|
|
|
|
--zsh etc/hub.zsh_completion
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
LC_ALL=C.UTF8 make man-pages
|
2020-05-03 17:38:23 +00:00
|
|
|
installManPage share/man/man[1-9]/*.[1-9]
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
wrapProgram $out/bin/hub \
|
|
|
|
--suffix PATH : ${lib.makeBinPath [ git ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
git
|
|
|
|
];
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) hub; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Command-line wrapper for git that makes you better at GitHub";
|
|
|
|
homepage = "https://hub.github.com/";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.mit;
|
2020-05-15 21:57:56 +00:00
|
|
|
maintainers = with maintainers; [ globin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|