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
|
2021-09-19 02:56:43 +00:00
|
|
|
nnueFile = "nn-6762d36ad265.nnue";
|
|
|
|
nnue = fetchurl {
|
|
|
|
url = "https://tests.stockfishchess.org/api/nn/${nnueFile}";
|
|
|
|
sha256 = "0727dsxfpns9fkyir95fybibqmigk5h45k154b2c5rk5s9md6qk7";
|
2021-01-27 19:01:09 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fishnet";
|
2021-09-19 02:56:43 +00:00
|
|
|
version = "2.4.0";
|
2021-01-27 19:01:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "niklasf";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-09-19 02:56:43 +00:00
|
|
|
sha256 = "sha256-1Gl2vJFn9yVYH62yBJefAOBX/jJaFAdSZj2Lj3imcps=";
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-09-19 02:56:43 +00:00
|
|
|
cargoSha256 = "sha256-/s7Yyi2FUh+EDvgaHLgZ/FA6kk2FQrZr3L3B76fqTuc=";
|
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";
|
|
|
|
homepage = "https://github.com/niklasf/fishnet";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ tu-maurice ];
|
2021-02-21 17:11:45 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-01-27 19:01:09 +00:00
|
|
|
};
|
|
|
|
}
|