3
0
Fork 0
forked from mirrors/nixpkgs

haproxy: 1.9.8 -> 2.0.8

This commit is contained in:
Peter Hoeg 2019-11-08 12:25:03 +08:00 committed by Jon
parent 7cdd581572
commit 4a589e5ea7

View file

@ -1,7 +1,9 @@
{ useLua ? !stdenv.isDarwin { useLua ? !stdenv.isDarwin
, usePcre ? true , usePcre ? true
, stdenv, fetchurl , withPrometheusExporter ? true
, openssl, zlib, lua5_3 ? null, pcre ? null , stdenv, lib, fetchurl
, openssl, zlib
, lua5_3 ? null, pcre ? null, systemd ? null
}: }:
assert useLua -> lua5_3 != null; assert useLua -> lua5_3 != null;
@ -9,39 +11,47 @@ assert usePcre -> pcre != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "haproxy"; pname = "haproxy";
version = "1.9.8"; version = "2.0.8";
src = fetchurl { src = fetchurl {
url = "https://www.haproxy.org/download/${stdenv.lib.versions.majorMinor version}/src/${pname}-${version}.tar.gz"; url = "https://www.haproxy.org/download/${stdenv.lib.versions.majorMinor version}/src/${pname}-${version}.tar.gz";
sha256 = "1via9k84ycrdr8qh4qchcbqgpv0gynm3ra23nwsvqwfqvc0376id"; sha256 = "02i87hr1dfhrk6nvvcig4m9bpww7hyl6qcxcl20rfvxd2n2iwzn3";
}; };
buildInputs = [ openssl zlib ] buildInputs = [ openssl zlib ]
++ stdenv.lib.optional useLua lua5_3 ++ lib.optional useLua lua5_3
++ stdenv.lib.optional usePcre pcre; ++ lib.optional usePcre pcre
++ lib.optional stdenv.isLinux systemd;
# TODO: make it work on bsd as well # TODO: make it work on bsd as well
makeFlags = [ makeFlags = [
"PREFIX=\${out}" "PREFIX=\${out}"
("TARGET=" + (if stdenv.isSunOS then "solaris" ("TARGET=" + (if stdenv.isSunOS then "solaris"
else if stdenv.isLinux then "linux2628" else if stdenv.isLinux then "linux-glibc"
else if stdenv.isDarwin then "osx" else if stdenv.isDarwin then "osx"
else "generic")) else "generic"))
]; ];
buildFlags = [ buildFlags = [
"USE_OPENSSL=yes" "USE_OPENSSL=yes"
"USE_ZLIB=yes" "USE_ZLIB=yes"
] ++ stdenv.lib.optionals usePcre [ ] ++ lib.optionals usePcre [
"USE_PCRE=yes" "USE_PCRE=yes"
"USE_PCRE_JIT=yes" "USE_PCRE_JIT=yes"
] ++ stdenv.lib.optionals useLua [ ] ++ lib.optionals useLua [
"USE_LUA=yes" "USE_LUA=yes"
"LUA_LIB=${lua5_3}/lib" "LUA_LIB=${lua5_3}/lib"
"LUA_INC=${lua5_3}/include" "LUA_INC=${lua5_3}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "CC=cc" ] ++ lib.optionals stdenv.isLinux [
++ stdenv.lib.optional stdenv.isLinux "USE_GETADDRINFO=1"; "USE_SYSTEMD=yes"
"USE_GETADDRINFO=1"
] ++ lib.optionals withPrometheusExporter [
"EXTRA_OBJS=contrib/prometheus-exporter/service-prometheus.o"
] ++ lib.optional stdenv.isDarwin "CC=cc";
meta = { enableParallelBuilding = true;
meta = with lib; {
description = "Reliable, high performance TCP/HTTP load balancer"; description = "Reliable, high performance TCP/HTTP load balancer";
longDescription = '' longDescription = ''
HAProxy is a free, very fast and reliable solution offering high HAProxy is a free, very fast and reliable solution offering high
@ -51,9 +61,9 @@ stdenv.mkDerivation rec {
tens of thousands of connections is clearly realistic with todays tens of thousands of connections is clearly realistic with todays
hardware. hardware.
''; '';
homepage = http://haproxy.1wt.eu; homepage = "https://haproxy.org";
maintainers = with stdenv.lib.maintainers; [ fuzzy-id ]; license = licenses.gpl2;
platforms = with stdenv.lib.platforms; linux ++ darwin; maintainers = with maintainers; [ fuzzy-id ];
license = stdenv.lib.licenses.gpl2; platforms = with platforms; linux ++ darwin;
}; };
} }