Gentoo Archives: gentoo-commits

From: Randall Vasquez <ran.dall@××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-go/staticcheck/
Date: Sat, 30 Jul 2022 16:47:28
Message-Id: 1659199520.5bc15cbab4396c53f1f5a627241bd90ff95246e1.ran.dall@gentoo
1 commit: 5bc15cbab4396c53f1f5a627241bd90ff95246e1
2 Author: Randall T. Vasquez <ran.dall <AT> icloud <DOT> com>
3 AuthorDate: Sat Jul 30 16:42:39 2022 +0000
4 Commit: Randall Vasquez <ran.dall <AT> icloud <DOT> com>
5 CommitDate: Sat Jul 30 16:45:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5bc15cba
7
8 dev-go/staticcheck: add ebuilds
9
10 Signed-off-by: Randall T. Vasquez <ran.dall <AT> icloud.com>
11
12 dev-go/staticcheck/Manifest | 2 +
13 dev-go/staticcheck/manifest | 14 +++++++
14 dev-go/staticcheck/staticcheck-0.3.3.ebuild | 63 +++++++++++++++++++++++++++++
15 dev-go/staticcheck/staticcheck-9999.ebuild | 63 +++++++++++++++++++++++++++++
16 4 files changed, 142 insertions(+)
17
18 diff --git a/dev-go/staticcheck/Manifest b/dev-go/staticcheck/Manifest
19 new file mode 100644
20 index 000000000..daae6b7a1
21 --- /dev/null
22 +++ b/dev-go/staticcheck/Manifest
23 @@ -0,0 +1,2 @@
24 +DIST staticcheck-0.3.3-deps.tar.xz 8172540 BLAKE2B 2eb71e52ac0f07531787222d121847e2822530828c441c998b9b63582aae6632756d96094897dd03acd7ab1801e56107270671f29b109fd852210deb978014b3 SHA512 7b3216f4f2262f526e26bf20f0028033ea01da6bfa2a03e47ff235032af9d70a16ba80b4e331252039310129940f81334c32e9e1781a5eb888f5017803f723bf
25 +DIST staticcheck-0.3.3.tar.gz 703452 BLAKE2B f4b8bf44057a6f011b3c4e34d0c9215c90867417a6929f155d838db909fa9f1b79412b42f04e63076e06d957fc02b2144c40cb7106542a558f90804b8813e544 SHA512 8099facca4f65a2428b503d1b26d0b3c4fd7494788328b4ccf073f4134dd4e7c46184d8c266762489151d2cf47bc48b9a9f7e687c6dca39b24a58dd6cbad4961
26
27 diff --git a/dev-go/staticcheck/manifest b/dev-go/staticcheck/manifest
28 new file mode 100644
29 index 000000000..c54adb945
30 --- /dev/null
31 +++ b/dev-go/staticcheck/manifest
32 @@ -0,0 +1,14 @@
33 +<?xml version="1.0" encoding="utf-8"?>
34 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
35 +<pkgmetadata>
36 + <maintainer type="person">
37 + <email>ran.dall@××××××.com</email>
38 + <name>Randall Vasquez</name>
39 + </maintainer>
40 + <longdescription lang="en">
41 + The advanced Go linter
42 + </longdescription>
43 + <upstream>
44 + <remote-id type="github">dominikh/go-tools</remote-id>
45 + </upstream>
46 +</pkgmetadata>
47
48 diff --git a/dev-go/staticcheck/staticcheck-0.3.3.ebuild b/dev-go/staticcheck/staticcheck-0.3.3.ebuild
49 new file mode 100644
50 index 000000000..707b28c08
51 --- /dev/null
52 +++ b/dev-go/staticcheck/staticcheck-0.3.3.ebuild
53 @@ -0,0 +1,63 @@
54 +# Copyright 2022 Gentoo Authors
55 +# Distributed under the terms of the GNU General Public License v2
56 +
57 +EAPI=8
58 +
59 +inherit go-module
60 +
61 +DESCRIPTION="The advanced Go linter"
62 +HOMEPAGE="https://staticcheck.io/"
63 +if [[ ${PV} == *9999 ]]; then
64 + inherit git-r3
65 + EGIT_REPO_URI="https://github.com/dominikh/go-tools.git"
66 + RESTRICT="fetch mirror"
67 +else
68 + SRC_URI="https://github.com/dominikh/go-tools/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
69 + SRC_URI+=" https://github.com/ran-dall/portage-deps/raw/master/${P}-deps.tar.xz"
70 + KEYWORDS="~amd64 ~arm64 ~x86"
71 + RESTRICT="mirror"
72 + S="${WORKDIR}/go-tools-${PV}"
73 +fi
74 +
75 +LICENSE="MIT"
76 +SLOT="0"
77 +
78 +IUSE="test"
79 +
80 +DEPEND="dev-lang/go
81 + sys-libs/glibc"
82 +RDEPEND="${DEPEND}"
83 +BDEPEND=""
84 +
85 +RESTRICT="!test? ( test )"
86 +
87 +src_unpack() {
88 + default
89 + if [[ ${PV} == *9999 ]]; then
90 + git-r3_src_unpack
91 + go-module_live_vendor
92 + fi
93 +}
94 +
95 +src_configure() {
96 + export CGO_ENABLED=1
97 + export CGO_CFLAGS="${CFLAGS}"
98 + export CGO_CPPFLAGS="${CPPFLAGS}"
99 + export CGO_CXXFLAGS="${CXXFLAGS}"
100 + export CGO_LDFLAGS="${LDFLAGS}"
101 +
102 + default
103 +}
104 +
105 +src_compile() {
106 + mkdir -pv bin || die
107 + ego build -ldflags "-linkmode=external" -o bin/"${PN}" "./cmd/staticcheck"
108 +}
109 +
110 +src_test() {
111 + GOROOT="${BROOT}/usr/lib/go" ego test -v -ldflags "-linkmode=external" ./...
112 +}
113 +
114 +src_install() {
115 + dobin bin/"${PN}"
116 +}
117
118 diff --git a/dev-go/staticcheck/staticcheck-9999.ebuild b/dev-go/staticcheck/staticcheck-9999.ebuild
119 new file mode 100644
120 index 000000000..707b28c08
121 --- /dev/null
122 +++ b/dev-go/staticcheck/staticcheck-9999.ebuild
123 @@ -0,0 +1,63 @@
124 +# Copyright 2022 Gentoo Authors
125 +# Distributed under the terms of the GNU General Public License v2
126 +
127 +EAPI=8
128 +
129 +inherit go-module
130 +
131 +DESCRIPTION="The advanced Go linter"
132 +HOMEPAGE="https://staticcheck.io/"
133 +if [[ ${PV} == *9999 ]]; then
134 + inherit git-r3
135 + EGIT_REPO_URI="https://github.com/dominikh/go-tools.git"
136 + RESTRICT="fetch mirror"
137 +else
138 + SRC_URI="https://github.com/dominikh/go-tools/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
139 + SRC_URI+=" https://github.com/ran-dall/portage-deps/raw/master/${P}-deps.tar.xz"
140 + KEYWORDS="~amd64 ~arm64 ~x86"
141 + RESTRICT="mirror"
142 + S="${WORKDIR}/go-tools-${PV}"
143 +fi
144 +
145 +LICENSE="MIT"
146 +SLOT="0"
147 +
148 +IUSE="test"
149 +
150 +DEPEND="dev-lang/go
151 + sys-libs/glibc"
152 +RDEPEND="${DEPEND}"
153 +BDEPEND=""
154 +
155 +RESTRICT="!test? ( test )"
156 +
157 +src_unpack() {
158 + default
159 + if [[ ${PV} == *9999 ]]; then
160 + git-r3_src_unpack
161 + go-module_live_vendor
162 + fi
163 +}
164 +
165 +src_configure() {
166 + export CGO_ENABLED=1
167 + export CGO_CFLAGS="${CFLAGS}"
168 + export CGO_CPPFLAGS="${CPPFLAGS}"
169 + export CGO_CXXFLAGS="${CXXFLAGS}"
170 + export CGO_LDFLAGS="${LDFLAGS}"
171 +
172 + default
173 +}
174 +
175 +src_compile() {
176 + mkdir -pv bin || die
177 + ego build -ldflags "-linkmode=external" -o bin/"${PN}" "./cmd/staticcheck"
178 +}
179 +
180 +src_test() {
181 + GOROOT="${BROOT}/usr/lib/go" ego test -v -ldflags "-linkmode=external" ./...
182 +}
183 +
184 +src_install() {
185 + dobin bin/"${PN}"
186 +}