2017-03-29 11:27:50 +01:00
|
|
|
{ useLua ? !stdenv.isDarwin
|
|
|
|
, usePcre ? true
|
2018-08-05 15:48:22 +01:00
|
|
|
, stdenv, fetchurl
|
2017-03-29 11:27:50 +01:00
|
|
|
, openssl, zlib, lua5_3 ? null, pcre ? null
|
2017-03-27 09:21:19 +01:00
|
|
|
}:
|
|
|
|
|
2017-03-29 11:27:50 +01:00
|
|
|
assert useLua -> lua5_3 != null;
|
2017-03-27 09:21:19 +01:00
|
|
|
assert usePcre -> pcre != null;
|
2012-05-18 08:50:10 +01:00
|
|
|
|
2013-07-03 02:36:15 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2017-01-26 08:37:51 +00:00
|
|
|
pname = "haproxy";
|
2018-08-05 15:48:22 +01:00
|
|
|
version = "1.8.13";
|
2017-01-26 08:37:51 +00:00
|
|
|
name = "${pname}-${version}";
|
2013-10-29 14:55:25 +00:00
|
|
|
|
2012-05-18 08:50:10 +01:00
|
|
|
src = fetchurl {
|
2018-03-04 14:28:45 +00:00
|
|
|
url = "https://www.haproxy.org/download/${stdenv.lib.versions.majorMinor version}/src/${name}.tar.gz";
|
2018-08-05 15:48:22 +01:00
|
|
|
sha256 = "2bf5dafbb5f1530c0e67ab63666565de948591f8e0ee2a1d3c84c45e738220f1";
|
2012-05-18 08:50:10 +01:00
|
|
|
};
|
|
|
|
|
2017-03-27 09:21:19 +01:00
|
|
|
buildInputs = [ openssl zlib ]
|
2017-03-29 11:27:50 +01:00
|
|
|
++ stdenv.lib.optional useLua lua5_3
|
2017-03-27 09:21:19 +01:00
|
|
|
++ stdenv.lib.optional usePcre pcre;
|
2012-05-18 08:50:10 +01:00
|
|
|
|
2017-03-07 17:50:45 +00:00
|
|
|
# TODO: make it work on bsd as well
|
2017-03-14 20:39:40 +00:00
|
|
|
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"
|
2017-03-27 09:21:19 +01:00
|
|
|
] ++ stdenv.lib.optionals usePcre [
|
|
|
|
"USE_PCRE=yes"
|
|
|
|
"USE_PCRE_JIT=yes"
|
|
|
|
] ++ stdenv.lib.optionals useLua [
|
|
|
|
"USE_LUA=yes"
|
2017-03-29 11:27:50 +01:00
|
|
|
"LUA_LIB=${lua5_3}/lib"
|
|
|
|
"LUA_INC=${lua5_3}/include"
|
2018-08-05 17:17:27 +01:00
|
|
|
] ++ stdenv.lib.optional stdenv.isDarwin "CC=cc"
|
|
|
|
++ stdenv.lib.optional stdenv.isLinux "USE_GETADDRINFO=1";
|
2013-07-03 02:36:15 +01:00
|
|
|
|
2012-05-18 08:50:10 +01:00
|
|
|
meta = {
|
2013-10-06 10:49:53 +01:00
|
|
|
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.
|
|
|
|
'';
|
2013-07-03 11:41:27 +01:00
|
|
|
homepage = http://haproxy.1wt.eu;
|
2017-03-29 11:27:50 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ fuzzy-id garbas ];
|
2017-03-07 17:50:45 +00:00
|
|
|
platforms = with stdenv.lib.platforms; linux ++ darwin;
|
2015-03-26 18:32:37 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2012-05-18 08:50:10 +01:00
|
|
|
};
|
|
|
|
}
|