From f14b3aa8c01834ac3baf62f4d590c539b5151b06 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Fri, 21 Feb 2020 13:33:57 +0100 Subject: [PATCH] sphinxsearch: add support for mysql sources --- pkgs/servers/search/sphinxsearch/default.nix | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pkgs/servers/search/sphinxsearch/default.nix b/pkgs/servers/search/sphinxsearch/default.nix index fb2ad9482413..bcba015333f4 100644 --- a/pkgs/servers/search/sphinxsearch/default.nix +++ b/pkgs/servers/search/sphinxsearch/default.nix @@ -1,24 +1,29 @@ -{ stdenv, fetchurl, pkgconfig, - version ? "2.2.11", - mainSrc ? fetchurl { - url = "http://sphinxsearch.com/files/sphinx-${version}-release.tar.gz"; - sha256 = "1aa1mh32y019j8s3sjzn4vwi0xn83dwgl685jnbgh51k16gh6qk6"; - } +{ stdenv, fetchurl, pkg-config, libmysqlclient, + enableMysql ? true }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "sphinxsearch"; - inherit version; - src = mainSrc; + version = "2.2.11"; + + src = fetchurl { + url = "http://sphinxsearch.com/files/sphinx-${version}-release.tar.gz"; + sha256 = "1aa1mh32y019j8s3sjzn4vwi0xn83dwgl685jnbgh51k16gh6qk6"; + }; configureFlags = [ "--program-prefix=sphinxsearch-" - "--without-mysql" "--enable-id64" + ] ++ stdenv.lib.optionals (!enableMysql) [ + "--without-mysql" ]; nativeBuildInputs = [ - pkgconfig + pkg-config + ]; + + buildInputs = stdenv.lib.optionals enableMysql [ + libmysqlclient ]; meta = {