depot/third_party/nixpkgs/pkgs/by-name/lc/lc0/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

72 lines
1.4 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, meson
, ninja
, pkg-config
, python3
, zlib
, gtest
, eigen
}:
stdenv.mkDerivation rec {
pname = "lc0";
version = "0.31.0";
src = fetchFromGitHub {
owner = "LeelaChessZero";
repo = "lc0";
rev = "refs/tags/v${version}";
hash = "sha256-kHLO6xM1q/CQIBcGIFXVkvtGEx75sqA7atGYfvnJcso=";
fetchSubmodules = true;
};
patchPhase = ''
runHook prePatch
patchShebangs --build /build/source/scripts/*
runHook postPatch
'';
strictDeps = true;
nativeBuildInputs = [
meson
ninja
pkg-config
python3
];
buildInputs = [
eigen
gtest
zlib
];
mesonFlags = [
"-Dplain_cuda=false"
"-Daccelerate=false"
"-Dmetal=disabled"
"-Dembed=false"
]
# in version 31 this option will be required
++ lib.optionals (lib.versionAtLeast version "0.31") [ "-Dnative_cuda=false" ];
enableParallelBuilding = true;
meta = {
homepage = "https://lczero.org/";
description = "Open source neural network based chess engine";
longDescription = ''
Lc0 is a UCI-compliant chess engine designed to play chess via neural network, specifically those of the LeelaChessZero project.
'';
maintainers = with lib.maintainers; [ _9glenda ];
platforms = lib.platforms.unix;
license = lib.licenses.gpl3Plus;
broken = stdenv.hostPlatform.isDarwin;
};
}