Commit 5ca2c4b2 authored by Antoine du Hamel's avatar Antoine du Hamel Committed by zowoq
Browse files

gh: fix `--version` showing date in the 80s

parent 42bb244e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -23,9 +23,11 @@ buildGoModule rec {

  nativeBuildInputs = [ installShellFiles ];

  # N.B.: using the Makefile is intentional.
  # We pass "nixpkgs" for build.Date to avoid `gh --version` reporting a very old date.
  buildPhase = ''
    runHook preBuild
    make GO_LDFLAGS="-s -w" GH_VERSION=${version} bin/gh ${lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) "manpages"}
    make GO_LDFLAGS="-s -w -X github.com/cli/cli/v${lib.versions.major version}/internal/build.Date=nixpkgs" GH_VERSION=${version} bin/gh ${lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) "manpages"}
    runHook postBuild
  '';