2021-09-23 01:09:18 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-12-13 20:11:52 +00:00
|
|
|
, makeWrapper
|
2022-07-30 05:12:21 +00:00
|
|
|
, pkg-config
|
2023-04-16 12:50:01 +00:00
|
|
|
, zstd
|
|
|
|
, stdenv
|
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";
|
2023-10-16 17:04:42 +00:00
|
|
|
version = "0.8.0";
|
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}";
|
2023-10-16 17:04:42 +00:00
|
|
|
sha256 = "sha256-ggePJH2kKJ17aOWRKUnLyolIdSzlc6Axf5Iw74iFfek=";
|
2021-09-23 01:09:18 +00:00
|
|
|
};
|
|
|
|
|
2023-03-25 23:16:46 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-10-16 17:04:42 +00:00
|
|
|
"bevy_egui-0.21.0" = "sha256-hu55tZQppw1NajwqIsYsw6de0IAwQwgra3D9OFzSSLc=";
|
|
|
|
"bones_asset-0.3.0" = "sha256-1UeOXW6O/gMQBBUnHxRreJgmiUTPC5SJB+uLn9V8aa4=";
|
|
|
|
"kira-0.8.5" = "sha256-z4R5aIaoRQQprL6JsVrFI69rwTOsW5OH01+jORS+hBQ=";
|
2023-03-25 23:16:46 +00:00
|
|
|
};
|
|
|
|
};
|
2021-09-23 01:09:18 +00:00
|
|
|
|
2022-12-13 20:11:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2022-07-30 05:12:21 +00:00
|
|
|
pkg-config
|
|
|
|
];
|
2021-12-12 04:07:02 +00:00
|
|
|
|
2023-04-16 12:50:01 +00:00
|
|
|
buildInputs = [
|
|
|
|
zstd
|
|
|
|
] ++ 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.libXrandr
|
2021-09-23 01:09:18 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-10-16 17:04:42 +00:00
|
|
|
darwin.apple_sdk_11_0.frameworks.Cocoa
|
2022-12-13 20:11:52 +00:00
|
|
|
rustPlatform.bindgenHook
|
2021-09-23 01:09:18 +00:00
|
|
|
];
|
|
|
|
|
2023-03-19 01:04:51 +00:00
|
|
|
cargoBuildFlags = [ "--bin" "jumpy" ];
|
2021-09-23 01:09:18 +00:00
|
|
|
|
2023-04-16 12:50:01 +00:00
|
|
|
env = {
|
|
|
|
ZSTD_SYS_USE_PKG_CONFIG = true;
|
|
|
|
};
|
|
|
|
|
2023-10-16 17:04:42 +00:00
|
|
|
# jumpy only loads assets from the current directory
|
|
|
|
# https://github.com/fishfolk/bones/blob/f84d07c2f2847d9acd5c07098fe1575abc496400/framework_crates/bones_asset/src/io.rs#L50
|
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
|
2023-10-16 17:04:42 +00:00
|
|
|
wrapProgram $out/bin/jumpy --chdir $out/share
|
2022-12-13 20:11:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|