mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 12:03:02 -04:00
dev-go/staticcheck: add ebuilds
Signed-off-by: Randall T. Vasquez <ran.dall@icloud.com>
This commit is contained in:
63
dev-go/staticcheck/staticcheck-0.3.3.ebuild
Normal file
63
dev-go/staticcheck/staticcheck-0.3.3.ebuild
Normal file
@@ -0,0 +1,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}"
|
||||
}
|
||||
Reference in New Issue
Block a user