about summary refs log tree commit diff
diff options
context:
space:
mode:
authoréclairevoyant <848000+eclairevoyant@users.noreply.github.com>2024-05-02 20:10:57 +0000
committerGitHub <noreply@github.com>2024-05-02 20:10:57 +0000
commitfcee90df675f5f544d130119987184c8706c2875 (patch)
treed1430e014f5322b58b0b328313163d49cba8130d
parent823642890644768c6f10c13ab13b4b842b538a8d (diff)
parent5aac05258dd02658aa92460a502e4b1292c4445a (diff)
Merge pull request #305525 from 9glenda/lc0
lc0: init at 0.30.0
-rw-r--r--pkgs/by-name/lc/lc0/package.nix72
1 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/by-name/lc/lc0/package.nix b/pkgs/by-name/lc/lc0/package.nix
new file mode 100644
index 000000000000..4ccb1927534b
--- /dev/null
+++ b/pkgs/by-name/lc/lc0/package.nix
@@ -0,0 +1,72 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+, python3
+, zlib
+, gtest
+, eigen
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lc0";
+  version = "0.30.0";
+
+  src = fetchFromGitHub {
+    owner = "LeelaChessZero";
+    repo = "lc0";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-Q85hXNSexHhk6W48tgJLk0Sf32xBipfg2P2SH1FF89Q=";
+    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;
+  };
+
+}