aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/games.scm
diff options
context:
space:
mode:
authorGuillaume LE VAILLANT <glv@posteo.net>2019-06-05 18:11:20 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-25 17:41:24 +0200
commitfbfc07bd867ce3f63be99332ef97a7b765a9d33f (patch)
tree8c1e716ef06fb5295b2fd82b9b10a55d24e4194f /gnu/packages/games.scm
parent85a411bc282f9d6749d5ff029e152fba9f5b4712 (diff)
downloadguix-fbfc07bd867ce3f63be99332ef97a7b765a9d33f.tar
guix-fbfc07bd867ce3f63be99332ef97a7b765a9d33f.tar.gz
gnu: Add leela-zero.
* gnu/packages/games.scm (leela-zero): New variable. * gnu/packages/patches/leela-zero-gtest.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/games.scm')
-rw-r--r--gnu/packages/games.scm51
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 304ef45024..240b1d33df 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -42,6 +42,7 @@
;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@gmail.com>
;;; Copyright © 2019 Dan Frumin <dfrumin@cs.ru.nl>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -130,6 +131,7 @@
#:use-module (gnu packages netpbm)
#:use-module (gnu packages networking)
#:use-module (gnu packages ocaml)
+ #:use-module (gnu packages opencl)
#:use-module (gnu packages pcre)
#:use-module (gnu packages perl)
#:use-module (gnu packages perl-check)
@@ -7580,3 +7582,52 @@ remake of that series or any other game.")
;; released under both gpl2 and cc-by-sa3.0. Bundled Gigi library is
;; released under lgpl2.1+.
(license (list license:gpl2 license:cc-by-sa3.0 license:lgpl2.1+))))
+
+(define-public leela-zero
+ (package
+ (name "leela-zero")
+ (version "0.17")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/leela-zero/leela-zero.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "17px5iny8mql5c01bymcli7zfssswkzvb2i8gnsmjcck6i2n8srl"))
+ (patches (search-patches "leela-zero-gtest.patch"))))
+ (build-system cmake-build-system)
+ (native-inputs
+ `(("googletest" ,googletest)))
+ (inputs
+ `(("boost" ,boost)
+ ("ocl-icd" ,ocl-icd)
+ ("openblas" ,openblas)
+ ("opencl-headers" ,opencl-headers)
+ ("qtbase" ,qtbase)
+ ("zlib" ,zlib)))
+ (arguments
+ '(#:configure-flags '("-DUSE_BLAS=YES")
+ #:phases (modify-phases %standard-phases
+ (add-before 'configure 'fix-tests
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((home (getcwd)))
+ (setenv "HOME" home)
+ (substitute* "src/tests/gtests.cpp"
+ (("\\.\\./src/tests/0k\\.txt")
+ (string-append home "/src/tests/0k.txt"))
+ (("cfg_gtp_mode = true;")
+ "cfg_gtp_mode = true; cfg_cpu_only = true;")))
+ #t))
+ (replace 'check
+ (lambda _
+ (invoke "./tests"))))))
+ (home-page "https://github.com/leela-zero/leela-zero")
+ (synopsis "Program playing the game of Go")
+ (description
+ "Leela-zero is a Go engine with no human-provided knowledge, modeled after
+the AlphaGo Zero paper. The current best network weights file for the engine
+can be downloaded from @url{https://zero.sjeng.org/best-network}.")
+ (license license:gpl3+)))