From 28f0597bd60378b9b323d0b31799bf07f64d0a4e Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Thu, 30 Aug 2012 00:31:26 +0400 Subject: [PATCH] Add clucene-core.2.x --- .../libraries/clucene-core/2.x.nix | 27 ++++++++++ ...ile-by-adding-clucene-shared-library.patch | 19 +++++++ ...B_configuration_in_shared_CMakeLists.patch | 20 ++++++++ .../clucene-core/Install-contribs-lib.patch | 49 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 5 files changed, 117 insertions(+) create mode 100644 pkgs/development/libraries/clucene-core/2.x.nix create mode 100644 pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch create mode 100644 pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch create mode 100644 pkgs/development/libraries/clucene-core/Install-contribs-lib.patch diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix new file mode 100644 index 000000000000..72460184df21 --- /dev/null +++ b/pkgs/development/libraries/clucene-core/2.x.nix @@ -0,0 +1,27 @@ +{stdenv, fetchurl, cmake, boost, zlib}: + +stdenv.mkDerivation rec { + name = "clucene-core-2.3.3.4"; + + src = fetchurl { + url = "mirror://sourceforge/clucene/${name}.tar.gz"; + sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx"; + }; + + buildNativeInputs = [ cmake ]; + + buildInputs = [ boost zlib ]; + + cmakeFlags = [ "-DBUILD_CONTRIBS=ON" "-DBUILD_CONTRIBS_LIB=ON" ]; + + patches = # From debian + [ ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch + ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch + ./Install-contribs-lib.patch + ]; + + meta = { + description = "CLucene is a port of the very popular Java Lucene text search engine API. Core package, 2.x branch."; + homepage = http://clucene.sourceforge.net; + }; +} diff --git a/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch b/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch new file mode 100644 index 000000000000..80e49a8e712e --- /dev/null +++ b/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch @@ -0,0 +1,19 @@ +From 7be4a19b76d98260cf95040a47935f854a4ba7a4 Mon Sep 17 00:00:00 2001 +From: Valentin Rusu +Date: Sat, 17 Dec 2011 13:47:58 +0100 +Subject: [PATCH] Fix .pc file by adding clucene-shared library + +--- + src/core/libclucene-core.pc.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/core/libclucene-core.pc.cmake ++++ b/src/core/libclucene-core.pc.cmake +@@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/i + Name: libclucene + Description: CLucene - a C++ search engine, ported from the popular Apache Lucene + Version: @CLUCENE_VERSION_MAJOR@.@CLUCENE_VERSION_MINOR@.@CLUCENE_VERSION_REVISION@.@CLUCENE_VERSION_PATCH@ +-Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core ++Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared + Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext + ~ diff --git a/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch b/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch new file mode 100644 index 000000000000..f5f44a7fa2c4 --- /dev/null +++ b/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch @@ -0,0 +1,20 @@ +From 772481ca94071ddfe65102a451926e4f9aeb4d2c Mon Sep 17 00:00:00 2001 +From: Veit Jahns +Date: Thu, 26 May 2011 13:35:28 +0200 +Subject: [PATCH] Fixing ZLIB configuration in shared's CMakeLists + +--- + src/shared/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/shared/CMakeLists.txt ++++ b/src/shared/CMakeLists.txt +@@ -42,7 +42,7 @@ INCLUDE (CheckAtomicFunctions) + find_package(ZLIB) + IF ( ZLIB_FOUND ) + SET ( EXTRA_LIBS ${EXTRA_LIBS} ${ZLIB_LIBRARY} ) +-ELSEIF ( ZLIB_FOUND ) ++ELSE ( ZLIB_FOUND ) + MESSAGE( "ZLIB not found, using local: ${clucene-ext_SOURCE_DIR}/zlib" ) + SET(ZLIB_INCLUDE_DIR ${clucene-ext_SOURCE_DIR}/zlib ) + SET(ZLIB_LIBRARY ${clucene-ext_BINARY_DIR}) diff --git a/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch b/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch new file mode 100644 index 000000000000..899411fe02b4 --- /dev/null +++ b/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch @@ -0,0 +1,49 @@ +Description: contribs-lib is not built and installed even with config +Author: Vitaliy Filippov +Bug: https://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446 + +--- + CMakeLists.txt | 2 +- + src/contribs-lib/CMakeLists.txt | 17 +++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -163,7 +163,7 @@ IF ( BUILD_CONTRIBS ) + SET(BUILD_CONTRIBS_LIB 1) + ENDIF ( BUILD_CONTRIBS ) + IF ( BUILD_CONTRIBS_LIB ) +- ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL) ++ ADD_SUBDIRECTORY (src/contribs-lib) + ENDIF ( BUILD_CONTRIBS_LIB ) + + +--- a/src/contribs-lib/CMakeLists.txt ++++ b/src/contribs-lib/CMakeLists.txt +@@ -106,9 +106,26 @@ add_library(clucene-contribs-lib SHARED + ) + TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs}) + ++#install public headers. ++FOREACH(file ${HEADERS}) ++ get_filename_component(apath ${file} PATH) ++ get_filename_component(aname ${file} NAME) ++ file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath}) ++ IF ( NOT aname MATCHES "^_.*" ) ++ install(FILES ${file} ++ DESTINATION include/${relpath} ++ COMPONENT development) ++ ENDIF ( NOT aname MATCHES "^_.*" ) ++ENDFOREACH(file) ++ + #set properties on the libraries + SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES + VERSION ${CLUCENE_VERSION} + SOVERSION ${CLUCENE_SOVERSION} + COMPILE_DEFINITIONS_DEBUG _DEBUG + ) ++ ++#and install library ++install(TARGETS clucene-contribs-lib ++ DESTINATION ${LIB_DESTINATION} ++ COMPONENT runtime ) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 099261ab5b49..75c286b965bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3368,6 +3368,8 @@ let clppcre = builderDefsPackage (import ../development/libraries/cl-ppcre) { }; + clucene_core_2 = callPackage ../development/libraries/clucene-core/2.x.nix { }; + clucene_core = callPackage ../development/libraries/clucene-core { }; cluceneCore = clucene_core; # !!! remove this