10 pname = "go-licenses";
13 src = fetchFromGitHub {
16 rev = "refs/tags/v${version}";
17 hash = "sha256-GAlwTVoVA+n9+EfhybmpKm16FoY9kFzrxy1ZQxS6A8E=";
20 vendorHash = "sha256-ToRn2wj7Yi+UDJwvAhV0ACEhqlcQjt4bRpz7abNRt9A=";
23 # Without this, we get error messages like:
24 # vendor/golang.org/x/sys/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
25 # The patch was generated by changing "go 1.16" to "go 1.17" and executing `go mod tidy`.
26 ./fix-go-version-error.patch
34 subPackages = [ "." ];
36 allowGoReference = true;
39 installShellCompletion --cmd go-licenses \
40 --bash <("$out/bin/go-licenses" completion bash) \
41 --fish <("$out/bin/go-licenses" completion fish) \
42 --zsh <("$out/bin/go-licenses" completion zsh)
44 # workaround empty output when GOROOT differs from built environment
45 # see https://github.com/google/go-licenses/issues/149
46 wrapProgram "$out/bin/go-licenses" \
47 --set GOROOT '${go}/share/go'
50 # Tests require internet connection
54 changelog = "https://github.com/google/go-licenses/releases/tag/v${version}";
55 description = "Reports on the licenses used by a Go package and its dependencies";
56 mainProgram = "go-licenses";
57 homepage = "https://github.com/google/go-licenses";
58 license = with licenses; [ asl20 ];
59 maintainers = with maintainers; [ Luflosi ];