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";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "unstable-2022-12-01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "github";
|
|
|
|
repo = pname;
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "38bcd4ae469e5f53f01901340b715c7658ab417a";
|
|
|
|
hash = "sha256-V2GvwKj0m2UXxE42G23OHXyAsTrVRNw1p5CAaJxGYog=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
patches = [
|
|
|
|
# Fix `fish` completions
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/github/hub/pull/3036
|
2023-04-12 12:48:02 +00:00
|
|
|
(fetchpatch {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://github.com/github/hub/commit/439b7699e79471fc789929bcdea2f30bd719963e.patch";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-pR/OkGa2ICR4n1pLNx8E2UTtLeDwFtXxeeTB94KFjC4=";
|
|
|
|
})
|
|
|
|
# Fix `bash` completions
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/github/hub/pull/2948
|
2023-04-12 12:48:02 +00:00
|
|
|
(fetchpatch {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://github.com/github/hub/commit/64b291006f208fc7db1d5be96ff7db5535f1d853.patch";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-jGFFIvSKEIpTQY0Wz63cqciUk25MzPHv5Z1ox8l7wmo=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
patchShebangs script/
|
2023-04-12 12:48:02 +00:00
|
|
|
sed -i 's/^var Version = "[^"]\+"$/var Version = "${version}"/' version/version.go
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
vendorHash = "sha256-wQH8V9jRgh45JGs4IfYS1GtmCIYdo93JG1UjJ0BGxXk=";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
};
|
|
|
|
}
|