biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / version-management / hub / default.nix
blob4486c71605da395f31f261f13145dbf821ecc8ff
1 { lib
2 , buildGoModule
3 , fetchpatch
4 , fetchFromGitHub
5 , git
6 , groff
7 , installShellFiles
8 , makeWrapper
9 , unixtools
10 , nixosTests
13 buildGoModule rec {
14   pname = "hub";
15   version = "unstable-2022-12-01";
17   src = fetchFromGitHub {
18     owner = "github";
19     repo = pname;
20     rev = "38bcd4ae469e5f53f01901340b715c7658ab417a";
21     hash = "sha256-V2GvwKj0m2UXxE42G23OHXyAsTrVRNw1p5CAaJxGYog=";
22   };
24   patches = [
25     # Fix `fish` completions
26     # https://github.com/github/hub/pull/3036
27     (fetchpatch {
28       url = "https://github.com/github/hub/commit/439b7699e79471fc789929bcdea2f30bd719963e.patch";
29       hash = "sha256-pR/OkGa2ICR4n1pLNx8E2UTtLeDwFtXxeeTB94KFjC4=";
30     })
31     # Fix `bash` completions
32     # https://github.com/github/hub/pull/2948
33     (fetchpatch {
34       url = "https://github.com/github/hub/commit/64b291006f208fc7db1d5be96ff7db5535f1d853.patch";
35       hash = "sha256-jGFFIvSKEIpTQY0Wz63cqciUk25MzPHv5Z1ox8l7wmo=";
36     })
37   ];
39   postPatch = ''
40     patchShebangs script/
41     sed -i 's/^var Version = "[^"]\+"$/var Version = "${version}"/' version/version.go
42   '';
44   vendorHash = "sha256-wQH8V9jRgh45JGs4IfYS1GtmCIYdo93JG1UjJ0BGxXk=";
46   # Only needed to build the man-pages
47   excludedPackages = [ "github.com/github/hub/md2roff-bin" ];
49   nativeBuildInputs = [
50     groff
51     installShellFiles
52     makeWrapper
53     unixtools.col
54   ];
56   postInstall = ''
57     installShellCompletion --cmd hub \
58       --bash etc/hub.bash_completion.sh \
59       --fish etc/hub.fish_completion \
60       --zsh etc/hub.zsh_completion
62     LC_ALL=C.UTF8 make man-pages
63     installManPage share/man/man[1-9]/*.[1-9]
65     wrapProgram $out/bin/hub \
66       --suffix PATH : ${lib.makeBinPath [ git ]}
67   '';
69   nativeCheckInputs = [
70     git
71   ];
73   passthru.tests = { inherit (nixosTests) hub; };
75   meta = with lib; {
76     description = "Command-line wrapper for git that makes you better at GitHub";
77     homepage = "https://hub.github.com/";
78     license = licenses.mit;
79     maintainers = with maintainers; [ globin ];
80   };