1{ lib
2, rustPlatform
3, fetchFromGitHub
4, stdenv
5, pkg-config
6, alsa-lib
7, libGL
8, xorg
9, udev
10, Cocoa
11, OpenGL
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "jumpy";
16 version = "0.4.3";
17
18 src = fetchFromGitHub {
19 owner = "fishfolks";
20 repo = pname;
21 rev = "v${version}";
22 sha256 = "sha256-01zhiQi6v/8ZajsdBU+4hKUCj+PRJ/vUHluOIzy/Gi8=";
23 };
24
25 cargoSha256 = "sha256-AXaGuRqSFiq+Uiy+UaqPdPVyDhCogC64KZZ0Ah1Yo7A=";
26
27 nativeBuildInputs = lib.optionals stdenv.isLinux [
28 pkg-config
29 ];
30
31 buildInputs = lib.optionals stdenv.isLinux [
32 alsa-lib
33 libGL
34 xorg.libX11
35 xorg.libXi
36 udev
37 ] ++ lib.optionals stdenv.isDarwin [
38 Cocoa
39 OpenGL
40 ];
41
42 postPatch = ''
43 substituteInPlace src/main.rs \
44 --replace ./assets $out/share/assets \
45 --replace ./mods $out/share/mods
46 '';
47
48 postInstall = ''
49 mkdir $out/share
50 cp -r assets mods $out/share
51 '';
52
53 meta = with lib; {
54 description = "A tactical 2D shooter played by up to 4 players online or on a shared screen";
55 homepage = "https://fishfight.org/";
56 license = with licenses; [ mit /* or */ asl20 ];
57 maintainers = with maintainers; [ figsoda ];
58 };
59}