Merge pull request #220027 from Luflosi/add/go-licenses

authored by Sandro and committed by GitHub 94c37918 db230269

+115
+48
pkgs/development/tools/misc/go-licenses/default.nix
··· 1 + { lib 2 + , buildGoModule 3 + , fetchFromGitHub 4 + , installShellFiles 5 + }: 6 + 7 + buildGoModule rec { 8 + pname = "go-licenses"; 9 + version = "1.6.0"; 10 + 11 + src = fetchFromGitHub { 12 + owner = "google"; 13 + repo = "go-licenses"; 14 + rev = "refs/tags/v${version}"; 15 + hash = "sha256-GAlwTVoVA+n9+EfhybmpKm16FoY9kFzrxy1ZQxS6A8E="; 16 + }; 17 + 18 + vendorHash = "sha256-ToRn2wj7Yi+UDJwvAhV0ACEhqlcQjt4bRpz7abNRt9A="; 19 + 20 + patches = [ 21 + # Without this, we get error messages like: 22 + # 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) 23 + # The patch was generated by changing "go 1.16" to "go 1.17" and executing `go mod tidy`. 24 + ./fix-go-version-error.patch 25 + ]; 26 + 27 + nativeBuildInputs = [ 28 + installShellFiles 29 + ]; 30 + 31 + postInstall = '' 32 + installShellCompletion --cmd go-licenses \ 33 + --bash <("$out/bin/go-licenses" completion bash) \ 34 + --fish <("$out/bin/go-licenses" completion fish) \ 35 + --zsh <("$out/bin/go-licenses" completion zsh) 36 + ''; 37 + 38 + # Tests require internet connection 39 + doCheck = false; 40 + 41 + meta = with lib; { 42 + changelog = "https://github.com/google/go-licenses/releases/tag/v${version}"; 43 + description = "Reports on the licenses used by a Go package and its dependencies"; 44 + homepage = "https://github.com/google/go-licenses"; 45 + license = with licenses; [ asl20 ]; 46 + maintainers = with maintainers; [ Luflosi ]; 47 + }; 48 + }
+65
pkgs/development/tools/misc/go-licenses/fix-go-version-error.patch
··· 1 + diff --git a/go.mod b/go.mod 2 + index 7e3d596..d90b393 100644 3 + --- a/go.mod 4 + +++ b/go.mod 5 + @@ -1,27 +1,50 @@ 6 + module github.com/google/go-licenses 7 + 8 + -go 1.16 9 + +go 1.17 10 + 11 + require ( 12 + - cloud.google.com/go/iam v0.4.0 // indirect 13 + - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 14 + github.com/google/go-cmp v0.5.8 15 + github.com/google/go-replayers/httpreplay v1.1.1 16 + github.com/google/licenseclassifier v0.0.0-20210722185704-3043a050f148 17 + - github.com/kr/text v0.2.0 // indirect 18 + - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect 19 + github.com/otiai10/copy v1.6.0 20 + - github.com/pkg/errors v0.9.1 // indirect 21 + - github.com/sergi/go-diff v1.2.0 // indirect 22 + github.com/spf13/cobra v1.6.0 23 + - github.com/stretchr/testify v1.8.0 // indirect 24 + go.opencensus.io v0.23.0 25 + - golang.org/x/crypto v0.1.0 // indirect 26 + golang.org/x/mod v0.7.0 27 + golang.org/x/net v0.5.0 28 + golang.org/x/text v0.6.0 29 + golang.org/x/tools v0.5.0 30 + - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect 31 + gopkg.in/src-d/go-git.v4 v4.13.1 32 + k8s.io/klog/v2 v2.80.1 33 + ) 34 + + 35 + +require ( 36 + + cloud.google.com/go v0.102.1 // indirect 37 + + cloud.google.com/go/iam v0.4.0 // indirect 38 + + cloud.google.com/go/storage v1.22.1 // indirect 39 + + github.com/emirpasic/gods v1.12.0 // indirect 40 + + github.com/go-logr/logr v1.2.0 // indirect 41 + + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 42 + + github.com/google/martian/v3 v3.3.2 // indirect 43 + + github.com/inconshreveable/mousetrap v1.0.1 // indirect 44 + + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect 45 + + github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect 46 + + github.com/kr/text v0.2.0 // indirect 47 + + github.com/mitchellh/go-homedir v1.1.0 // indirect 48 + + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect 49 + + github.com/pkg/errors v0.9.1 // indirect 50 + + github.com/sergi/go-diff v1.2.0 // indirect 51 + + github.com/spf13/pflag v1.0.5 // indirect 52 + + github.com/src-d/gcfg v1.4.0 // indirect 53 + + github.com/stretchr/testify v1.8.0 // indirect 54 + + github.com/xanzy/ssh-agent v0.2.1 // indirect 55 + + golang.org/x/crypto v0.1.0 // indirect 56 + + golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect 57 + + golang.org/x/sys v0.4.0 // indirect 58 + + google.golang.org/api v0.93.0 // indirect 59 + + google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 // indirect 60 + + google.golang.org/grpc v1.48.0 // indirect 61 + + google.golang.org/protobuf v1.28.1 // indirect 62 + + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect 63 + + gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect 64 + + gopkg.in/warnings.v0 v0.1.2 // indirect 65 + +)
+2
pkgs/top-level/all-packages.nix
··· 18066 18066 gnumake = callPackage ../development/tools/build-managers/gnumake { }; 18067 18067 gnumake42 = callPackage ../development/tools/build-managers/gnumake/4.2 { }; 18068 18068 18069 + go-licenses = callPackage ../development/tools/misc/go-licenses { }; 18070 + 18069 18071 gob2 = callPackage ../development/tools/misc/gob2 { }; 18070 18072 18071 18073 gocd-agent = callPackage ../development/tools/continuous-integration/gocd-agent { };