nixpkgs/pkgs/development/libraries/libmicrohttpd/default.nix

58 lines
1.8 KiB
Nix
Raw Normal View History

2015-05-02 00:48:59 +00:00
{ stdenv, fetchurl, pkgconfig
, curl
2015-05-02 00:48:59 +00:00
# Optional Dependencies
, openssl ? null, zlib ? null, libgcrypt ? null, gnutls ? null
}:
with stdenv;
2015-05-02 00:48:59 +00:00
let
optOpenssl = shouldUsePkg openssl;
optZlib = shouldUsePkg zlib;
hasSpdy = optOpenssl != null && optZlib != null;
optLibgcrypt = shouldUsePkg libgcrypt;
optGnutls = shouldUsePkg gnutls;
hasHttps = optLibgcrypt != null && optGnutls != null;
in
with stdenv.lib;
stdenv.mkDerivation rec {
2015-05-02 00:48:59 +00:00
name = "libmicrohttpd-0.9.41";
src = fetchurl {
url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
2015-05-02 00:48:59 +00:00
sha256 = "0z3s3aplgxj8cj947i4rxk9wzvg68b8hbn71fyipc7aagmivx64p";
};
2015-05-02 00:48:59 +00:00
nativeBuildInputs = [ pkgconfig ];
buildInputs = optional doCheck curl
++ optionals hasSpdy [ optOpenssl optZlib ]
++ optionals hasHttps [ optLibgcrypt optGnutls ];
2015-05-02 00:48:59 +00:00
configureFlags = [
(mkWith true "threads" "posix")
(mkEnable true "doc" null)
(mkEnable false "examples" null)
(mkEnable true "epoll" "auto")
(mkEnable doCheck "curl" null)
(mkEnable hasSpdy "spdy" null)
(mkEnable true "messages" null)
(mkEnable true "postprocessor" null)
(mkWith hasHttps "gnutls" null)
(mkEnable hasHttps "https" null)
(mkEnable true "bauth" null)
(mkEnable true "dauth" null)
];
# Disabled because the tests can time-out.
doCheck = false;
meta = {
description = "Embeddable HTTP server library";
homepage = http://www.gnu.org/software/libmicrohttpd/;
2015-05-02 00:48:59 +00:00
license = licenses.lgpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ wkennington ];
};
}