{ stdenv , cmake , openssl , perl , picotls , fetchFromGitHub }: let picotest = fetchFromGitHub { owner = "h2o"; repo = "picotest"; rev = "6906d90b39684b8b2c18db5b0c7412128140655d"; sha256 = "1z26mcg40bkrgbxgh4469y97lixls00p75k9j9dw1w18bg8mg49n"; }; klib = fetchFromGitHub { owner = "attractivechaos"; repo = "klib"; rev = "928581a78413bed4efa956731b35b18a638f20f3"; sha256 = "0zzmnh6vgivrm9yky181lm1pxjz7hx98p3hs59dws3zdmv8dfvwj"; }; in stdenv.mkDerivation rec { pname = "quicly"; version = "20201120"; src = fetchFromGitHub { owner = "h2o"; repo = "quicly"; rev = "9ef55a68701e38ed02dea9209faf00356da03a1f"; sha256 = "17iv58jmrdhvzax2gvqm8371qg2lqkklijbcwxc4iwijvpn7881m"; }; outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake perl ]; buildInputs = [ openssl ]; patchPhase = '' sed -i 's|''${CMAKE_SOURCE_DIR}/deps/picotls|${picotls.src}|g' CMakeLists.txt sed -i 's|deps/klib|${klib}|g' CMakeLists.txt sed -i 's|deps/picotls|${picotls.src}|g' CMakeLists.txt sed -i 's|deps/picotest|${picotest}|g' CMakeLists.txt sed -i 's|../deps/picotls|${picotls.src}|g' src/cli.c ''; installPhase = '' runHook preInstall mv cli quicly install -Dt $out/bin quicly install -Dt $out/lib *.a install -Dt $dev/include ../include/quicly.h install -Dt $dev/include/quicly ../include/quicly/*.h runHook postInstall ''; meta = with stdenv.lib; { description = "A modular QUIC stack designed primarily for H2O"; homepage = https://github.com/h2o/quicly; license = licenses.mit; maintainers = with maintainers; [ royneary ]; platforms = platforms.linux; }; }