summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e364d027183d7a8a2fbe8ec5081d172ff029e0bf (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
# Maintainer: algebro <algebro at tuta dot io>
# Contributor: Adrian Petrescu <apetresc at gmail dot com>

pkgname=lizzie-git
_pkgname=lizzie
pkgver=0.6.r19.g6fa818e
_pkgver=0.6
pkgrel=1
pkgdesc="Analysis interface for Leela Zero"
arch=('x86_64')
url="https://github.com/featurecat/lizzie"
license=('GPLv3')
depends=('bash' 'java-runtime' 'leela-zero-git')
makedepends=('git' 'maven')
provides=('lizzie')
conflicts=('lizzie')
source=("git+https://github.com/featurecat/lizzie.git"
        "lizzie.desktop")
md5sums=('SKIP'
         '1fefb91214fd8fd2f1241de2b73f8701')

pkgver() {
  cd lizzie
  git describe --long --tags | sed -r 's/^v//; s/([^-]*-g)/r\1/; s/-/./g'
}

build() {
  # Use leela-zero-git's weights file instead of downloading a new one just for `mvn test`
  ln -s /usr/share/leela-zero/networks/weights.txt lizzie/network.gz
  cd lizzie
  mvn package
}

check() {
  cd lizzie
  mvn test
}

package() {
  sed -i 's/network.gz/\/usr\/share\/leela-zero\/networks\/weights.txt/g' "$_pkgname"/config.txt

  install -Dm644 "$_pkgname"/target/lizzie-"$_pkgver"-shaded.jar "$pkgdir"/usr/share/java/"$_pkgname"/"$_pkgname".jar
  install -Dm644 "$_pkgname"/config.txt "$pkgdir"/usr/share/java/"$_pkgname"/config.txt
  install -Dm644 "$_pkgname".desktop "$pkgdir"/usr/share/applications/"$_pkgname".desktop
}