diff --git a/default.nix b/default.nix index d35007d..303604e 100644 --- a/default.nix +++ b/default.nix @@ -17,7 +17,11 @@ self: super: easyhid = super.callPackage ./pkgs/easyhid/default.nix { }; openphone = super.callPackage ./pkgs/openphone/default.nix { }; - nim = super.callPackages ./pkgs/nim/default.nix { }; + nim = super.callPackage ./pkgs/nim/default.nix { }; + + picotls = super.callPackage ./pkgs/picotls/default.nix { }; + + picoquic = super.callPackage ./pkgs/picoquic/default.nix { }; shinto-cli = super.callPackage ./pkgs/shinto-cli { }; diff --git a/pkgs/picoquic/default.nix b/pkgs/picoquic/default.nix new file mode 100644 index 0000000..0815a4a --- /dev/null +++ b/pkgs/picoquic/default.nix @@ -0,0 +1,39 @@ +{ stdenv +, cmake +, openssl +, picotls +, pkgconfig +, fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "picoquic"; + version = "20201023"; + + src = fetchFromGitHub { + owner = "private-octopus"; + repo = "picoquic"; + rev = "5ba6123c5a78ab3238bc11f3310d169cd0bc5234"; + sha256 = "1f8xwkn59wvrfxxfvx23lg8cx73vzmddswvf6ydd724cpc8g62jd"; + }; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ + cmake + pkgconfig + picotls + ]; + + buildInputs = [ + openssl + ]; + + meta = with stdenv.lib; { + description = "Minimalist implementation of the QUIC protocol, as defined by the IETF"; + homepage = https://github.com/private-octopus/picoquic; + license = licenses.mit; + maintainers = with maintainers; [ royneary ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/picotls/default.nix b/pkgs/picotls/default.nix new file mode 100644 index 0000000..7dc62f7 --- /dev/null +++ b/pkgs/picotls/default.nix @@ -0,0 +1,50 @@ +{ stdenv +, cmake +, brotli +, openssl +, pkgconfig +, fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "picotls"; + version = "20201012"; + + src = fetchFromGitHub { + owner = "h2o"; + repo = "picotls"; + rev = "9238121fa7788e8642072b6d4d1a2f2fb71db242"; + sha256 = "01hl9s2jxh792kfzhc12ha9x1wwk9g869k6n4m83cccdnkmghg8j"; + fetchSubmodules = true; + }; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ + cmake + pkgconfig + brotli + ]; + + buildInputs = [ + openssl + ]; + + 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; + }; +}