Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 50 lines (36 sloc) 1.21 KB
#! /bin/bash
PKG=bazel
VERSION=5.4.1
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi
set -xe
umask 022
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.$USER.build.tmp
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR )
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi
EOF
. $PREFIX/profile
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
# https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-dist.zip
BEEHIVE=https://beehive.molgen.mpg.de/0adff930095c57e5df28bf2f735db2d1/bazel-5.4.1-dist.zip
test -e bazel-$VERSION-dist.zip || wget -nv $BEEHIVE
if [ ! -d bazel-$VERSION ]; then
mkdir bazel-$VERSION
unzip -q bazel-$VERSION-dist.zip -d bazel-$VERSION
fi
cd bazel-$VERSION
source /package/pkg/openjdk-11.0.3.2-0/profile
EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
mkdir -p $PREFIX/bin
cp -vp output/bazel $PREFIX/bin
exit