@@ -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−}