2021-09-23 01:09:18 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
2022-12-13 20:11:52 +00:00
|
|
|
, makeWrapper
|
2022-07-30 05:12:21 +00:00
|
|
|
, pkg-config
|
2021-09-23 01:09:18 +00:00
|
|
|
, alsa-lib
|
2022-12-13 20:11:52 +00:00
|
|
|
, libxkbcommon
|
2022-07-30 05:12:21 +00:00
|
|
|
, udev
|
2022-12-13 20:11:52 +00:00
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, xorg
|
|
|
|
, darwin
|
2021-09-23 01:09:18 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2022-08-03 03:02:48 +00:00
|
|
|
pname = "jumpy";
|
2022-12-13 20:11:52 +00:00
|
|
|
version = "0.5.1";
|
2021-09-23 01:09:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-12-13 20:11:52 +00:00
|
|
|
owner = "fishfolk";
|
2021-09-23 01:09:18 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-12-13 20:11:52 +00:00
|
|
|
sha256 = "sha256-5hgd4t9ZKHmv8wzED7Tn+ykzUM0EbQqRX15HBHzXtJY=";
|
2021-09-23 01:09:18 +00:00
|
|
|
};
|
|
|
|
|
2022-12-13 20:11:52 +00:00
|
|
|
cargoSha256 = "sha256-cK5n75T+Kkd6F4q4MFZNn0R6W6Nk2/H23AGhIe2FCig=";
|
2021-09-23 01:09:18 +00:00
|
|
|
|
2022-12-13 20:11:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2022-07-30 05:12:21 +00:00
|
|
|
pkg-config
|
|
|
|
];
|
2021-12-12 04:07:02 +00:00
|
|
|
|
2022-07-30 05:12:21 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
2021-09-23 01:09:18 +00:00
|
|
|
alsa-lib
|
2022-12-13 20:11:52 +00:00
|
|
|
libxkbcommon
|
|
|
|
udev
|
|
|
|
vulkan-loader
|
|
|
|
wayland
|
2022-10-13 22:16:16 +00:00
|
|
|
xorg.libX11
|
2022-12-13 20:11:52 +00:00
|
|
|
xorg.libXcursor
|
2022-10-13 22:16:16 +00:00
|
|
|
xorg.libXi
|
2022-12-13 20:11:52 +00:00
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
2021-09-23 01:09:18 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2022-12-13 20:11:52 +00:00
|
|
|
darwin.apple_sdk.frameworks.Cocoa
|
|
|
|
rustPlatform.bindgenHook
|
2021-09-23 01:09:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-12-13 20:11:52 +00:00
|
|
|
touch ../$(stripHash $cargoDeps)/taffy/README.md
|
2021-09-23 01:09:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/share
|
2022-12-13 20:11:52 +00:00
|
|
|
cp -r assets $out/share
|
|
|
|
wrapProgram $out/bin/jumpy \
|
|
|
|
--set-default JUMPY_ASSET_DIR $out/share/assets
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf $out/bin/.jumpy-wrapped \
|
|
|
|
--add-rpath ${lib.makeLibraryPath [ vulkan-loader ]}
|
2021-09-23 01:09:18 +00: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/";
|
2022-12-13 20:11:52 +00:00
|
|
|
changelog = "https://github.com/fishfolk/jumpy/releases/tag/v${version}";
|
2021-09-23 01:09:18 +00:00
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|