Skip to content

Commit

Permalink
Merge pull request #80727 from Valodim/sphinxsearch-master
Browse files Browse the repository at this point in the history
 sphinxsearch: Add support for MySQL & xmlpipe2
  • Loading branch information
jtojnar committed Feb 27, 2020
2 parents 6c14807 + 6a6bf70 commit 1a4ab0e
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions pkgs/servers/search/sphinxsearch/default.nix
@@ -1,31 +1,49 @@
{ 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, expat, libmysqlclient,
enableXmlpipe2 ? false,
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";
};

enableParallelBuilding = true;

configureFlags = [
"--program-prefix=sphinxsearch-"
"--without-mysql"
"--enable-id64"
] ++ stdenv.lib.optionals (!enableMysql) [
"--without-mysql"
];

nativeBuildInputs = [
pkgconfig
pkg-config
];

buildInputs = stdenv.lib.optionals enableMysql [
libmysqlclient
] ++ stdenv.lib.optionals enableXmlpipe2 [
expat
];

CXXFLAGS = with stdenv.lib; concatStringsSep " " (optionals stdenv.isDarwin [
# see upstream bug: http://sphinxsearch.com/bugs/view.php?id=2578
# workaround for "error: invalid suffix on literal
"-Wno-reserved-user-defined-literal"
# workaround for "error: non-constant-expression cannot be narrowed from type 'long' to 'int'"
"-Wno-c++11-narrowing"
]);

meta = {
description = "An open source full text search server";
homepage = http://sphinxsearch.com;
license = stdenv.lib.licenses.gpl2;
platforms = stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [ ederoyd46 ];
maintainers = with stdenv.lib.maintainers; [ ederoyd46 valodim ];
};
}

0 comments on commit 1a4ab0e

Please sign in to comment.