2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2021-09-23 15:35:13 +00:00
|
|
|
, fetchurl
|
|
|
|
}:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
let
|
2024-09-19 14:19:46 +00:00
|
|
|
# These files can be found in Stockfish/src/evaluate.h
|
|
|
|
nnueBigFile = "nn-31337bea577c.nnue";
|
|
|
|
nnueBig = fetchurl {
|
|
|
|
url = "https://tests.stockfishchess.org/api/nn/${nnueBigFile}";
|
|
|
|
sha256 = "sha256-MTN76ld8W00LPlQYGGGJ7k9Yuq6rjX9vO9BXisp/d9k=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2024-09-19 14:19:46 +00:00
|
|
|
nnueSmallFile = "nn-37f18f62d772.nnue";
|
|
|
|
nnueSmall = fetchurl {
|
|
|
|
url = "https://tests.stockfishchess.org/api/nn/${nnueSmallFile}";
|
|
|
|
sha256 = "sha256-N/GPYtdy8xB+HWqso4mMEww8hvKrY+ZVX7vKIGNaiZ0=";
|
|
|
|
};
|
|
|
|
in rustPlatform.buildRustPackage rec {
|
2021-02-05 17:12:51 +00:00
|
|
|
pname = "fishnet";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.9.3";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-11-16 04:20:00 +00:00
|
|
|
owner = "lichess-org";
|
2021-02-05 17:12:51 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-HlCnUJBhIhooBvQVz1SDfiifXIBkBlH2dEq+C9al7qI=";
|
2021-09-23 15:35:13 +00:00
|
|
|
fetchSubmodules = true;
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
postPatch = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
cp -v '${nnueBig}' 'Stockfish/src/${nnueBigFile}'
|
|
|
|
cp -v '${nnueBig}' 'Fairy-Stockfish/src/${nnueBigFile}'
|
|
|
|
cp -v '${nnueSmall}' 'Stockfish/src/${nnueSmallFile}'
|
|
|
|
cp -v '${nnueSmall}' 'Fairy-Stockfish/src/${nnueSmallFile}'
|
2023-11-16 04:20:00 +00:00
|
|
|
'';
|
2022-03-10 19:12:11 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-Fb28XNhCt88PFnJ4s0I80L/rLJtBTEZ8Xd/68MYFoLs=";
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Distributed Stockfish analysis for lichess.org";
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://github.com/lichess-org/fishnet";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2024-09-19 14:19:46 +00:00
|
|
|
maintainers = with maintainers; [ tu-maurice thibaultd ];
|
2023-11-16 04:20:00 +00:00
|
|
|
platforms = [ "aarch64-linux" "x86_64-linux" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "fishnet";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|