summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6d74e3db3664174ff1e07e4e688d8ba35ae13ad5 (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
39
40
41
42
43
44
45
46
47
# Maintainer: Kenneth Endfinger <kaendfinger@gmail.com>
# Contributor: Joel Goguen <contact+aur@jgoguen.ca>

pkgname=buck-git
pkgver=2019.10.17.01.r1034.g89a0c4c70c
pkgrel=1
pkgdesc='A fast build system that encourages the creation of small, \
	   reusable modules over a variety of platforms and languages.'
arch=('any')
depends=('python2')
makedepends=('java-environment=11' 'ant' 'git')
optdepends=('watchman: prevent Buck from parsing all of your build files every time')
conflicts=('buck')
provides=('buck')
url='https://buckbuild.com'
license=('Apache')
source=("git+https://github.com/facebook/${pkgname%-git}.git")
sha256sums=('SKIP')

prepare() {
  sed -i 's+executable="python"+executable="python2"+g' ${pkgname%-git}/build.xml
}

pkgver() {
  cd "${pkgname%-git}"
  git describe --tags | sed 's+-+.r+' | tr - . | cut -c2-
}

build() {
  cd "${pkgname%-git}"
  ant
  ./bin/buck build buck
}

package() {
  cd "${pkgname%-git}"
  BINPATH=$(./bin/buck targets --show_output buck | cut -d' ' -f2)
  install -Dm 755 "${BINPATH}" "${pkgdir}"/usr/bin/buck
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  ./bin/buck kill

  # Remove package srcdir from watchman watch list.
  if command -v watchman > /dev/null
  then
    watchman --no-spawn --no-local watch-del "${srcdir}/${pkgname%-git}" > /dev/null 2>&1 || true
  fi
}