uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
110
pkgs/games/katago/default.nix
Normal file
110
pkgs/games/katago/default.nix
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{ stdenv
|
||||
, boost
|
||||
, cmake
|
||||
, cudaPackages
|
||||
, eigen
|
||||
, fetchFromGitHub
|
||||
, gperftools
|
||||
, lib
|
||||
, libzip
|
||||
, makeWrapper
|
||||
, mesa
|
||||
, ocl-icd
|
||||
, opencl-headers
|
||||
, openssl
|
||||
, writeShellScriptBin
|
||||
, enableAVX2 ? stdenv.hostPlatform.avx2Support
|
||||
, enableBigBoards ? false
|
||||
, enableCuda ? false
|
||||
, enableContrib ? false
|
||||
, enableGPU ? true
|
||||
, enableTcmalloc ? true
|
||||
}:
|
||||
|
||||
assert !enableGPU -> (
|
||||
!enableCuda);
|
||||
|
||||
# N.b. older versions of cuda toolkit (e.g. 10) do not support newer versions
|
||||
# of gcc. If you need to use cuda10, please override stdenv with gcc8Stdenv
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "katago";
|
||||
version = "1.11.0";
|
||||
githash = "d8d0cd76cf73df08af3d7061a639488ae9494419";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lightvector";
|
||||
repo = "katago";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-TZKkkYe2PPzgPhItBZBSJDwU3anhsujuCGIYru55OtU=";
|
||||
};
|
||||
|
||||
fakegit = writeShellScriptBin "git" "echo ${githash}";
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libzip
|
||||
boost
|
||||
] ++ lib.optionals (!enableGPU) [
|
||||
eigen
|
||||
] ++ lib.optionals (enableGPU && enableCuda) [
|
||||
cudaPackages.cudnn
|
||||
cudaPackages.cudatoolkit
|
||||
mesa.drivers
|
||||
] ++ lib.optionals (enableGPU && !enableCuda) [
|
||||
opencl-headers
|
||||
ocl-icd
|
||||
] ++ lib.optionals enableContrib [
|
||||
openssl
|
||||
] ++ lib.optionals enableTcmalloc [
|
||||
gperftools
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DNO_GIT_REVISION=ON"
|
||||
] ++ lib.optionals (!enableGPU) [
|
||||
"-DUSE_BACKEND=EIGEN"
|
||||
] ++ lib.optionals enableAVX2 [
|
||||
"-DUSE_AVX2=ON"
|
||||
] ++ lib.optionals (enableGPU && enableCuda) [
|
||||
"-DUSE_BACKEND=CUDA"
|
||||
] ++ lib.optionals (enableGPU && !enableCuda) [
|
||||
"-DUSE_BACKEND=OPENCL"
|
||||
] ++ lib.optionals enableContrib [
|
||||
"-DBUILD_DISTRIBUTED=1"
|
||||
"-DNO_GIT_REVISION=OFF"
|
||||
"-DGIT_EXECUTABLE=${fakegit}/bin/git"
|
||||
] ++ lib.optionals enableTcmalloc [
|
||||
"-DUSE_TCMALLOC=ON"
|
||||
] ++ lib.optionals enableBigBoards [
|
||||
"-DUSE_BIGGER_BOARDS_EXPENSIVE=ON"
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
cd cpp/
|
||||
'' + lib.optionalString enableCuda ''
|
||||
export CUDA_PATH="${cudaPackages.cudatoolkit}"
|
||||
export EXTRA_LDFLAGS="-L/run/opengl-driver/lib"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin; cp katago $out/bin;
|
||||
'' + lib.optionalString enableCuda ''
|
||||
wrapProgram $out/bin/katago \
|
||||
--prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib"
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Go engine modeled after AlphaGo Zero";
|
||||
homepage = "https://github.com/lightvector/katago";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.omnipotententity ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue