|
|
|
@ -6,15 +6,15 @@ |
|
|
|
|
|
|
|
|
|
# Optional dependencies |
|
|
|
|
, enableApp ? with stdenv.hostPlatform; !isWindows && !isStatic |
|
|
|
|
, c-ares ? null, libev ? null, openssl ? null, zlib ? null |
|
|
|
|
, enableAsioLib ? false, boost ? null |
|
|
|
|
, enableGetAssets ? false, libxml2 ? null |
|
|
|
|
, enableHpack ? false, jansson ? null |
|
|
|
|
, enableJemalloc ? false, jemalloc ? null |
|
|
|
|
, enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null |
|
|
|
|
, c-ares, libev, openssl, zlib |
|
|
|
|
, enableAsioLib ? false, boost |
|
|
|
|
, enableGetAssets ? false, libxml2 |
|
|
|
|
, enableHpack ? false, jansson |
|
|
|
|
, enableJemalloc ? false, jemalloc |
|
|
|
|
, enablePython ? false, python3Packages, ncurses |
|
|
|
|
|
|
|
|
|
# Unit tests ; we have to set TZDIR, which is a GNUism. |
|
|
|
|
, enableTests ? stdenv.hostPlatform.isGnu, cunit ? null, tzdata ? null |
|
|
|
|
, enableTests ? stdenv.hostPlatform.isGnu, cunit, tzdata |
|
|
|
|
|
|
|
|
|
# downstream dependencies, for testing |
|
|
|
|
, curl |
|
|
|
@ -25,13 +25,9 @@ |
|
|
|
|
# All mutable patches (generated by GitHub or cgit) that are needed here |
|
|
|
|
# should be included directly in Nixpkgs as files. |
|
|
|
|
|
|
|
|
|
assert enableApp -> c-ares != null && libev != null && openssl != null && zlib != null; |
|
|
|
|
assert enableAsioLib -> boost != null; |
|
|
|
|
assert enableGetAssets -> enableApp == true && libxml2 != null; |
|
|
|
|
assert enableHpack -> enableApp == true && jansson != null; |
|
|
|
|
assert enableJemalloc -> enableApp == true && jemalloc != null; |
|
|
|
|
assert enablePython -> python != null && cython != null && ncurses != null && setuptools != null; |
|
|
|
|
assert enableTests -> cunit != null && tzdata != null; |
|
|
|
|
assert enableGetAssets -> enableApp; |
|
|
|
|
assert enableHpack -> enableApp; |
|
|
|
|
assert enableJemalloc -> enableApp; |
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec { |
|
|
|
|
pname = "nghttp2"; |
|
|
|
@ -47,14 +43,14 @@ stdenv.mkDerivation rec { |
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ] |
|
|
|
|
++ lib.optionals (enableApp) [ installShellFiles ] |
|
|
|
|
++ lib.optionals (enablePython) [ cython ]; |
|
|
|
|
++ lib.optionals (enablePython) [ python3Packages.cython ]; |
|
|
|
|
|
|
|
|
|
buildInputs = lib.optionals enableApp [ c-ares libev openssl zlib ] |
|
|
|
|
++ lib.optionals (enableAsioLib) [ boost ] |
|
|
|
|
++ lib.optionals (enableGetAssets) [ libxml2 ] |
|
|
|
|
++ lib.optionals (enableHpack) [ jansson ] |
|
|
|
|
++ lib.optionals (enableJemalloc) [ jemalloc ] |
|
|
|
|
++ lib.optionals (enablePython) [ python ncurses setuptools ]; |
|
|
|
|
++ lib.optionals (enablePython) [ python3Packages.python ncurses python3Packages.setuptools ]; |
|
|
|
|
|
|
|
|
|
enableParallelBuilding = true; |
|
|
|
|
|
|
|
|
@ -62,7 +58,7 @@ stdenv.mkDerivation rec { |
|
|
|
|
"--disable-examples" |
|
|
|
|
(lib.enableFeature enableApp "app") |
|
|
|
|
] ++ lib.optionals (enableAsioLib) [ "--enable-asio-lib" "--with-boost-libdir=${boost}/lib" ] |
|
|
|
|
++ lib.optionals (enablePython) [ "--with-cython=${cython}/bin/cython" ]; |
|
|
|
|
++ lib.optionals (enablePython) [ "--with-cython=${python3Packages.cython}/bin/cython" ]; |
|
|
|
|
|
|
|
|
|
# Unit tests require CUnit and setting TZDIR environment variable |
|
|
|
|
doCheck = enableTests; |
|
|
|
@ -72,13 +68,13 @@ stdenv.mkDerivation rec { |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
preInstall = lib.optionalString (enablePython) '' |
|
|
|
|
mkdir -p $out/${python.sitePackages} |
|
|
|
|
mkdir -p $out/${python3Packages.python.sitePackages} |
|
|
|
|
# convince installer it's ok to install here |
|
|
|
|
export PYTHONPATH="$PYTHONPATH:$out/${python.sitePackages}" |
|
|
|
|
export PYTHONPATH="$PYTHONPATH:$out/${python3Packages.python.sitePackages}" |
|
|
|
|
''; |
|
|
|
|
postInstall = lib.optionalString (enablePython) '' |
|
|
|
|
mkdir -p $python/${python.sitePackages} |
|
|
|
|
mv $out/${python.sitePackages}/* $python/${python.sitePackages} |
|
|
|
|
mkdir -p $python/${python3Packages.python.sitePackages} |
|
|
|
|
mv $out/${python3Packages.python.sitePackages}/* $python/${python3Packages.python.sitePackages} |
|
|
|
|
rm -r $out/lib |
|
|
|
|
'' + lib.optionalString (enableApp) '' |
|
|
|
|
installShellCompletion --bash doc/bash_completion/{h2load,nghttp,nghttpd,nghttpx} |
|
|
|
|