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
|
2023-11-16 04:20:00 +00:00
|
|
|
nnueFile = "nn-5af11540bbfe.nnue";
|
2021-09-23 15:35:13 +00:00
|
|
|
nnue = fetchurl {
|
|
|
|
url = "https://tests.stockfishchess.org/api/nn/${nnueFile}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-WvEVQLv+/LVOOMXdAAyrS0ad+nWZodVb5dJyLCCokps=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fishnet";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.7.1";
|
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}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-q73oGQYSWx1aFy9IvbGpecOoc0wLEY2IzJH9GufnvCs=";
|
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 = ''
|
|
|
|
cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
|
|
|
|
cp -v '${nnue}' 'Fairy-Stockfish/src/${nnueFile}'
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# Copying again bacause the file is deleted during build.
|
|
|
|
postBuild = ''
|
|
|
|
cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
|
|
|
|
'';
|
2022-03-10 19:12:11 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cargoHash = "sha256-NO3u2ZXSiDQnZ/FFZLOtTnQoGMyN9pSI4sqGIXtjEcI=";
|
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;
|
|
|
|
maintainers = with maintainers; [ tu-maurice ];
|
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
|
|
|
};
|
|
|
|
}
|