summaryrefslogtreecommitdiff
blob: 21d65102b61a064ebb115bcb71f83894f438b078 (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="A user-friendly launcher for Bazel written in Go"
HOMEPAGE="https://github.com/bazelbuild/bazelisk/"
SRC_URI="
	https://github.com/bazelbuild/${PN}/archive/refs/tags/v${PV}.tar.gz
		-> ${P}.tar.gz
	https://dev.gentoo.org/~xgqt/distfiles/deps/${P}-deps.tar.xz
"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DOCS=( CONTRIBUTING.md README.md )

src_compile() {
	mkdir -p bin || die

	local go_ldflags="-X main.BazeliskVersion=${PV}"
	local -a go_buildargs=(
		-ldflags "${go_ldflags}"
		-o bin
	)
	ego build "${go_buildargs[@]}"
}

src_install() {
	exeinto /usr/bin
	doexe "bin/${PN}"

	einstalldocs
}