mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-03 15:01:44 +01:00
91 lines
2.6 KiB
Plaintext
91 lines
2.6 KiB
Plaintext
# Contributor: Oleg Titov <oleg.titov@gmail.com>
|
|
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
|
|
pkgname=bazel2
|
|
pkgver=2.2.0
|
|
pkgrel=1
|
|
pkgdesc="A fast, scalable, multi-language and extensible build system"
|
|
url="https://bazel.build/"
|
|
#arch="x86_64"
|
|
license="Apache-2.0"
|
|
depends="bash libarchive java-jdk zip unzip"
|
|
makedepends="python3 linux-headers protobuf coreutils"
|
|
options="!strip"
|
|
replaces="bazel"
|
|
provides="bazel=$pkgver-r$pkgrel"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-bash-completion
|
|
$pkgname-zsh-completion
|
|
$pkgname-examples::noarch
|
|
"
|
|
source="https://github.com/bazelbuild/bazel/releases/download/$pkgver/bazel-$pkgver-dist.zip"
|
|
|
|
build() {
|
|
# based on
|
|
# https://github.com/vbatts/copr-build-bazel/blob/master/bazel.spec
|
|
export EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk"
|
|
export JAVA_HOME="/usr/lib/jvm/default-jvm/jre"
|
|
|
|
# horrible of horribles, just to have python in the PATH
|
|
# https://github.com/bazelbuild/bazel/issues/8665
|
|
mkdir -p ./bin-hack
|
|
ln -s /usr/bin/python3 ./bin-hack/python
|
|
export PATH=$(pwd)/bin-hack:$PATH
|
|
|
|
bash ./compile.sh
|
|
|
|
./output/bazel shutdown
|
|
|
|
./scripts/generate_bash_completion.sh \
|
|
--bazel=output/bazel \
|
|
--output=output/bazel-complete.bash \
|
|
--prepend=scripts/bazel-complete-header.bash \
|
|
--prepend=scripts/bazel-complete-template.bash
|
|
|
|
echo startup --server_javabase=$JAVA_HOME \
|
|
>> scripts/packages/bazel.bazelrc
|
|
}
|
|
|
|
check() {
|
|
./output/bazel test \
|
|
--verbose_failures \
|
|
--spawn_strategy=standalone \
|
|
--genrule_strategy=standalone \
|
|
--verbose_test_summary \
|
|
--test_verbose_timeout_warnings \
|
|
examples/cpp:hello-success_test
|
|
|
|
./output/bazel shutdown
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 ./scripts/packages/bazel.sh "$pkgdir"/usr/bin/bazel
|
|
install -Dm755 ./output/bazel "$pkgdir"/usr/bin/bazel-real
|
|
install -Dm755 ./scripts/packages/bazel.bazelrc \
|
|
"$pkgdir"/etc/bazel.bazelrc
|
|
|
|
mkdir -p "$pkgdir"/usr/share/bash-completion/completions
|
|
mv "$builddir"/output/bazel-complete.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/bazel
|
|
|
|
mkdir -p "$pkgdir"/usr/share/zsh/site-functions
|
|
mv "$builddir"/scripts/zsh_completion/_bazel \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_bazel
|
|
|
|
install -m644 -D -t "$pkgdir"/usr/share/doc/$pkgname README.md
|
|
}
|
|
|
|
examples() {
|
|
mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname"
|
|
for d in examples third_party tools; do
|
|
mv "$builddir/$d" "$subpkgdir/usr/share/doc/$pkgname"
|
|
done
|
|
}
|
|
|
|
unpack() {
|
|
mkdir -p "$builddir"
|
|
unzip "$srcdir"/bazel-$pkgver-dist.zip -d "$builddir" > /dev/null
|
|
}
|
|
|
|
sha512sums="67011c3a045c0fd74cdcb98eef1c3ead6902a3bd65a629fe49911f9dbb4c39508bd91eb63c1fae68284136ad4994afb42a01c7f10983614e432f8be22a1c566e bazel-2.2.0-dist.zip"
|