1 {lib, stdenv, fetchurl, cmake, boost, zlib}:
3 stdenv.mkDerivation rec {
4 pname = "clucene-core";
8 url = "mirror://sourceforge/clucene/clucene-core-${version}.tar.gz";
9 sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx";
12 nativeBuildInputs = [ cmake ];
14 buildInputs = [ boost zlib ];
18 "-DBUILD_CONTRIBS_LIB=ON"
19 "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
20 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
21 "-D_CL_HAVE_GCC_ATOMIC_FUNCTIONS=0"
22 "-D_CL_HAVE_NAMESPACES_EXITCODE=0"
23 "-D_CL_HAVE_NAMESPACES_EXITCODE__TRYRUN_OUTPUT="
24 "-D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE=0"
25 "-D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE__TRYRUN_OUTPUT="
26 "-D_CL_HAVE_TRY_BLOCKS_EXITCODE=0"
27 "-D_CL_HAVE_TRY_BLOCKS_EXITCODE__TRYRUN_OUTPUT="
28 "-D_CL_HAVE_PTHREAD_MUTEX_RECURSIVE=0"
29 "-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE=0"
30 "-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE__TRYRUN_OUTPUT="
35 ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
36 ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
37 ./Install-contribs-lib.patch
39 ./fix-missing-include-time.patch
41 # required for darwin and linux-musl
42 ./pthread-include.patch
44 ] ++ lib.optionals stdenv.isDarwin [ ./fix-darwin.patch ];
46 # fails with "Unable to find executable:
47 # /build/clucene-core-2.3.3.4/build/bin/cl_test"
50 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
53 description = "Core library for full-featured text search engine";
55 CLucene is a high-performance, scalable, cross platform, full-featured,
56 open-source indexing and searching API. Specifically, CLucene is the guts
57 of a search engine, the hard stuff. You write the easy stuff: the UI and
58 the process of selecting and parsing your data files to pump them into
59 the search engine yourself, and any specialized queries to pull it back
60 for display or further processing.
62 CLucene is a port of the very popular Java Lucene text search engine API.
64 homepage = "https://clucene.sourceforge.net";
65 platforms = platforms.unix;
66 license = with licenses; [ asl20 lgpl2 ];