{ stdenv , cmake , openssl , perl , fetchFromGitHub }: let picotls = fetchFromGitHub { owner = "h2o"; repo = "picotls"; rev = "9238121fa7788e8642072b6d4d1a2f2fb71db242"; sha256 = "0yam62yd606q8v515r74l110gmch4i4bif9hfxn7mgvcdv979l7d"; }; 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 = "20201024"; src = fetchFromGitHub { owner = "h2o"; repo = "quicly"; rev = "d80c87059b6aefd8ab74c370378315f5b077b904"; sha256 = "0l92snfvifmblskxqsrrncjnpy9hhsi7gmvzghbsxk0vx6729h71"; }; outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake perl ]; buildInputs = [ openssl ]; patchPhase = '' sed -i 's|''${CMAKE_SOURCE_DIR}/deps/picotls|${picotls}|g' CMakeLists.txt sed -i 's|deps/klib|${klib}|g' CMakeLists.txt sed -i 's|deps/picotls|${picotls}|g' CMakeLists.txt sed -i 's|deps/picotest|${picotest}|g' CMakeLists.txt sed -i 's|\.\./deps/picotls|${picotls}|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; }; }