nixpkgs/pkgs/servers/search/manticoresearch/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

116 lines
3.0 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, bison
, cmake
, flex
, pkg-config
, boost
, icu
, libstemmer
, mariadb-connector-c
, re2
2023-06-15 13:18:19 +01:00
, nlohmann_json
2023-08-09 15:24:11 +01:00
, testers
, manticoresearch
2022-08-11 16:14:31 +01:00
}:
2022-08-11 16:14:31 +01:00
let
columnar = stdenv.mkDerivation (finalAttrs: {
2022-08-11 16:14:31 +01:00
pname = "columnar";
2023-08-09 15:24:11 +01:00
version = "c21-s10"; # see NEED_COLUMNAR_API/NEED_SECONDARY_API in Manticore's cmake/GetColumnar.cmake
2022-08-11 16:14:31 +01:00
src = fetchFromGitHub {
owner = "manticoresoftware";
repo = "columnar";
rev = finalAttrs.version;
2023-08-09 15:24:11 +01:00
hash = "sha256-TGFGFfoyHnPSr2U/9dpqFLUN3Dt2jDQrTF/xxDY4pdE=";
2022-08-11 16:14:31 +01:00
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DAPI_ONLY=ON" ];
meta = {
description = "A column-oriented storage and secondary indexing library";
homepage = "https://github.com/manticoresoftware/columnar/";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
};
});
2023-08-09 15:24:11 +01:00
uni-algo = stdenv.mkDerivation (finalAttrs: {
pname = "uni-algo";
version = "0.7.2";
src = fetchFromGitHub {
owner = "manticoresoftware";
repo = "uni-algo";
rev = "v${finalAttrs.version}";
hash = "sha256-+V9w4UJ+3KsyZUYht6OEzms60mBHd8FewVc7f21Z9ww=";
};
nativeBuildInputs = [ cmake ];
meta = {
description = "Unicode Algorithms Implementation for C/C++";
homepage = "https://github.com/manticoresoftware/uni-algo";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
});
2022-08-11 16:14:31 +01:00
in
stdenv.mkDerivation (finalAttrs: {
2022-08-11 16:14:31 +01:00
pname = "manticoresearch";
2023-08-09 15:24:11 +01:00
version = "6.2.0";
2022-08-11 16:14:31 +01:00
src = fetchFromGitHub {
owner = "manticoresoftware";
repo = "manticoresearch";
rev = finalAttrs.version;
2023-08-09 15:24:11 +01:00
hash = "sha256-KmBIQa5C71Y/1oa3XiPfmb941QDU2rWo7Bl5QlAo+yA=";
2022-08-11 16:14:31 +01:00
};
nativeBuildInputs = [
bison
cmake
flex
pkg-config
];
buildInputs = [
boost
columnar
icu.dev
libstemmer
mariadb-connector-c
2023-06-15 13:18:19 +01:00
nlohmann_json
2023-08-09 15:24:11 +01:00
uni-algo
2022-08-11 16:14:31 +01:00
re2
];
postPatch = ''
sed -i 's/set ( Boost_USE_STATIC_LIBS ON )/set ( Boost_USE_STATIC_LIBS OFF )/' src/CMakeLists.txt
# supply our own packages rather than letting manticore download dependencies during build
sed -i 's/^with_get/with_menu/' CMakeLists.txt
2023-08-09 15:24:11 +01:00
sed -i 's/get_dep \( nlohmann_json .* \)/find_package(nlohmann_json)/' CMakeLists.txt
sed -i 's/get_dep \( uni-algo .* \)/find_package(uni-algo)/' CMakeLists.txt
2022-08-11 16:14:31 +01:00
'';
cmakeFlags = [
"-DWITH_GALERA=0"
"-DWITH_MYSQL=1"
"-DMYSQL_INCLUDE_DIR=${mariadb-connector-c.dev}/include/mariadb"
"-DMYSQL_LIB=${mariadb-connector-c.out}/lib/mariadb/libmysqlclient.a"
2022-08-11 16:14:31 +01:00
];
2023-08-09 15:24:11 +01:00
passthru.tests.version = testers.testVersion {
inherit (finalAttrs) version;
package = manticoresearch;
command = "searchd --version";
};
meta = {
2022-08-11 16:14:31 +01:00
description = "Easy to use open source fast database for search";
homepage = "https://manticoresearch.com";
2023-08-09 15:24:11 +01:00
changelog = "https://github.com/manticoresoftware/manticoresearch/releases/tag/${finalAttrs.version}";
license = lib.licenses.gpl2;
mainProgram = "searchd";
maintainers = [ lib.maintainers.jdelStrother ];
platforms = lib.platforms.all;
2022-08-11 16:14:31 +01:00
};
})