git.iko.soy/typeable/nixpkgs
on master help sign in
fishnet: 2.2.6 -> 2.4.0, fix build

fishnet-assets has been archived in favor of a submodule-based approach where Stockfish and Fairy-Stockfish are built from source. This means we now need to fetch the NNUE file, similar to Stockfish's standalone derivation.

commitf73f35b8c8967d851c3ef5da1862ed55aff448a1 authorRyan Burns <rtburns@protonmail.com> dateSat 18 Sep 2021, 19:56 (5 years ago) parent48bf125
2 files changed+13−70
pkgs/servers/fishnet/assets.nix−58 pkgs/servers/fishnet/default.nix+13−12
pkgs/servers/fishnet/assets.nixdeleted−58
@@ -1,58 +0,0 @@
1−{ lib
2−, stdenv
3−, fetchFromGitHub
4−, xz
5−, autoPatchelfHook }:
6−
7−# Assets for fishnet: A collection of pre-built compressed stockfish binaries.
8−# We have to decompress them, patch them using auto-patchelf and compress them
9−# again so that a selection of them can be embedded into the fishnet binary.
10−stdenv.mkDerivation rec {
11− pname = "fishnet-assets";
12− version = "unstable-2020-03-27";
13−
14− src = fetchFromGitHub {
15− owner = "niklasf";
16− repo = pname;
17− rev = "a1fe3ec6074ad9dc43e6d46e0d42fab5d7cce12c";
18− sha256 = "1548wj2bs89b5w42z3c98hpnbln5w8p1909wyl7a63d8vkvnyn5l";
19− };
20−
21− relAssetsPath = "share/${pname}";
22−
23− nativeBuildInputs = [ xz autoPatchelfHook ];
24−
25− postPatch = ''
26− # Delete packed .exe files and all non .xz files (documentation and readme)
27− rm *.exe.xz
28− find \! -name "*.xz" -delete
29− # Extract .xz files, except *.nnue.xz
30− # We don't have to unpack the latter and it takes ages to repack
31− find -name "*.xz" \! -name "*.nnue.xz" | xargs unxz -v
32− '';
33−
34− dontBuild = true;
35−
36− installPhase = ''
37− mkdir -p $out/${relAssetsPath}
38− cp ./* $out/${relAssetsPath}
39− '';
40−
41− preFixup = ''
42− gatherLibraries '${stdenv.cc.cc.lib}'
43− '';
44−
45− doDist = true;
46− distPhase = ''
47− # repack assets
48− find $out/${relAssetsPath} -type f \! -name "*.xz" | xargs xz -v
49− '';
50−
51− meta = with lib; {
52− description = "Assets for fishnet, only required during build";
53− homepage = "https://github.com/niklasf/fishnet-assets";
54− license = licenses.gpl3Only;
55− maintainers = with maintainers; [ tu-maurice ];
56− platforms = [ "x86_64-linux" ];
57− };
58−}
pkgs/servers/fishnet/default.nix+13−12
@@ -2,33 +2,34 @@
22, stdenv
33, rustPlatform
44, fetchFromGitHub
5−, xz
6−, autoPatchelfHook }:
5+, fetchurl
6+}:
77
88let
9− assets = import ./assets.nix {
10− inherit lib stdenv fetchFromGitHub xz autoPatchelfHook;
9+ nnueFile = "nn-6762d36ad265.nnue";
10+ nnue = fetchurl {
11+ url = "https://tests.stockfishchess.org/api/nn/${nnueFile}";
12+ sha256 = "0727dsxfpns9fkyir95fybibqmigk5h45k154b2c5rk5s9md6qk7";
1113 };
1214in
1315rustPlatform.buildRustPackage rec {
1416 pname = "fishnet";
15− version = "2.2.6";
17+ version = "2.4.0";
1618
1719 src = fetchFromGitHub {
1820 owner = "niklasf";
1921 repo = pname;
2022 rev = "v${version}";
21− sha256 = "0dmc58wzv758b82pjpfzcfi0hr14hqcr61cd9v5xlgk5w78cisjq";
23+ sha256 = "sha256-1Gl2vJFn9yVYH62yBJefAOBX/jJaFAdSZj2Lj3imcps=";
24+ fetchSubmodules = true;
2225 };
2326
24− cargoSha256 = "1s37b0w1aav6gz399zncfp0zqh5sfy0zmabhl7n8p5cwlmlvnlsj";
25−
26− preBuild = ''
27− rmdir ./assets
28− ln -snf ${assets}/${assets.relAssetsPath} ./assets
27+ postPatch = ''
28+ cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
29+ cp -v '${nnue}' 'Fairy-Stockfish/src/${nnueFile}'
2930 '';
3031
31− passthru.assets = assets;
32+ cargoSha256 = "sha256-/s7Yyi2FUh+EDvgaHLgZ/FA6kk2FQrZr3L3B76fqTuc=";
3233
3334 meta = with lib; {
3435 description = "Distributed Stockfish analysis for lichess.org";