Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, cmake, curl, openssl, Security }: 2 3stdenv.mkDerivation (finalAttrs: { 4 pname = "libhv"; 5 version = "1.3.1"; 6 7 src = fetchFromGitHub { 8 owner = "ithewei"; 9 repo = "libhv"; 10 rev = "v${finalAttrs.version}"; 11 hash = "sha256-hzqU06Gc/vNqRKe3DTdP4AihJqeuNpt2mn4GlLuGU6U="; 12 }; 13 14 nativeBuildInputs = [ cmake ]; 15 16 buildInputs = [ curl openssl ] ++ lib.optional stdenv.isDarwin Security; 17 18 cmakeFlags = [ 19 "-DENABLE_UDS=ON" 20 "-DWITH_MQTT=ON" 21 "-DWITH_CURL=ON" 22 "-DWITH_NGHTTP2=ON" 23 "-DWITH_OPENSSL=ON" 24 "-DWITH_KCP=ON" 25 ]; 26 27 meta = with lib; { 28 description = "A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server"; 29 homepage = "https://github.com/ithewei/libhv"; 30 license = licenses.bsd3; 31 maintainers = with maintainers; [ sikmir ]; 32 platforms = platforms.unix; 33 }; 34})