{ udev, stdenv, fetchurl, makeWrapper, jre_headless, lib, xorg, libGL, ... }: stdenv.mkDerivation rec { pname = "gdx-liftoff"; version = "1.13.5.1"; src = fetchurl { url = "https://github.com/libgdx/gdx-liftoff/releases/download/v${version}/gdx-liftoff-${version}.jar"; hash = "sha256-9vCXGNGwI/P4VmcdIzTv2GPAX8bZb7nkfopaRAf6yMA="; }; dontUnpack = true; nativeBuildInputs = [makeWrapper]; runtimeDependencies = lib.makeLibraryPath [ # glfw libGL xorg.libX11 xorg.libXcursor xorg.libXext xorg.libXrandr xorg.libXxf86vm ]; installPhase = '' runHook preInstall install -Dm644 $src $out/lib/gdx-liftoff-${version}.jar makeWrapper ${lib.getExe jre_headless} $out/bin/gdx-liftoff-${version} \ --append-flags "-jar $out/lib/gdx-liftoff-${version}.jar"\ ${lib.optionalString stdenv.hostPlatform.isLinux "--prefix LD_LIBRARY_PATH : ${runtimeDependencies}"} runHook postInstall ''; }