nixpkgs/pkgs/games/jumpy/default.nix

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

74 lines
1.6 KiB
Nix
Raw Normal View History

2021-09-23 01:09:18 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
, makeWrapper
2022-07-30 05:12:21 +00:00
, pkg-config
2021-09-23 01:09:18 +00:00
, alsa-lib
, libxkbcommon
2022-07-30 05:12:21 +00:00
, udev
, vulkan-loader
, wayland
, xorg
, darwin
2021-09-23 01:09:18 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "jumpy";
version = "0.6.0";
2021-09-23 01:09:18 +00:00
src = fetchFromGitHub {
owner = "fishfolk";
2021-09-23 01:09:18 +00:00
repo = pname;
rev = "v${version}";
sha256 = "sha256-vBnHNc/kCyZ8gTWhQShn4lBQECguFBzBd7xIfLBgm7A=";
2021-09-23 01:09:18 +00:00
};
cargoSha256 = "sha256-ZnDerzDdCLjslszSn0z0BevP5qpkuYDCDLyv66+psdo=";
2021-09-23 01:09:18 +00:00
2022-12-05 23:44:07 +00:00
auditable = true; # TODO: remove when this is the default
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
libxkbcommon
udev
vulkan-loader
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
2021-09-23 01:09:18 +00:00
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Cocoa
rustPlatform.bindgenHook
2021-09-23 01:09:18 +00:00
];
cargoBuildFlags = [ "--bin" "jumpy" ];
2021-09-23 01:09:18 +00:00
postInstall = ''
mkdir $out/share
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/";
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 ];
};
}