summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: db2df6fc22334921d8cbc122b96cbbea02d84470 (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
pkgname=briar-headless
conflicts=('briar-headless-git')
pkgver=1.4.18
pkgrel=1
pkgdesc='Briar REST API'
arch=('x86_64' 'armv7h' 'aarch64')
url="https://code.briarproject.org/briar/briar"
license=('GPL')
depends=('java-runtime=11' 'bash')
makedepends=('git' 'jdk11-openjdk')
source=("${pkgname}::git+https://code.briarproject.org/briar/briar.git#tag=release-${pkgver}")
sha256sums=('SKIP')

case "$CARCH" in
  armv7h)
    _gradle_arch='armhf'
  ;;
  aarch64)
    _gradle_arch='aarch64'
  ;;
  *)
    _gradle_arch='x86'
  ;;
esac

build() {
  cd "${pkgname}"
  export PATH="/usr/lib/jvm/java-11-openjdk/jre/bin/:$PATH"
  export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
 ./gradlew --configure-on-demand briar-headless:${_gradle_arch}LinuxJar
}

package() {
  cd "${pkgname}/${pkgname}"
  install -dm755 "$pkgdir/usr/bin/"
  cat << EOF > "$pkgdir/usr/bin/$pkgname"
#!/bin/sh
exec /usr/bin/java -jar '/usr/share/java/briar-headless.jar' "\$@"
EOF
  chmod +x "$pkgdir/usr/bin/$pkgname"

  install -m 644 -D "build/libs/${pkgname}-linux-${CARCH}.jar" "$pkgdir/usr/share/java/${pkgname}.jar"
}