summary refs log tree commit diff
path: root/gnu/packages/patches/leela-zero-gtest.patch
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/patches/leela-zero-gtest.patch
parent85a411bc282f9d6749d5ff029e152fba9f5b4712 (diff)
downloadguix-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/patches/leela-zero-gtest.patch')
-rw-r--r--gnu/packages/patches/leela-zero-gtest.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/gnu/packages/patches/leela-zero-gtest.patch b/gnu/packages/patches/leela-zero-gtest.patch
new file mode 100644
index 0000000000..7291b4ab72
--- /dev/null
+++ b/gnu/packages/patches/leela-zero-gtest.patch
@@ -0,0 +1,40 @@
+Use shared gtest instead of submodule
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 617e4b2..2857875 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,7 +18,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+ include(GNUInstallDirs)
+ 
+ project(leelaz)
+-add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all`
+ 
+ # Required Packages
+ set(Boost_MIN_VERSION "1.58.0")
+@@ -27,6 +26,7 @@ find_package(Boost 1.58.0 REQUIRED program_options filesystem)
+ find_package(Threads REQUIRED)
+ find_package(ZLIB REQUIRED)
+ find_package(OpenCL REQUIRED)
++find_package(GTest REQUIRED)
+ # We need OpenBLAS for now, because we make some specific
+ # calls. Ideally we'd use OpenBLAS is possible and fall back to
+ # not doing those calls if it's not present.
+@@ -93,6 +93,7 @@ include_directories(${IncludePath})
+ include_directories(${Boost_INCLUDE_DIRS})
+ include_directories(${OpenCL_INCLUDE_DIRS})
+ include_directories(${ZLIB_INCLUDE_DIRS})
++include_directories(${GTEST_INCLUDE_DIRS})
+ 
+ if((UNIX AND NOT APPLE) OR WIN32)
+     include_directories(${BLAS_INCLUDE_DIRS})
+@@ -141,7 +142,8 @@ target_link_libraries(tests ${Boost_LIBRARIES})
+ target_link_libraries(tests ${BLAS_LIBRARIES})
+ target_link_libraries(tests ${OpenCL_LIBRARIES})
+ target_link_libraries(tests ${ZLIB_LIBRARIES})
+-target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT})
++target_link_libraries(tests ${GTEST_BOTH_LIBRARIES})
++target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT})
+ 
+ include(GetGitRevisionDescription)
+ git_describe(VERSION --tags)