Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-19.03 60 lines 1.9 kB view raw
1{ useLua ? !stdenv.isDarwin 2, usePcre ? true 3, stdenv, fetchurl 4, openssl, zlib, lua5_3 ? null, pcre ? null 5}: 6 7assert useLua -> lua5_3 != null; 8assert usePcre -> pcre != null; 9 10stdenv.mkDerivation rec { 11 pname = "haproxy"; 12 version = "1.9.1"; 13 name = "${pname}-${version}"; 14 15 src = fetchurl { 16 url = "https://www.haproxy.org/download/${stdenv.lib.versions.majorMinor version}/src/${name}.tar.gz"; 17 sha256 = "1qf8q49njx9n3b1g10zz3kcqmhji8lqcklh7723671z3l4pk2imd"; 18 }; 19 20 buildInputs = [ openssl zlib ] 21 ++ stdenv.lib.optional useLua lua5_3 22 ++ stdenv.lib.optional usePcre pcre; 23 24 # TODO: make it work on bsd as well 25 makeFlags = [ 26 "PREFIX=\${out}" 27 ("TARGET=" + (if stdenv.isSunOS then "solaris" 28 else if stdenv.isLinux then "linux2628" 29 else if stdenv.isDarwin then "osx" 30 else "generic")) 31 ]; 32 buildFlags = [ 33 "USE_OPENSSL=yes" 34 "USE_ZLIB=yes" 35 ] ++ stdenv.lib.optionals usePcre [ 36 "USE_PCRE=yes" 37 "USE_PCRE_JIT=yes" 38 ] ++ stdenv.lib.optionals useLua [ 39 "USE_LUA=yes" 40 "LUA_LIB=${lua5_3}/lib" 41 "LUA_INC=${lua5_3}/include" 42 ] ++ stdenv.lib.optional stdenv.isDarwin "CC=cc" 43 ++ stdenv.lib.optional stdenv.isLinux "USE_GETADDRINFO=1"; 44 45 meta = { 46 description = "Reliable, high performance TCP/HTTP load balancer"; 47 longDescription = '' 48 HAProxy is a free, very fast and reliable solution offering high 49 availability, load balancing, and proxying for TCP and HTTP-based 50 applications. It is particularly suited for web sites crawling under very 51 high loads while needing persistence or Layer7 processing. Supporting 52 tens of thousands of connections is clearly realistic with todays 53 hardware. 54 ''; 55 homepage = http://haproxy.1wt.eu; 56 maintainers = with stdenv.lib.maintainers; [ fuzzy-id garbas ]; 57 platforms = with stdenv.lib.platforms; linux ++ darwin; 58 license = stdenv.lib.licenses.gpl2; 59 }; 60}