blob: 707b28c08202cdc4e50bd83f8c5c5896c993e4a6 (
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
|
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module
DESCRIPTION="The advanced Go linter"
HOMEPAGE="https://staticcheck.io/"
if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dominikh/go-tools.git"
RESTRICT="fetch mirror"
else
SRC_URI="https://github.com/dominikh/go-tools/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://github.com/ran-dall/portage-deps/raw/master/${P}-deps.tar.xz"
KEYWORDS="~amd64 ~arm64 ~x86"
RESTRICT="mirror"
S="${WORKDIR}/go-tools-${PV}"
fi
LICENSE="MIT"
SLOT="0"
IUSE="test"
DEPEND="dev-lang/go
sys-libs/glibc"
RDEPEND="${DEPEND}"
BDEPEND=""
RESTRICT="!test? ( test )"
src_unpack() {
default
if [[ ${PV} == *9999 ]]; then
git-r3_src_unpack
go-module_live_vendor
fi
}
src_configure() {
export CGO_ENABLED=1
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
default
}
src_compile() {
mkdir -pv bin || die
ego build -ldflags "-linkmode=external" -o bin/"${PN}" "./cmd/staticcheck"
}
src_test() {
GOROOT="${BROOT}/usr/lib/go" ego test -v -ldflags "-linkmode=external" ./...
}
src_install() {
dobin bin/"${PN}"
}
|