summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 141512197b563689be2d3f7e6636f3975c47f0e3 (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
52
53
54
55
56
57
58
59
60
# 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=5
pkgdesc="Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper. (next branch)"
arch=('x86_64')
url="https://github.com/leela-zero/leela-zero"
license=('GPLv3')
depends=('glibc' 'zlib' 'openblas' 'boost' 'opencl-driver' 'qt5-base')
makedepends=('git' 'opencl-headers' 'cmake' 'ocl-icd')
provides=('leela-zero')
conflicts=('leela-zero')
install="$pkgname.install"
source=("${_pkgname}::git+https://github.com/leela-zero/leela-zero#branch=next"
        "git+https://github.com/google/googletest.git"
        "git+https://github.com/eigenteam/eigen-git-mirror"
        "weights.txt.gz::http://zero.sjeng.org/best-network")
md5sums=('SKIP'
         'SKIP'
         'SKIP'
         'SKIP')

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

prepare() {
  cd $srcdir/${_pkgname}
  git submodule init
  git config submodule.gtest.url "$srcdir"/googletest
  git config submodule.src/Eigen.url "$srcdir"/eigen-git-mirror
  git submodule update gtest src/Eigen
  mkdir -p build
}

build() {
  cd $srcdir/${_pkgname}/build
  cmake ..
  make leelaz
  cd $srcdir/${_pkgname}/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 $srcdir/weights.txt $pkgdir/usr/share/leela-zero/networks/weights.txt
}