Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at litex 89 lines 1.9 kB view raw
1{ lib 2, rustPlatform 3, fetchFromGitHub 4, makeWrapper 5, pkg-config 6, zstd 7, stdenv 8, alsa-lib 9, libxkbcommon 10, udev 11, vulkan-loader 12, wayland 13, xorg 14, darwin 15}: 16 17rustPlatform.buildRustPackage rec { 18 pname = "jumpy"; 19 version = "0.7.0"; 20 21 src = fetchFromGitHub { 22 owner = "fishfolk"; 23 repo = pname; 24 rev = "v${version}"; 25 sha256 = "sha256-krO/iPGnzXeY3W8xSFerlKa1DvDl7ss00bGaAMkHUtw="; 26 }; 27 28 cargoLock = { 29 lockFile = ./Cargo.lock; 30 outputHashes = { 31 "bevy_simple_tilemap-0.10.1" = "sha256-Q/AsBZjsr+uTIh/oN0OsIJxntZ4nuc1AReo0Ronj930="; 32 "bones_asset-0.1.0" = "sha256-YyY5OsbRLkpAgvNifRiXfmzfsgFw/oFV1nQVCkXG4j4="; 33 }; 34 }; 35 36 patches = [ 37 # jumpy uses an outdated version of mimalloc 38 # which fails to build on aarch64-linux 39 ./update-mimalloc.patch 40 ]; 41 42 nativeBuildInputs = [ 43 makeWrapper 44 pkg-config 45 ]; 46 47 buildInputs = [ 48 zstd 49 ] ++ lib.optionals stdenv.isLinux [ 50 alsa-lib 51 libxkbcommon 52 udev 53 vulkan-loader 54 wayland 55 xorg.libX11 56 xorg.libXcursor 57 xorg.libXi 58 xorg.libXrandr 59 ] ++ lib.optionals stdenv.isDarwin [ 60 darwin.apple_sdk.frameworks.Cocoa 61 rustPlatform.bindgenHook 62 ]; 63 64 cargoBuildFlags = [ "--bin" "jumpy" ]; 65 66 env = { 67 ZSTD_SYS_USE_PKG_CONFIG = true; 68 }; 69 70 postInstall = '' 71 mkdir $out/share 72 cp -r assets $out/share 73 wrapProgram $out/bin/jumpy \ 74 --set-default JUMPY_ASSET_DIR $out/share/assets 75 ''; 76 77 postFixup = lib.optionalString stdenv.isLinux '' 78 patchelf $out/bin/.jumpy-wrapped \ 79 --add-rpath ${lib.makeLibraryPath [ vulkan-loader ]} 80 ''; 81 82 meta = with lib; { 83 description = "A tactical 2D shooter played by up to 4 players online or on a shared screen"; 84 homepage = "https://fishfight.org/"; 85 changelog = "https://github.com/fishfolk/jumpy/releases/tag/v${version}"; 86 license = with licenses; [ mit /* or */ asl20 ]; 87 maintainers = with maintainers; [ figsoda ]; 88 }; 89}