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

pkgname=leela-zero-git
_pkgname=leela-zero
pkgver=766
pkgrel=1
pkgdesc="Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper."
arch=('x86_64')
url="https://github.com/gcp/leela-zero"
license=('GPLv3')
depends=('glibc' 'zlib' 'libopenblas' 'boost' 'opencl-nvidia' 'qt5-base')
makedepends=('git' 'opencl-headers' 'cmake' 'ocl-icd')
conflicts=('leela-zero')
install="$pkgname.install"
source=("git+https://github.com/gcp/leela-zero#branch=next")
md5sums=('SKIP')

pkgver() {
  cd ${srcdir}/${_pkgname}
  git rev-list --count HEAD
}

prepare() {
  cd ${srcdir}/${_pkgname}
  curl http://zero.sjeng.org/best-network | gunzip > weights_$(pkgver).txt
}

build() {
  cd ${srcdir}/${_pkgname}
  git submodule update --init --recursive
  mkdir -p build && cd build
  cmake .. || return 1
  make leelaz
  cd ../autogtp
  qmake
  make
}

check() {
  cd ${srcdir}/${_pkgname}/build
  make tests
  ./tests
}

package() {
  cd ${srcdir}/${_pkgname}
  install -Dm755 build/leelaz $pkgdir/usr/bin/leelaz
  install -Dm755 autogtp/autogtp $pkgdir/usr/bin/autogtp
  install -Dm644 weights_$pkgver.txt $pkgdir/usr/share/leela-zero/networks/weights_$pkgver.txt
}