dev-build/bazel-buildtools: new package; add 7.3.1

Signed-off-by: Maciej Barć <xgqt@gentoo.org>
This commit is contained in:
Maciej Barć
2024-10-20 01:28:52 +02:00
parent 419035b78d
commit ecb3896848
3 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DIST bazel-buildtools-7.3.1-deps.tar.xz 3588840 BLAKE2B 9b0766803201b9bee5329865714b9ed798b06b32b77f3b80efbd31fe9cbe8f6397f9a29c9e0947b1609ae20a697bddb8c2db934c28609aa58bfd9cf343dab923 SHA512 136c1493f688b4b90d31a7f90c3c8e3e62cc26824dcf679d321a649c99638780fcd27771c31e21d6afc0272b249cbfdaf78a07fa2335c904c1f966da1ca0b561
DIST bazel-buildtools-7.3.1.tar.gz 330909 BLAKE2B 15d3ce94411bbc33f166b15f94699ac4fee373ff29f7f8226800776845611f29b1e0557bb62441fa62540792b63f634062de376ba1587e7c91d0504d6a66424f SHA512 3c06bdf7b6bb7cbe9a9f455e31be16bf36b97769515c761bda2e11a39d4eb12d8e65e7ea051e58ad26b782a93fadb5dd8221c30f75cc96d5ddd3abadce7fdbe2

View File

@@ -0,0 +1,69 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
APP_PN="buildtools"
inherit go-module
DESCRIPTION="Tools for working with Google's Bazel BUILD files."
HOMEPAGE="https://github.com/bazelbuild/buildtools/"
if [[ "${PV}" == *9999* ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/bazelbuild/${APP_PN}.git"
else
SRC_URI="https://github.com/bazelbuild/${APP_PN}/archive/refs/tags/v${PV}.tar.gz
-> ${P}.tar.gz"
S="${WORKDIR}/${APP_PN}-${PV}"
KEYWORDS="~amd64 ~x86"
fi
SRC_URI+="
https://dev.gentoo.org/~xgqt/distfiles/deps/${P}-deps.tar.xz
"
LICENSE="Apache-2.0"
SLOT="0"
DOCS=( README.md WARNINGS.md )
src_prepare() {
default
rm ./warn/docs/docs.go || die
}
src_compile() {
local -r go_ldopts="
-X main.buildScmRevision=v${PV}
-X main.buildVersion=${PV}
"
local -a -r go_buildopts=(
-ldflags "${go_ldopts}"
-o ./bin/
)
ego build "${go_buildopts[@]}" ./...
}
src_install() {
exeinto /usr/bin
doexe ./bin/{buildifier{,2},buildozer}
newexe ./bin/generatetables bazel-generatetables
newexe ./bin/unused_deps bazel-unused_deps
local app=""
for app in buildifier buildozer unused_deps ; do
newdoc "${S}/${app}/README.md" "${app}.md"
done
einstalldocs
}
pkg_postinst() {
einfo 'The "generatetables" binary is installed as "bazel-generatetables"'
einfo 'and the "unused_deps" binary is installed as "bazel-unused_deps"'.
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>xgqt@gentoo.org</email>
<name>Maciej Barć</name>
</maintainer>
<longdescription>
Bazel buildtools contain: 1. buildifier - for formatting BUILD,
BUILD.bazel and BUCK files in a standard way, 2. buildozer - for doing
command-line operations on these files, 3. unused_deps - for finding
unneeded dependencies in java_library rules.
</longdescription>
<upstream>
<bugs-to>https://github.com/bazelbuild/buildtools/issues/</bugs-to>
<remote-id type="github">bazelbuild/buildtools</remote-id>
</upstream>
</pkgmetadata>