{ lib, stdenvNoCC, fetchurl, fetchzip, autoPatchelfHook, libcxx, readline }: stdenvNoCC.mkDerivation rec { pname = "PocketMine-MP"; version = "5.21.1"; php = fetchzip { url = "https://github.com/pmmp/PHP-Binaries/releases/download/php-8.2-latest/PHP-Linux-x86_64-PM5.tar.gz"; hash = "sha256-OO7wGQxJ/0+WiNILd8IE3xwBVFjfcD/AiK0E9aGi2gw="; }; dontUnpack = true; src = fetchurl { url = "https://github.com/pmmp/${pname}/releases/download/${version}/PocketMine-MP.phar"; hash = "sha256-cZH+GAMBdpQwXeqIPSLZWk2oEtWD/4ZgjPYySomZqSQ="; }; nativeBuildInputs = [ autoPatchelfHook ]; buildInputs = [ libcxx readline ]; installPhase = '' runHook preInstall mkdir $out; cp -r ${php}/php7/. $out/ cp $src $out/PocketMine-MP.phar runHook postInstall ''; meta = with lib; { description = "A server software for Minecraft: Bedrock Edition in PHP."; homepage = "https://github.com/pmmp/PocketMine-MP"; license = with licenses; [ gpl3Only ]; platforms = platforms.linux; }; }