nixpkgs-overlay/pkgs/picotls/default.nix

66 lines
1.4 KiB
Nix
Raw Normal View History

2020-10-27 21:45:46 +01:00
{ stdenv
, cmake
, brotli
, openssl
, pkgconfig
, fetchFromGitHub
}:
2020-11-17 22:00:39 +01:00
let
picotest = fetchFromGitHub {
owner = "h2o";
repo = "picotest";
rev = "6906d90b39684b8b2c18db5b0c7412128140655d";
sha256 = "1z26mcg40bkrgbxgh4469y97lixls00p75k9j9dw1w18bg8mg49n";
};
in
2020-10-27 21:45:46 +01:00
stdenv.mkDerivation rec {
pname = "picotls";
version = "20201012";
src = fetchFromGitHub {
owner = "h2o";
repo = "picotls";
rev = "9238121fa7788e8642072b6d4d1a2f2fb71db242";
2020-11-17 22:00:39 +01:00
sha256 = "0yam62yd606q8v515r74l110gmch4i4bif9hfxn7mgvcdv979l7d";
2020-10-27 21:45:46 +01:00
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [
cmake
pkgconfig
brotli
];
buildInputs = [
openssl
];
2020-11-17 22:00:39 +01:00
patchPhase = ''
sed -i 's|deps/picotest|${picotest}|g' CMakeLists.txt
sed -i 's|../deps/picotest|${picotest}|g' t/picotls.c
sed -i 's|../deps/picotest|${picotest}|g' t/minicrypto.c
sed -i 's|../deps/picotest|${picotest}|g' t/openssl.c
sed -i 's|../deps/picotest|${picotest}|g' t/fusion.c
'';
2020-10-27 21:45:46 +01:00
installPhase = ''
runHook preInstall
install -Dt $out/lib *.a
install -Dt $dev/include ../include/*.h
install -Dt $dev/include/picotls ../include/picotls/*.h
runHook postInstall
'';
meta = with stdenv.lib; {
description = "Picotls is a TLS 1.3 (RFC 8446) protocol stack written in C";
homepage = https://github.com/h2o/picotls;
license = licenses.mit;
maintainers = with maintainers; [ royneary ];
platforms = platforms.linux;
};
}