about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/search/sphinxsearch/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/search/sphinxsearch/default.nix')
-rw-r--r--nixpkgs/pkgs/servers/search/sphinxsearch/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/search/sphinxsearch/default.nix b/nixpkgs/pkgs/servers/search/sphinxsearch/default.nix
new file mode 100644
index 000000000000..a44f96db7026
--- /dev/null
+++ b/nixpkgs/pkgs/servers/search/sphinxsearch/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, pkg-config, expat, libmysqlclient,
+  enableXmlpipe2 ? false,
+  enableMysql ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sphinxsearch";
+  version = "2.2.11";
+
+  src = fetchurl {
+    url = "http://sphinxsearch.com/files/sphinx-${version}-release.tar.gz";
+    sha256 = "1aa1mh32y019j8s3sjzn4vwi0xn83dwgl685jnbgh51k16gh6qk6";
+  };
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--program-prefix=sphinxsearch-"
+    "--enable-id64"
+  ] ++ lib.optionals (!enableMysql) [
+    "--without-mysql"
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = lib.optionals enableMysql [
+    libmysqlclient
+  ] ++ lib.optionals enableXmlpipe2 [
+    expat
+  ];
+
+  CXXFLAGS = with 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     = lib.licenses.gpl2;
+    platforms   = lib.platforms.all;
+    maintainers = with lib.maintainers; [ ederoyd46 valodim ];
+  };
+}