summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/gh
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2021-04-15 16:19:18 +1000
committerMatthieu Coudron <teto@users.noreply.github.com>2021-04-15 10:22:29 +0200
commit9c8cb61854439b7ce67272d7449314c51dd71fc4 (patch)
treef448f53d5cc5c46c0de094511eff6e9c21c95e6a /pkgs/applications/version-management/git-and-tools/gh
parent7bf3b1fe952dcc59a8d3e9c5f6c99d6401ee49c7 (diff)
downloadnixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.tar
nixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.tar.gz
nixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.tar.bz2
nixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.tar.lz
nixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.tar.xz
nixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.tar.zst
nixpkgs-9c8cb61854439b7ce67272d7449314c51dd71fc4.zip
gh: 1.8.1 -> 1.9.0
https://github.com/cli/cli/releases/tag/v1.9.0
Diffstat (limited to 'pkgs/applications/version-management/git-and-tools/gh')
-rw-r--r--pkgs/applications/version-management/git-and-tools/gh/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/gh/default.nix b/pkgs/applications/version-management/git-and-tools/gh/default.nix
index 6b79d152380..d8b4e414f1c 100644
--- a/pkgs/applications/version-management/git-and-tools/gh/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/gh/default.nix
@@ -2,25 +2,33 @@
 
 buildGoModule rec {
   pname = "gh";
-  version = "1.8.1";
+  version = "1.9.0";
 
   src = fetchFromGitHub {
     owner = "cli";
     repo = "cli";
     rev = "v${version}";
-    sha256 = "1q0vc9wr4n813mxkf7jjj3prw1n7xv4l985qd57pg4a2js1dqa1y";
+    sha256 = "03i1x1j07vpq81c9dmpvpya21hwz9q54zm4przvc12jadgb31y1i";
   };
 
-  vendorSha256 = "1wv30z0jg195nkpz3rwvhixyw81lg2wzwwajq9g6s3rfjj8gs9v2";
+  vendorSha256 = "0j2jy7n7hca5ybwwgh7cvm77j96ngaq1a1l5bl70vjpd8hz2qapc";
 
   nativeBuildInputs = [ installShellFiles ];
 
+  # upstream unsets these to handle cross but it breaks our build
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "GOOS= GOARCH= GOARM= GOFLAGS= CGO_ENABLED=" ""
+  '';
+
   buildPhase = ''
-    export GO_LDFLAGS="-s -w"
-    make GH_VERSION=${version} bin/gh manpages
+    runHook preBuild
+    make GO_LDFLAGS="-s -w" GH_VERSION=${version} bin/gh manpages
+    runHook postBuild
   '';
 
   installPhase = ''
+    runHook preInstall
     install -Dm755 bin/gh -t $out/bin
     installManPage share/man/*/*.[1-9]
 
@@ -28,6 +36,7 @@ buildGoModule rec {
       $out/bin/gh completion -s $shell > gh.$shell
       installShellCompletion gh.$shell
     done
+    runHook postInstall
   '';
 
   # fails with `unable to find git executable in PATH`