Skip to content

Commit

Permalink
nghttp2: refactor (close #21029)
Browse files Browse the repository at this point in the history
Turning the dependencies unrelated to the base libnghttp2 into proper
options.  vcunat modified the commit slightly.
  • Loading branch information
c0bw3b authored and vcunat committed Jan 6, 2017
1 parent f70f898 commit 6d3183e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkgs/development/libraries/nghttp2/default.nix
Expand Up @@ -2,9 +2,19 @@

# Optional Dependencies
, openssl ? null, libev ? null, zlib ? null
#, jansson ? null, boost ? null, libxml2 ? null, jemalloc ? null
, enableHpack ? false, jansson ? null
, enableAsioLib ? false, boost ? null
, enableGetAssets ? false, libxml2 ? null
, enableJemalloc ? false, jemalloc ? null
}:

assert enableHpack -> jansson != null;
assert enableAsioLib -> boost != null;
assert enableGetAssets -> libxml2 != null;
assert enableJemalloc -> jemalloc != null;

with { inherit (stdenv.lib) optional; };

stdenv.mkDerivation rec {
name = "nghttp2-${version}";
version = "1.17.0";
Expand All @@ -18,7 +28,11 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "lib" ];

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ openssl libev zlib ];
buildInputs = [ openssl libev zlib ]
++ optional enableHpack jansson
++ optional enableAsioLib boost
++ optional enableGetAssets libxml2
++ optional enableJemalloc jemalloc;

enableParallelBuilding = true;

Expand Down

0 comments on commit 6d3183e

Please sign in to comment.