mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 20:34:06 +00:00
Merge pull request #279620 from SuperSandro2000/go-licenses-fix
go-licenses: fix returning empty output when GOROOT differs from built environment
This commit is contained in:
commit
1e48199264
@ -1,7 +1,9 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, go
|
||||
, installShellFiles
|
||||
, makeWrapper
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@ -26,13 +28,23 @@ buildGoModule rec {
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
allowGoReference = true;
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd go-licenses \
|
||||
--bash <("$out/bin/go-licenses" completion bash) \
|
||||
--fish <("$out/bin/go-licenses" completion fish) \
|
||||
--zsh <("$out/bin/go-licenses" completion zsh)
|
||||
|
||||
# workaround empty output when GOROOT differs from built environment
|
||||
# see https://github.com/google/go-licenses/issues/149
|
||||
wrapProgram "$out/bin/go-licenses" \
|
||||
--set GOROOT '${go}/share/go'
|
||||
'';
|
||||
|
||||
# Tests require internet connection
|
||||
|
Loading…
Reference in New Issue
Block a user