summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-18 20:42:50 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-18 21:13:18 +0200
commitb4bf4327097265d855ad04f09759bd2eeb73aed1 (patch)
tree6446870bcaab983e69460a8dbfc4966cca683348
parent21a2f2ba3bc8962845f0b45cacac4e47557ebf13 (diff)
downloadnixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.tar
nixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.tar.gz
nixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.tar.bz2
nixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.tar.lz
nixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.tar.xz
nixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.tar.zst
nixlib-b4bf4327097265d855ad04f09759bd2eeb73aed1.zip
nghttp2: 1.8.0 -> 1.9.2, unify with libnghttp2, and use multiple outputs
Note: I ignored the C++ libraries, but it appears we're not currently
using them. Once we do, we'll probably want to put them in a separate
output as well (to prevent non-C++ users from depending on Boost).
-rw-r--r--nixos/modules/services/torrent/transmission.nix2
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix61
-rw-r--r--pkgs/servers/http/apache-httpd/2.4.nix8
-rw-r--r--pkgs/tools/networking/curl/default.nix7
-rw-r--r--pkgs/top-level/all-packages.nix9
5 files changed, 23 insertions, 64 deletions
diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix
index c2220cb0cff7..26182dc93cd4 100644
--- a/nixos/modules/services/torrent/transmission.nix
+++ b/nixos/modules/services/torrent/transmission.nix
@@ -124,7 +124,7 @@ in
           ${pkgs.xz.out}/lib/liblzma*.so*               mr,
           ${pkgs.libgcrypt.out}/lib/libgcrypt*.so*      mr,
           ${pkgs.libgpgerror.out}/lib/libgpg-error*.so* mr,
-          ${pkgs.libnghttp2.out}/lib/libnghttp2*.so*    mr,
+          ${pkgs.nghttp2.lib}/lib/libnghttp2*.so*       mr,
           ${pkgs.c-ares.out}/lib/libcares*.so*          mr,
           ${pkgs.libcap.out}/lib/libcap*.so*            mr,
           ${pkgs.attr.out}/lib/libattr*.so*             mr,
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
index 761f6933f5c4..29175fbb7d45 100644
--- a/pkgs/development/libraries/nghttp2/default.nix
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -1,77 +1,36 @@
 { stdenv, fetchurl, pkgconfig
 
-# Optinal Dependencies
+# Optional Dependencies
 , openssl ? null, libev ? null, zlib ? null, jansson ? null, boost ? null
 , libxml2 ? null, jemalloc ? null
-
-# Extra argument
-, prefix ? ""
 }:
 
-let
-  mkFlag = trueStr: falseStr: cond: name: val:
-    if cond == null then null else
-      "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
-  mkEnable = mkFlag "enable-" "disable-";
-  mkWith = mkFlag "with-" "without-";
-  mkOther = mkFlag "" "" true;
-
-  shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
-
-  isLib = prefix == "lib";
-
-  optOpenssl = if isLib then null else shouldUsePkg openssl;
-  optLibev = if isLib then null else shouldUsePkg libev;
-  optZlib = if isLib then null else shouldUsePkg zlib;
-
-  hasApp = optOpenssl != null && optLibev != null && optZlib != null;
-
-  optJansson = if isLib then null else shouldUsePkg jansson;
-  #optBoost = if isLib then null else shouldUsePkg boost;
-  optBoost = null; # Currently detection is broken
-  optLibxml2 = if !hasApp then null else shouldUsePkg libxml2;
-  optJemalloc = if !hasApp then null else shouldUsePkg jemalloc;
-in
 stdenv.mkDerivation rec {
-  name = "${prefix}nghttp2-${version}";
-  version = "1.8.0";
+  name = "nghttp2-${version}";
+  version = "1.9.2";
 
   # Don't use fetchFromGitHub since this needs a bootstrap curl
   src = fetchurl {
     url = "https://github.com/nghttp2/nghttp2/releases/download/v${version}/nghttp2-${version}.tar.bz2";
-    sha256 = "10xz3s624w208pr9xgm4ammc8bc5mi17vy4357hjfd5vmmp5m8b0";
+    sha256 = "1jnms0mmf73cwdqvbzpdyi974f8xq7p8bxgba2ippw70pz8y0ac0";
   };
 
   # 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
-  postPatch = if (stdenv.isDarwin && optJemalloc != null) then ''
+  postPatch = if stdenv.isDarwin && jemalloc != null then ''
     substituteInPlace configure --replace "malloc_stats_print" "je_malloc_stats_print"
   '' else null;
 
+  outputs = [ "dev" "out" "lib" ];
+
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ optJansson optBoost optLibxml2 optJemalloc ]
-    ++ stdenv.lib.optionals hasApp [ optOpenssl optLibev optZlib ];
+  buildInputs = [ openssl libev zlib ];
 
-  configureFlags = [
-    (mkEnable false                 "werror"          null)
-    (mkEnable false                 "debug"           null)
-    (mkEnable true                  "threads"         null)
-    (mkEnable hasApp                "app"             null)
-    (mkEnable (optJansson != null)  "hpack-tools"     null)
-    (mkEnable (optBoost != null)    "asio-lib"        null)
-    (mkEnable false                 "examples"        null)
-    (mkEnable false                 "python-bindings" null)
-    (mkEnable false                 "failmalloc"      null)
-    (mkWith   (optLibxml2 != null)  "libxml2"         null)
-    (mkWith   (optJemalloc != null) "jemalloc"        null)
-    (mkWith   false                 "spdylay"         null)
-    (mkWith   false                 "cython"          null)
-    (mkWith   false                 "mruby"           null)
-  ];
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     homepage = http://nghttp2.org/;
-    description = "an implementation of HTTP/2 in C";
+    description = "A C implementation of HTTP/2";
     license = licenses.mit;
     platforms = platforms.all;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix
index a39d0e8e3158..f69001da08ac 100644
--- a/pkgs/servers/http/apache-httpd/2.4.nix
+++ b/pkgs/servers/http/apache-httpd/2.4.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, perl, zlib, apr, aprutil, pcre, libiconv
 , proxySupport ? true
 , sslSupport ? true, openssl
-, http2Support ? true, libnghttp2
+, http2Support ? true, nghttp2
 , ldapSupport ? true, openldap
 , libxml2Support ? true, libxml2
 , luaSupport ? false, lua5
@@ -13,7 +13,7 @@ in
 
 assert sslSupport -> aprutil.sslSupport && openssl != null;
 assert ldapSupport -> aprutil.ldapSupport && openldap != null;
-assert http2Support -> libnghttp2 != null;
+assert http2Support -> nghttp2 != null;
 
 stdenv.mkDerivation rec {
   version = "2.4.18";
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     optional sslSupport openssl ++
     optional ldapSupport openldap ++    # there is no --with-ldap flag
     optional libxml2Support libxml2 ++
-    optional http2Support libnghttp2 ++
+    optional http2Support nghttp2 ++
     optional stdenv.isDarwin libiconv;
 
   patchPhase = ''
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
     --enable-cgi
     ${optionalString proxySupport "--enable-proxy"}
     ${optionalString sslSupport "--enable-ssl"}
-    ${optionalString http2Support "--enable-http2 --with-nghttp2=${libnghttp2}"}
+    ${optionalString http2Support "--enable-http2 --with-nghttp2"}
     ${optionalString luaSupport "--enable-lua --with-lua=${lua5}"}
     ${optionalString libxml2Support "--with-libxml2=${libxml2.dev}/include/libxml2"}
     --docdir=$(doc)/share/doc
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index 6008afa27872..47f03cc37477 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, perl
-, http2Support ? true, libnghttp2
+, http2Support ? true, nghttp2
 , idnSupport ? false, libidn ? null
 , ldapSupport ? false, openldap ? null
 , zlibSupport ? false, zlib ? null
@@ -9,7 +9,7 @@
 , c-aresSupport ? false, c-ares ? null
 }:
 
-assert http2Support -> libnghttp2 != null;
+assert http2Support -> nghttp2 != null;
 assert idnSupport -> libidn != null;
 assert ldapSupport -> openldap != null;
 assert zlibSupport -> zlib != null;
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   # "-lz -lssl", which aren't necessary direct build inputs of
   # applications that use Curl.
   propagatedBuildInputs = with stdenv.lib;
-    optional http2Support libnghttp2 ++
+    optional http2Support nghttp2 ++
     optional idnSupport libidn ++
     optional ldapSupport openldap ++
     optional zlibSupport zlib ++
@@ -51,7 +51,6 @@ stdenv.mkDerivation rec {
   configureFlags = [
       "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt"
       "--disable-manual"
-      ( if http2Support then "--with-nghttp2=${libnghttp2}" else "--without-nghttp2" )
       ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" )
       ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" )
       ( if ldapSupport then "--enable-ldap" else "--disable-ldap" )
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 57947babc1bc..3dd70f1231ad 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7536,7 +7536,9 @@ in
 
   libechonest = callPackage ../development/libraries/libechonest { };
 
-  libev = callPackage ../development/libraries/libev { };
+  libev = callPackage ../development/libraries/libev {
+    fetchurl = fetchurlBoot;
+  };
 
   libevent = callPackage ../development/libraries/libevent { };
 
@@ -8276,11 +8278,10 @@ in
 
   newt = callPackage ../development/libraries/newt { };
 
-  nghttp2 = callPackage ../development/libraries/nghttp2 { };
-  libnghttp2 = self.nghttp2.override {
-    prefix = "lib";
+  nghttp2 = callPackage ../development/libraries/nghttp2 {
     fetchurl = fetchurlBoot;
   };
+  libnghttp2 = nghttp2.lib;
 
   nix-plugins = callPackage ../development/libraries/nix-plugins {
     nix = pkgs.nixUnstable;