diff --git a/pkgs/games/fishfight/default.nix b/pkgs/games/fishfight/default.nix new file mode 100644 index 000000000000..420d024d5f67 --- /dev/null +++ b/pkgs/games/fishfight/default.nix @@ -0,0 +1,62 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, stdenv +, alsa-lib +, libGL +, libX11 +, libXi +, AudioToolbox +, Cocoa +, CoreAudio +, CoreFoundation +, IOKit +, OpenGL +}: + +rustPlatform.buildRustPackage rec { + pname = "fishfight"; + version = "0.1"; + + src = fetchFromGitHub { + owner = "fishfight"; + repo = pname; + rev = "v${version}"; + sha256 = "0mbg9zshyg9hlbsk5npslbnwjf8fh6gxszi5hxks380z080cjxs2"; + }; + + cargoSha256 = "sha256-fZXqJ6a2erAQSgAZRwmkor94eMryjiq3gbY102pJb9Q="; + + buildInputs = lib.optionals stdenv.isLinux [ + alsa-lib + libGL + libX11 + libXi + ] ++ lib.optionals stdenv.isDarwin [ + AudioToolbox + Cocoa + CoreAudio + CoreFoundation + IOKit + OpenGL + ]; + + postPatch = '' + substituteInPlace assets/levels/levels.toml --replace assets $out/share/assets + substituteInPlace src/gui.rs --replace \"assets \"$out/share/assets + substituteInPlace src/main.rs --replace \"assets \"$out/share/assets + ''; + + postInstall = '' + mkdir $out/share + cp -r assets $out/share + ''; + + meta = with lib; { + description = "A tactical 2D shooter played by up to 4 players online or on a shared screen"; + homepage = "https://fishfight.org/"; + license = with licenses; [ mit /* or */ asl20 ]; + maintainers = with maintainers; [ figsoda ]; + mainProgram = "fishgame"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2aac02d7f8ae..2f755cf842c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29262,6 +29262,11 @@ with pkgs; fish-fillets-ng = callPackage ../games/fish-fillets-ng {}; + fishfight = callPackage ../games/fishfight { + inherit (xorg) libX11 libXi; + inherit (darwin.apple_sdk.frameworks) AudioToolbox Cocoa CoreAudio CoreFoundation IOKit OpenGL; + }; + flightgear = libsForQt5.callPackage ../games/flightgear { }; flock = callPackage ../development/tools/flock { };