From e58e681d9f1407142409c6414769d21df9ff4bd7 Mon Sep 17 00:00:00 2001 From: Thomas Bach Date: Tue, 14 Mar 2017 21:39:40 +0100 Subject: [PATCH] haproxy: refactor `preConfigure` line became too long to edit comfortably. Split up flags into ones necessary during both build and install phase and install phase only. Makefile defines a target for OS X/Darwin which automatically sets the `KQUEUE` flag. --- pkgs/tools/networking/haproxy/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/haproxy/default.nix b/pkgs/tools/networking/haproxy/default.nix index 3b7a68fb972f..88c750525b26 100644 --- a/pkgs/tools/networking/haproxy/default.nix +++ b/pkgs/tools/networking/haproxy/default.nix @@ -15,9 +15,17 @@ stdenv.mkDerivation rec { buildInputs = [ openssl zlib ]; # TODO: make it work on bsd as well - preConfigure = '' - export makeFlags="TARGET=${if stdenv.isSunOS then "solaris" else if stdenv.isLinux then "linux2628" else "generic"} PREFIX=$out USE_OPENSSL=yes USE_ZLIB=yes ${stdenv.lib.optionalString stdenv.isDarwin "CC=cc USE_KQUEUE=1"}" - ''; + 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.optional stdenv.isDarwin "CC=cc"; meta = { description = "Reliable, high performance TCP/HTTP load balancer";