SHARE
TWEET

bazel-git PKGBUILD

a guest Apr 26th, 2015 267 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Simon Legner <Simon.Legner@gmail.com>
  2. pkgname=bazel-git
  3. pkgver=r858.18629fb
  4. pkgrel=1
  5. pkgdesc="Correct, reproducible, and fast builds for everyone"
  6. arch=('i686' 'x86_64')
  7. url="http://bazel.io/"
  8. license=('Apache')
  9. depends=('java-environment' 'libarchive' 'gcc-libs-multilib' 'zip' 'unzip')
  10. makedepends=('git' 'protobuf')
  11. install=bazel.install
  12. options=('!strip')
  13.  
  14. _gitroot=https://github.com/google/bazel.git
  15. _gitname=bazel
  16.  
  17. pkgver() {
  18.   cd "$srcdir/$_gitname"
  19.   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  20. }
  21.  
  22. build() {
  23.   cd "$srcdir"
  24.   msg "Connecting to GIT server...."
  25.  
  26.   if [[ -d "$_gitname" ]]; then
  27.     cd "$_gitname" && git pull origin
  28.     msg "The local files are updated."
  29.   else
  30.     git clone "$_gitroot" "$_gitname"
  31.   fi
  32.  
  33.   msg "GIT checkout done or server timeout"
  34.   msg "Starting build..."
  35.  
  36.   rm -rf "$srcdir/$_gitname-build"
  37.   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  38.   cd "$srcdir/$_gitname-build"
  39.  
  40.   #
  41.   # BUILD HERE
  42.   #
  43.   ./compile.sh
  44.   output/./bazel build scripts:bazel-complete.bash
  45. }
  46.  
  47. package() {
  48.   install -Dm755 "$srcdir/$_gitname-build/output/bazel" "$pkgdir/usr/bin/bazel"
  49.   mkdir -p "$pkgdir/opt/bazel/base_workspace"
  50.   mkdir -p "$pkgdir/etc/bash_completion.d"
  51.   install -Dm755 "$srcdir/$_gitname-build/bazel-bin/scripts/bazel-complete.bash" "$pkgdir/etc/bash_completion.d/"
  52.   for d in examples third_party tools; do
  53.     cp -r "$srcdir/$_gitname-build/$d" "$pkgdir/opt/bazel/"
  54.     cd "$pkgdir/opt/bazel/base_workspace"
  55.     ln -s "/opt/bazel/$d" ./
  56.   done
  57. }
  58.  
  59. # vim:set ts=2 sw=2 et:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top