nixpkgs/pkgs/games/fishfight/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.2 KiB
Nix
Raw Normal View History

2021-09-23 04:09:18 +03:00
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
2022-07-30 08:12:21 +03:00
, pkg-config
2021-09-23 04:09:18 +03:00
, alsa-lib
, libGL
, libX11
, libXi
2022-07-30 08:12:21 +03:00
, udev
2021-09-23 04:09:18 +03:00
, Cocoa
, OpenGL
}:
rustPlatform.buildRustPackage rec {
pname = "fishfight";
2022-07-30 08:12:21 +03:00
version = "0.4.2";
2021-09-23 04:09:18 +03:00
src = fetchFromGitHub {
owner = "fishfight";
repo = pname;
rev = "v${version}";
2022-07-30 08:12:21 +03:00
sha256 = "sha256-q1Hh4P/huoFuW/+Mb9yKUMKaky1RshGpjrObBHRCk+8=";
2021-09-23 04:09:18 +03:00
};
2022-07-30 08:12:21 +03:00
cargoSha256 = "sha256-PEGK95eXIHv2sxSwUU4345KtxDyRJn/+aEiJIDmkq6Y=";
2021-09-23 04:09:18 +03:00
2022-07-30 08:12:21 +03:00
nativeBuildInputs = lib.optionals stdenv.isLinux [
pkg-config
];
2021-12-12 07:07:02 +03:00
2022-07-30 08:12:21 +03:00
buildInputs = lib.optionals stdenv.isLinux [
2021-09-23 04:09:18 +03:00
alsa-lib
libGL
libX11
libXi
2022-07-30 08:12:21 +03:00
udev
2021-09-23 04:09:18 +03:00
] ++ lib.optionals stdenv.isDarwin [
Cocoa
OpenGL
];
postPatch = ''
2022-07-30 08:12:21 +03:00
substituteInPlace src/main.rs \
--replace ./assets $out/share/assets \
--replace ./mods $out/share/mods
2021-09-23 04:09:18 +03:00
'';
postInstall = ''
mkdir $out/share
2022-07-30 08:12:21 +03:00
cp -r assets mods $out/share
2021-09-23 04:09:18 +03:00
'';
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 ];
};
}