summaryrefslogtreecommitdiff
blob: 9dadfccb67c940bafa252615c8f7af9167419638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="Reports on the licenses used by a Go package and its dependencies"
HOMEPAGE="https://github.com/google/go-licenses"
LICENSE="Apache-2.0 MIT BSD BSD-2"
SLOT="0"

EGO_PN=github.com/google/${PN}
EGIT_REPO_URI="https://${EGO_PN}.git"

inherit go-module

if [[ ${PV} == *9999* ]]; then
	inherit git-r3

	src_unpack() {
		git-r3_src_unpack
		go-module_live_vendor
	}
else
	KEYWORDS="~amd64"
	EGIT_COMMIT="e4cf7a36ee79ac1f69725aa13111ae9383447ba3"
	SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"

	EGO_SUM=(
		"github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7"
		"github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239"
		"github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5"
		"github.com/davecgh/go-spew v1.1.1"
		"github.com/emirpasic/gods v1.12.0"
		"github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568"
		"github.com/gliderlabs/ssh v0.2.2"
		"github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b"
		"github.com/google/go-cmp v0.3.1"
		"github.com/google/licenseclassifier v0.0.0-20190926221455-842c0d70d702"
		"github.com/inconshreveable/mousetrap v1.0.0"
		"github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99"
		"github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd"
		"github.com/kr/pretty v0.1.0"
		"github.com/kr/text v0.1.0"
		"github.com/mitchellh/go-homedir v1.1.0"
		"github.com/otiai10/copy v1.1.1"
		"github.com/otiai10/curr v1.0.0"
		"github.com/otiai10/mint v1.3.1"
		"github.com/pkg/errors v0.8.1"
		"github.com/pmezard/go-difflib v1.0.0"
		"github.com/sergi/go-diff v1.0.0"
		"github.com/spf13/cobra v0.0.5"
		"github.com/spf13/pflag v1.0.5"
		"github.com/src-d/gcfg v1.4.0"
		"github.com/stretchr/testify v1.3.0"
		"github.com/xanzy/ssh-agent v0.2.1"
		"golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4"
		"golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f"
		"golang.org/x/net v0.0.0-20190724013045-ca1201d0de80"
		"golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914"
		"golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e"
		"golang.org/x/sys v0.0.0-20191119060738-e882bf8e40c2"
		"golang.org/x/text v0.3.2"
		"golang.org/x/tools v0.0.0-20191118222007-07fc4c7f2b98"
		"gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127"
		"gopkg.in/src-d/go-billy.v4 v4.3.2"
		"gopkg.in/src-d/go-git-fixtures.v3 v3.5.0"
		"gopkg.in/src-d/go-git.v4 v4.13.1"
		"gopkg.in/warnings.v0 v0.1.2"

		"github.com/BurntSushi/toml v0.3.1/go.mod"
		"github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod"
		"github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod"
		"github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod"
		"github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod"
		"github.com/coreos/etcd v3.3.10+incompatible/go.mod"
		"github.com/coreos/go-etcd v2.0.0+incompatible/go.mod"
		"github.com/coreos/go-semver v0.2.0/go.mod"
		"github.com/cpuguy83/go-md2man v1.0.10/go.mod"
		"github.com/creack/pty v1.1.7/go.mod"
		"github.com/davecgh/go-spew v1.1.0/go.mod"
		"github.com/davecgh/go-spew v1.1.1/go.mod"
		"github.com/emirpasic/gods v1.12.0/go.mod"
		"github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod"
		"github.com/fsnotify/fsnotify v1.4.7/go.mod"
		"github.com/gliderlabs/ssh v0.2.2/go.mod"
		"github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod"
		"github.com/google/go-cmp v0.2.0/go.mod"
		"github.com/google/go-cmp v0.3.0/go.mod"
		"github.com/google/go-cmp v0.3.1/go.mod"
		"github.com/google/licenseclassifier v0.0.0-20190926221455-842c0d70d702/go.mod"
		"github.com/hashicorp/hcl v1.0.0/go.mod"
		"github.com/inconshreveable/mousetrap v1.0.0/go.mod"
		"github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod"
		"github.com/jessevdk/go-flags v1.4.0/go.mod"
		"github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod"
		"github.com/kr/pretty v0.1.0/go.mod"
		"github.com/kr/pty v1.1.1/go.mod"
		"github.com/kr/pty v1.1.8/go.mod"
		"github.com/kr/text v0.1.0/go.mod"
		"github.com/magiconair/properties v1.8.0/go.mod"
		"github.com/mitchellh/go-homedir v1.1.0/go.mod"
		"github.com/mitchellh/mapstructure v1.1.2/go.mod"
		"github.com/otiai10/copy v1.1.1/go.mod"
		"github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod"
		"github.com/otiai10/curr v1.0.0/go.mod"
		"github.com/otiai10/mint v1.3.0/go.mod"
		"github.com/otiai10/mint v1.3.1/go.mod"
		"github.com/pelletier/go-buffruneio v0.2.0/go.mod"
		"github.com/pelletier/go-toml v1.2.0/go.mod"
		"github.com/pkg/errors v0.8.1/go.mod"
		"github.com/pmezard/go-difflib v1.0.0/go.mod"
		"github.com/russross/blackfriday v1.5.2/go.mod"
		"github.com/sergi/go-diff v1.0.0/go.mod"
		"github.com/spf13/afero v1.1.2/go.mod"
		"github.com/spf13/cast v1.3.0/go.mod"
		"github.com/spf13/cobra v0.0.5/go.mod"
		"github.com/spf13/jwalterweatherman v1.0.0/go.mod"
		"github.com/spf13/pflag v1.0.3/go.mod"
		"github.com/spf13/pflag v1.0.5/go.mod"
		"github.com/spf13/viper v1.3.2/go.mod"
		"github.com/src-d/gcfg v1.4.0/go.mod"
		"github.com/stretchr/objx v0.1.0/go.mod"
		"github.com/stretchr/objx v0.2.0/go.mod"
		"github.com/stretchr/testify v1.2.2/go.mod"
		"github.com/stretchr/testify v1.3.0/go.mod"
		"github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod"
		"github.com/xanzy/ssh-agent v0.2.1/go.mod"
		"github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod"
		"golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod"
		"golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod"
		"golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod"
		"golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod"
		"golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f/go.mod"
		"golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod"
		"golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod"
		"golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod"
		"golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914/go.mod"
		"golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod"
		"golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod"
		"golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod"
		"golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod"
		"golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod"
		"golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod"
		"golang.org/x/sys v0.0.0-20191119060738-e882bf8e40c2/go.mod"
		"golang.org/x/text v0.3.0/go.mod"
		"golang.org/x/text v0.3.2/go.mod"
		"golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod"
		"golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod"
		"golang.org/x/tools v0.0.0-20191118222007-07fc4c7f2b98/go.mod"
		"golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod"
		"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod"
		"gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod"
		"gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod"
		"gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod"
		"gopkg.in/src-d/go-git.v4 v4.13.1/go.mod"
		"gopkg.in/warnings.v0 v0.1.2/go.mod"
		"gopkg.in/yaml.v2 v2.2.2/go.mod"
	)

	S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
fi

go-module_set_globals
SRC_URI+=" ${EGO_SUM_SRC_URI}"

DEPEND="dev-go/licenseclassifier"
RDEPEND="${DEPEND}"

# tries to go online
RESTRICT="test"

src_prepare() {
	eapply_user

	local share="${EROOT}/usr/share/licenseclassifier"

	local vendored_const_path="vendor/github.com/google/licenseclassifier"
	go mod vendor || die

	sed -i "s@= lcRoot()@= \"${share}\", error(nil)@" \
		"${vendored_const_path}"*/file_system_resources.go || die
}

src_compile() {
	mkdir build || die
	GOFLAGS="-mod=vendor -v -x" go build -o build ./... || die
}

src_test() {
	go test ./... || die
}

src_install() {
	dobin "build/${PN}"
	einstalldocs
}