git.iko.soy/typeable/nixpkgs
on master help sign in
nghttp2: Add derivation
commitcf0b6b7be866aaeac75c2ee24245a7bb6ba633b2 authorWilliam A. Kennington III <william@wkennington.com> dateFri 1 May 2015, 14:35 (12 years ago) parent21fea99
2 files changed+78
pkgs/development/libraries/nghttp2/default.nix+72 pkgs/top-level/all-packages.nix+6
pkgs/development/libraries/nghttp2/default.nixnew file+72
@@ -0,0 +1,72 @@
1+{ stdenv, fetchurl, pkgconfig
2+
3+# Optinal Dependencies
4+, openssl ? null, libev ? null, zlib ? null, jansson ? null, boost ? null
5+, libxml2 ? null, jemalloc ? null
6+
7+# Extra argument
8+, prefix ? ""
9+}:
10+
11+let
12+ mkFlag = trueStr: falseStr: cond: name: val:
13+ if cond == null then null else
14+ "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
15+ mkEnable = mkFlag "enable-" "disable-";
16+ mkWith = mkFlag "with-" "without-";
17+ mkOther = mkFlag "" "" true;
18+
19+ shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
20+
21+ isLib = prefix == "lib";
22+
23+ optOpenssl = if isLib then null else shouldUsePkg openssl;
24+ optLibev = if isLib then null else shouldUsePkg libev;
25+ optZlib = if isLib then null else shouldUsePkg zlib;
26+
27+ hasApp = optOpenssl != null && optLibev != null && optZlib != null;
28+
29+ optJansson = if isLib then null else shouldUsePkg jansson;
30+ #optBoost = if isLib then null else shouldUsePkg boost;
31+ optBoost = null; # Currently detection is broken
32+ optLibxml2 = if !hasApp then null else shouldUsePkg libxml2;
33+ optJemalloc = if !hasApp then null else shouldUsePkg jemalloc;
34+in
35+stdenv.mkDerivation rec {
36+ name = "${prefix}nghttp2-${version}";
37+ version = "0.7.13";
38+
39+ # Don't use fetchFromGitHub since this needs a bootstrap curl
40+ src = fetchurl {
41+ url = "http://pub.wak.io/nixos/tarballs/nghttp2-0.7.13.tar.xz";
42+ sha256 = "1nz14hmfhsxljmf7f3763q9kpn9prfdivrvdr7c74x72s75bzwli";
43+ };
44+
45+ nativeBuildInputs = [ pkgconfig ];
46+ buildInputs = [ optJansson optBoost optLibxml2 optJemalloc ]
47+ ++ stdenv.lib.optionals hasApp [ optOpenssl optLibev optZlib ];
48+
49+ configureFlags = [
50+ (mkEnable false "werror" null)
51+ (mkEnable false "debug" null)
52+ (mkEnable true "threads" null)
53+ (mkEnable hasApp "app" null)
54+ (mkEnable (optJansson != null) "hpack-tools" null)
55+ (mkEnable (optBoost != null) "asio-lib" null)
56+ (mkEnable false "examples" null)
57+ (mkEnable false "python-bindings" null)
58+ (mkEnable false "failmalloc" null)
59+ (mkWith (optLibxml2 != null) "libxml2" null)
60+ (mkWith (optJemalloc != null) "jemalloc" null)
61+ (mkWith false "spdylay" null)
62+ (mkWith false "cython" null)
63+ ];
64+
65+ meta = with stdenv.lib; {
66+ homepage = http://nghttp2.org/;
67+ description = "an implementation of HTTP/2 in C";
68+ license = licenses.mit;
69+ platforms = platforms.all;
70+ maintainers = with maintainers; [ wkennington ];
71+ };
72+}
pkgs/top-level/all-packages.nix+6
@@ -7218,6 +7218,12 @@ let
72187218
72197219 newt = callPackage ../development/libraries/newt { };
72207220
7221+ nghttp2 = callPackage ../development/libraries/nghttp2 { };
7222+ libnghttp2 = nghttp2.override {
7223+ prefix = "lib";
7224+ fetchurl = fetchurlBoot;
7225+ };
7226+
72217227 nix-plugins = callPackage ../development/libraries/nix-plugins {
72227228 nix = pkgs.nixUnstable;
72237229 };