2021-09-23 15:35:13 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, makeWrapper
|
2022-08-12 12:06:08 +00:00
|
|
|
, pkg-config
|
2023-04-29 16:46:19 +00:00
|
|
|
, zstd
|
|
|
|
, stdenv
|
2021-09-23 15:35:13 +00:00
|
|
|
, alsa-lib
|
2022-12-17 10:02:37 +00:00
|
|
|
, libxkbcommon
|
2022-08-12 12:06:08 +00:00
|
|
|
, udev
|
2022-12-17 10:02:37 +00:00
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, xorg
|
|
|
|
, darwin
|
2021-09-23 15:35:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "jumpy";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.7.0";
|
2021-09-23 15:35:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-12-17 10:02:37 +00:00
|
|
|
owner = "fishfolk";
|
2021-09-23 15:35:13 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-krO/iPGnzXeY3W8xSFerlKa1DvDl7ss00bGaAMkHUtw=";
|
2021-09-23 15:35:13 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-05-24 13:37:59 +00:00
|
|
|
"bevy_simple_tilemap-0.10.1" = "sha256-Q/AsBZjsr+uTIh/oN0OsIJxntZ4nuc1AReo0Ronj930=";
|
2023-04-29 16:46:19 +00:00
|
|
|
"bones_asset-0.1.0" = "sha256-YyY5OsbRLkpAgvNifRiXfmzfsgFw/oFV1nQVCkXG4j4=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
};
|
2021-09-23 15:35:13 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
patches = [
|
2023-05-24 13:37:59 +00:00
|
|
|
# jumpy uses an outdated version of mimalloc
|
|
|
|
# which fails to build on aarch64-linux
|
|
|
|
./update-mimalloc.patch
|
2023-04-29 16:46:19 +00:00
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2022-08-12 12:06:08 +00:00
|
|
|
pkg-config
|
|
|
|
];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
zstd
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2021-09-23 15:35:13 +00:00
|
|
|
alsa-lib
|
2022-12-17 10:02:37 +00:00
|
|
|
libxkbcommon
|
|
|
|
udev
|
|
|
|
vulkan-loader
|
|
|
|
wayland
|
2022-10-21 18:38:19 +00:00
|
|
|
xorg.libX11
|
2022-12-17 10:02:37 +00:00
|
|
|
xorg.libXcursor
|
2022-10-21 18:38:19 +00:00
|
|
|
xorg.libXi
|
2022-12-17 10:02:37 +00:00
|
|
|
xorg.libXrandr
|
2021-09-23 15:35:13 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2022-12-17 10:02:37 +00:00
|
|
|
darwin.apple_sdk.frameworks.Cocoa
|
|
|
|
rustPlatform.bindgenHook
|
2021-09-23 15:35:13 +00:00
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
cargoBuildFlags = [ "--bin" "jumpy" ];
|
2021-09-23 15:35:13 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
env = {
|
|
|
|
ZSTD_SYS_USE_PKG_CONFIG = true;
|
|
|
|
};
|
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/share
|
2022-12-17 10:02:37 +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 15:35:13 +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-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/fishfolk/jumpy/releases/tag/v${version}";
|
2021-09-23 15:35:13 +00:00
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|