2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2021-09-23 15:35:13 +00:00
|
|
|
, fetchurl
|
|
|
|
}:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
let
|
2022-03-10 19:12:11 +00:00
|
|
|
nnueFile = "nn-13406b1dcbe0.nnue";
|
2021-09-23 15:35:13 +00:00
|
|
|
nnue = fetchurl {
|
|
|
|
url = "https://tests.stockfishchess.org/api/nn/${nnueFile}";
|
2022-03-10 19:12:11 +00:00
|
|
|
sha256 = "sha256-E0BrHcvgo238XgfaUdjbOLekXX2kMHjsJadiTCuDI28=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fishnet";
|
2022-03-10 19:12:11 +00:00
|
|
|
version = "2.5.1";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "niklasf";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-10 19:12:11 +00:00
|
|
|
sha256 = "sha256-nVRG60sSpTqfqhCclvWoeyHR0+oO1Jn1PgftigDGq5c=";
|
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
|
|
|
'';
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
cargoSha256 = "sha256-BJK7M/pjHRj74xoeciavhkK2YRpeogkELIuXetX73so=";
|
|
|
|
|
|
|
|
# TODO: Cargo.lock is out of date, so fix it. Likely not necessary anymore in
|
|
|
|
# the next update.
|
|
|
|
cargoPatches = [
|
|
|
|
./Cargo.lock.patch
|
|
|
|
];
|
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";
|
|
|
|
homepage = "https://github.com/niklasf/fishnet";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ tu-maurice ];
|
2021-03-09 03:18:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|