Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / clucene-core / 2.x.nix
blob18d055a387acfb86c1f4a407ee4af10c930185df
1 {lib, stdenv, fetchurl, cmake, boost, zlib}:
3 stdenv.mkDerivation rec {
4   pname = "clucene-core";
5   version = "2.3.3.4";
7   src = fetchurl {
8     url = "mirror://sourceforge/clucene/clucene-core-${version}.tar.gz";
9     sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx";
10   };
12   nativeBuildInputs = [ cmake ];
14   buildInputs = [ boost zlib ];
16   cmakeFlags = [
17     "-DBUILD_CONTRIBS=ON"
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="
31   ];
33   patches = [
34     # From debian
35     ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
36     ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
37     ./Install-contribs-lib.patch
38     # From arch
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"
48   doCheck = false;
50   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
52   meta = with lib; {
53     description = "Core library for full-featured text search engine";
54     longDescription = ''
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.
63     '';
64     homepage = "https://clucene.sourceforge.net";
65     platforms = platforms.unix;
66     license = with licenses; [ asl20 lgpl2 ];
67   };