hub: 2.14.2 -> unstable-2022-04-04

Fetching 5d42499f1d
didn't turn out to be that easy because the vendor/ directory was
removed in the meantime and we would need to create a custom patch.
Since the last release is  over 2 years ago I opted into bumping it to
the latest version in master instead.
This commit is contained in:
Sandro Jäckel 2022-07-18 16:29:41 +02:00
parent 3110964916
commit 4a13ac8958
No known key found for this signature in database
GPG Key ID: B1763F8651144063

View File

@ -1,47 +1,65 @@
{ lib, buildGoPackage, fetchFromGitHub, git, groff, installShellFiles, unixtools, nixosTests }: { lib
, buildGoModule
, fetchpatch
, fetchFromGitHub
, git
, groff
, installShellFiles
, makeWrapper
, unixtools
, nixosTests
}:
buildGoPackage rec { buildGoModule rec {
pname = "hub"; pname = "hub";
version = "2.14.2"; version = "unstable-2022-04-04";
goPackagePath = "github.com/github/hub";
# Only needed to build the man-pages
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "github"; owner = "github";
repo = pname; repo = pname;
rev = "v${version}"; rev = "363513a0f822a8bde5b620e5de183702280d4ace";
sha256 = "1qjab3dpia1jdlszz3xxix76lqrm4zbmqzd9ymld7h06awzsg2vh"; sha256 = "sha256-jipZHmGtPTsztTeVZofaMReU4AEU9k6mdw9YC4KKB1Q=";
}; };
nativeBuildInputs = [ groff installShellFiles unixtools.col ];
postPatch = '' postPatch = ''
patchShebangs . patchShebangs script/
substituteInPlace git/git.go --replace "cmd.New(\"git\")" "cmd.New(\"${git}/bin/git\")"
substituteInPlace commands/args.go --replace "Executable: \"git\"" "Executable: \"${git}/bin/git\""
''; '';
vendorSha256 = "sha256-wQH8V9jRgh45JGs4IfYS1GtmCIYdo93JG1UjJ0BGxXk=";
# Only needed to build the man-pages
excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
nativeBuildInputs = [
groff
installShellFiles
makeWrapper
unixtools.col
];
postInstall = '' postInstall = ''
cd go/src/${goPackagePath} installShellCompletion --cmd hub \
installShellCompletion --zsh --name _hub etc/hub.zsh_completion --bash etc/hub.bash_completion.sh \
installShellCompletion --bash --name hub etc/hub.bash_completion.sh --fish etc/hub.fish_completion \
installShellCompletion --fish --name hub.fish etc/hub.fish_completion --zsh etc/hub.zsh_completion
LC_ALL=C.UTF8 \ LC_ALL=C.UTF8 make man-pages
make man-pages
installManPage share/man/man[1-9]/*.[1-9] installManPage share/man/man[1-9]/*.[1-9]
wrapProgram $out/bin/hub \
--suffix PATH : ${lib.makeBinPath [ git ]}
''; '';
checkInputs = [
git
];
passthru.tests = { inherit (nixosTests) hub; }; passthru.tests = { inherit (nixosTests) hub; };
meta = with lib; { meta = with lib; {
description = "Command-line wrapper for git that makes you better at GitHub"; description = "Command-line wrapper for git that makes you better at GitHub";
license = licenses.mit;
homepage = "https://hub.github.com/"; homepage = "https://hub.github.com/";
license = licenses.mit;
maintainers = with maintainers; [ globin ]; maintainers = with maintainers; [ globin ];
platforms = with platforms; unix;
}; };
} }