{ lib, stdenv, fetchurl, unzip, autoPatchelfHook, vulkan-loader, libGL, SDL2, gtk3, alsa-lib, libpulseaudio, pipewire, udev, libusb1, libx11, libxcb, bubblewrap, }: stdenv.mkDerivation (finalAttrs: { pname = "skate3recomp"; version = "1.0.4"; src = fetchurl { url = "https://github.com/mchughalex/skate3recomp/releases/download/v${finalAttrs.version}/Skate3Recomp-Linux.zip"; hash = "sha256-+4eERneK934V8S3oF1/CJliOmFB8pwBekixCrQuhhy4="; }; nativeBuildInputs = [ unzip autoPatchelfHook bubblewrap ]; buildInputs = [ stdenv.cc.cc.lib # libstdc++, libgcc_s vulkan-loader # libvulkan.so.1 libGL # libGL.so.1 (Mesa / AMDGPU) SDL2 # libSDL2-2.0.so.0 gtk3 # libgtk-3.so.0 (file-picker dialog for ISO selection) alsa-lib # libasound.so.2 libpulseaudio # libpulse.so.0 pipewire # libpipewire-0.3.so.0 udev # libudev.so.1 libusb1 # libusb-1.0.so.0 libx11 # libX11.so.6 libxcb # libxcb.so.1 ]; autoPatchelfIgnoreMissingDeps = [ "libsteam_api.so" ]; dontBuild = true; dontConfigure = true; installPhase = '' runHook preInstall install -Dm755 skate3 "$out/lib/skate3recomp/skate3" install -Dm755 librexruntime.so "$out/lib/skate3recomp/librexruntime.so" mkdir -p "$out/bin" cat > "$out/bin/skate3recomp" << WRAPPER #!/usr/bin/env bash export LD_LIBRARY_PATH="$out/lib/skate3recomp:${vulkan-loader}/lib\''${LD_LIBRARY_PATH:+:\''${LD_LIBRARY_PATH}}" dataDir="\''${SKATE3_DATA_DIR:-\$HOME/.local/share/skate3recomp}" mkdir -p "\$dataDir/logs" exec ${bubblewrap}/bin/bwrap \ --bind / / \ --dev /dev \ --proc /proc \ --tmpfs "$out/lib/skate3recomp" \ --bind "$out/lib/skate3recomp/skate3" "$out/lib/skate3recomp/skate3" \ --bind "$out/lib/skate3recomp/librexruntime.so" "$out/lib/skate3recomp/librexruntime.so" \ --bind "\$dataDir/logs" "$out/lib/skate3recomp/logs" \ -- "$out/lib/skate3recomp/skate3" --input_backend=sdl --game_data_root="\$dataDir" "\$@" WRAPPER chmod +x "$out/bin/skate3recomp" runHook postInstall ''; meta = { description = "Unofficial native recompilation of the Xbox 360 version of Skate 3"; longDescription = '' skate3recomp is an unofficial native PC recompilation of Skate 3 (Xbox 360), built with the rexglue recompilation SDK. You must supply your own legally obtained Xbox 360 ISO of Skate 3; the project does not include retail game files. On first launch, click "Select ISO" and point the app at your ISO. Game data will be extracted to ''${SKATE3_DATA_DIR:-~/.local/share/skate3recomp}. ''; homepage = "https://github.com/mchughalex/skate3recomp"; license = lib.licenses.unfree; platforms = [ "x86_64-linux" ]; maintainers = [ ]; sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; }; })