2015-05-01 14:35:56 -07:00
|
|
|
{ stdenv, fetchurl, pkgconfig
|
|
|
|
|
2016-04-18 11:42:50 -07:00
|
|
|
# Optional Dependencies
|
2015-05-01 14:35:56 -07:00
|
|
|
, openssl ? null, libev ? null, zlib ? null, jansson ? null, boost ? null
|
|
|
|
, libxml2 ? null, jemalloc ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-18 11:42:50 -07:00
|
|
|
name = "nghttp2-${version}";
|
2016-12-09 15:36:28 -08:00
|
|
|
version = "1.17.0";
|
2015-05-01 14:35:56 -07:00
|
|
|
|
|
|
|
# Don't use fetchFromGitHub since this needs a bootstrap curl
|
|
|
|
src = fetchurl {
|
2016-04-11 09:22:28 -07:00
|
|
|
url = "https://github.com/nghttp2/nghttp2/releases/download/v${version}/nghttp2-${version}.tar.bz2";
|
2016-12-09 15:36:28 -08:00
|
|
|
sha256 = "7685b6717d205d3a251b7dd5e73a7ca5e643bc5c01f928b82bfeed30c243f28a";
|
2015-05-01 14:35:56 -07:00
|
|
|
};
|
|
|
|
|
2015-05-14 13:35:35 -07:00
|
|
|
# Configure script searches for a symbol which does not exist in jemalloc on Darwin
|
|
|
|
# Reported upstream in https://github.com/tatsuhiro-t/nghttp2/issues/233
|
2016-04-18 11:42:50 -07:00
|
|
|
postPatch = if stdenv.isDarwin && jemalloc != null then ''
|
2015-05-14 13:35:35 -07:00
|
|
|
substituteInPlace configure --replace "malloc_stats_print" "je_malloc_stats_print"
|
|
|
|
'' else null;
|
|
|
|
|
2016-08-28 17:30:01 -07:00
|
|
|
outputs = [ "out" "dev" "lib" ];
|
2016-04-18 11:42:50 -07:00
|
|
|
|
2015-05-01 14:35:56 -07:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-04-18 11:42:50 -07:00
|
|
|
buildInputs = [ openssl libev zlib ];
|
2015-05-01 14:35:56 -07:00
|
|
|
|
2016-04-18 11:42:50 -07:00
|
|
|
enableParallelBuilding = true;
|
2015-05-01 14:35:56 -07:00
|
|
|
|
2015-06-01 11:52:03 -07:00
|
|
|
meta = with stdenv.lib; {
|
2015-05-01 14:35:56 -07:00
|
|
|
homepage = http://nghttp2.org/;
|
2016-04-18 11:42:50 -07:00
|
|
|
description = "A C implementation of HTTP/2";
|
2015-05-01 14:35:56 -07:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ wkennington ];
|
|
|
|
};
|
|
|
|
}
|