2021-01-27 19:01:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2021-09-19 02:56:43 +00:00
|
|
|
, fetchurl
|
|
|
|
}:
|
2021-01-27 19:01:09 +00:00
|
|
|
|
|
|
|
let
|
2023-10-24 23:34:03 +00:00
|
|
|
nnueFile = "nn-5af11540bbfe.nnue";
|
2021-09-19 02:56:43 +00:00
|
|
|
nnue = fetchurl {
|
|
|
|
url = "https://tests.stockfishchess.org/api/nn/${nnueFile}";
|
2023-10-24 23:34:03 +00:00
|
|
|
hash = "sha256-WvEVQLv+/LVOOMXdAAyrS0ad+nWZodVb5dJyLCCokps=";
|
2021-01-27 19:01:09 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fishnet";
|
2023-10-24 23:34:03 +00:00
|
|
|
version = "2.7.1";
|
2021-01-27 19:01:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-10-24 23:34:03 +00:00
|
|
|
owner = "lichess-org";
|
2021-01-27 19:01:09 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-10-24 23:34:03 +00:00
|
|
|
hash = "sha256-q73oGQYSWx1aFy9IvbGpecOoc0wLEY2IzJH9GufnvCs=";
|
2021-09-19 02:56:43 +00:00
|
|
|
fetchSubmodules = true;
|
2021-01-27 19:01:09 +00:00
|
|
|
};
|
|
|
|
|
2021-09-19 02:56:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
|
|
|
|
cp -v '${nnue}' 'Fairy-Stockfish/src/${nnueFile}'
|
2021-01-27 19:01:09 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-24 23:34:03 +00:00
|
|
|
# Copying again bacause the file is deleted during build.
|
|
|
|
postBuild = ''
|
|
|
|
cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
|
|
|
|
'';
|
2022-02-19 23:18:48 +00:00
|
|
|
|
2023-10-24 23:34:03 +00:00
|
|
|
cargoHash = "sha256-NO3u2ZXSiDQnZ/FFZLOtTnQoGMyN9pSI4sqGIXtjEcI=";
|
2021-02-27 17:26:42 +00:00
|
|
|
|
2021-01-27 19:01:09 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Distributed Stockfish analysis for lichess.org";
|
2023-10-24 23:34:03 +00:00
|
|
|
homepage = "https://github.com/lichess-org/fishnet";
|
2021-01-27 19:01:09 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ tu-maurice ];
|
2023-10-24 23:34:03 +00:00
|
|
|
platforms = [ "aarch64-linux" "x86_64-linux" ];
|
2021-01-27 19:01:09 +00:00
|
|
|
};
|
|
|
|
}
|