nixpkgs/pkgs/tools/networking/haproxy/default.nix

62 lines
1.9 KiB
Nix
Raw Normal View History

{ useLua ? false
, usePcre ? false
, stdenv, fetchurl
, openssl, zlib, lua ? null, pcre ? null
}:
assert useLua -> lua != null;
assert usePcre -> pcre != null;
stdenv.mkDerivation rec {
2017-01-26 09:37:51 +01:00
pname = "haproxy";
majorVersion = "1.7";
2017-03-13 23:17:03 +01:00
minorVersion = "3";
2017-01-26 09:37:51 +01:00
version = "${majorVersion}.${minorVersion}";
name = "${pname}-${version}";
2013-10-29 15:55:25 +01:00
src = fetchurl {
2017-01-26 09:37:51 +01:00
url = "http://www.haproxy.org/download/${majorVersion}/src/${name}.tar.gz";
2017-03-13 23:17:03 +01:00
sha256 = "ebb31550a5261091034f1b6ac7f4a8b9d79a8ce2a3ddcd7be5b5eb355c35ba65";
};
buildInputs = [ openssl zlib ]
++ stdenv.lib.optional useLua lua
++ stdenv.lib.optional usePcre pcre;
2017-03-07 18:50:45 +01:00
# TODO: make it work on bsd as well
makeFlags = [
"PREFIX=\${out}"
("TARGET=" + (if stdenv.isSunOS then "solaris"
else if stdenv.isLinux then "linux2628"
else if stdenv.isDarwin then "osx"
else "generic"))
];
buildFlags = [
"USE_OPENSSL=yes"
"USE_ZLIB=yes"
] ++ stdenv.lib.optionals usePcre [
"USE_PCRE=yes"
"USE_PCRE_JIT=yes"
] ++ stdenv.lib.optionals useLua [
"USE_LUA=yes"
"LUA_LIB=${lua}/lib"
"LUA_INC=${lua}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "CC=cc";
meta = {
description = "Reliable, high performance TCP/HTTP load balancer";
longDescription = ''
HAProxy is a free, very fast and reliable solution offering high
availability, load balancing, and proxying for TCP and HTTP-based
applications. It is particularly suited for web sites crawling under very
high loads while needing persistence or Layer7 processing. Supporting
tens of thousands of connections is clearly realistic with todays
hardware.
'';
homepage = http://haproxy.1wt.eu;
maintainers = [ stdenv.lib.maintainers.garbas ];
2017-03-07 18:50:45 +01:00
platforms = with stdenv.lib.platforms; linux ++ darwin;
2015-03-26 19:32:37 +01:00
license = stdenv.lib.licenses.gpl2;
};
}