at 18.03-beta 50 lines 1.6 kB view raw
1{ stdenv, fetchurl, pkgconfig 2 3# Optional Dependencies 4, openssl ? null, libev ? null, zlib ? null, c-ares ? null 5, enableHpack ? false, jansson ? null 6, enableAsioLib ? false, boost ? null 7, enableGetAssets ? false, libxml2 ? null 8, enableJemalloc ? false, jemalloc ? null 9}: 10 11assert enableHpack -> jansson != null; 12assert enableAsioLib -> boost != null; 13assert enableGetAssets -> libxml2 != null; 14assert enableJemalloc -> jemalloc != null; 15 16let inherit (stdenv.lib) optional; in 17 18stdenv.mkDerivation rec { 19 name = "nghttp2-${version}"; 20 version = "1.24.0"; 21 22 src = fetchurl { 23 url = "https://github.com/nghttp2/nghttp2/releases/download/v${version}/nghttp2-${version}.tar.bz2"; 24 sha256 = "18ys6p39yvm9wjjzhhlw35c9m8f5gf4dk9jbshibj19q4js1pnv9"; 25 }; 26 27 outputs = [ "bin" "out" "dev" "lib" ]; 28 29 nativeBuildInputs = [ pkgconfig ]; 30 buildInputs = [ openssl libev zlib c-ares ] 31 ++ optional enableHpack jansson 32 ++ optional enableAsioLib boost 33 ++ optional enableGetAssets libxml2 34 ++ optional enableJemalloc jemalloc; 35 36 enableParallelBuilding = true; 37 38 configureFlags = [ "--with-spdylay=no" "--disable-examples" "--disable-python-bindings" "--enable-app" ] 39 ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib"; 40 41 #doCheck = true; # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc 42 43 meta = with stdenv.lib; { 44 homepage = https://nghttp2.org/; 45 description = "A C implementation of HTTP/2"; 46 license = licenses.mit; 47 platforms = platforms.all; 48 maintainers = with maintainers; [ wkennington ]; 49 }; 50}