nixpkgs-overlay/pkgs/quicly/default.nix

74 lines
1.7 KiB
Nix
Raw Normal View History

2020-10-29 01:07:16 +01:00
{ stdenv
, cmake
, openssl
, perl
, picotls
2020-10-29 01:07:16 +01:00
, 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";
2020-11-22 16:06:47 +01:00
version = "20201120";
2020-10-29 01:07:16 +01:00
src = fetchFromGitHub {
owner = "h2o";
repo = "quicly";
2020-11-22 16:06:47 +01:00
rev = "9ef55a68701e38ed02dea9209faf00356da03a1f";
sha256 = "17iv58jmrdhvzax2gvqm8371qg2lqkklijbcwxc4iwijvpn7881m";
2020-10-29 01:07:16 +01:00
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [
cmake
perl
];
buildInputs = [
openssl
];
patchPhase = ''
sed -i 's|''${CMAKE_SOURCE_DIR}/deps/picotls|${picotls.src}|g' CMakeLists.txt
2020-10-29 01:07:16 +01:00
sed -i 's|deps/klib|${klib}|g' CMakeLists.txt
sed -i 's|deps/picotls|${picotls.src}|g' CMakeLists.txt
2020-10-29 01:07:16 +01:00
sed -i 's|deps/picotest|${picotest}|g' CMakeLists.txt
sed -i 's|../deps/picotls|${picotls.src}|g' src/cli.c
2020-10-29 01:07:16 +01:00
'';
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;
};
}