* add clucene

This commit is contained in:
Alexander Baldeck 2019-05-28 18:40:19 +00:00
parent f910a0599d
commit 5a90896e62
9 changed files with 287 additions and 0 deletions

81
clucene/PKGBUILD Normal file
View File

@ -0,0 +1,81 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Alexander Rødseth
# Contributor: Alois Nespor <alois.nespor@gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
pkgname=clucene
pkgver=2.3.3.4
pkgrel=10
pkgdesc="C++ port of the high-performance text search engine Lucene"
arch=(x86_64 powerpc64le)
url="http://clucene.sourceforge.net/"
license=('APACHE' 'LGPL')
depends=('gcc-libs>=4.7.1-5' 'zlib' 'boost-libs')
makedepends=('cmake' 'boost>=1.54.0')
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-core-$pkgver.tar.gz
# Fedora patches
clucene-core-2.3.3.4-pkgconfig.patch
clucene-core-2.3.3.4-install_contribs_lib.patch
# upstream patch
fix_zlib_detections.diff
# LibreOffice patches
clucene-warnings.patch
clucene-gcc-atomics.patch
clucene-debug.patch
clucene-narrowing-conversions.patch
clucene-multimap-put.patch)
sha512sums=('1c9da9077edcebd46563bd9e47d330518e0b30061016650a759cfe051e9748fdad8932a472b1cca53a6adafed5f41656527271fc5f55ddfcefb558f0d83286b4'
'b357cb5a1c5d66219f3168724a71af3ebf5c45c752a612d3a69c170b739acc065dc17c261c3a730298ea6c637fe820637a100f73ab03d931734f80bb598fbf55'
'0aa92635949089196e4e7c579e78761e8751987ef5036320a161a4aaa67da3c63756398c903419c76ea0fbdc8a949e871fcb65be98179a9853a24a5a4cacfde3'
'883cdd389a1f6f9483250cf55030b944f5a0b5e82607f9a71ead0abaa2a9a0f08bc339ffe0518c78b65ad543e659a9eee35555a7bd9abbdae9d5204499ac039f'
'd74c3e4cccbb05b576c063c8e25a67546b70c5bc59f2ee62be8a7095ae90020278709df79316b0f233153a76968abf465d933a81706ee2e68583f6bf921e6604'
'c2ed8a7e7612a47e1f49266f0ea07a2a29a9d5db2b7d6f5079c031cd6edef7f39b0d771ee6f88665957d798be05ff83fd8a93cc9a84b414d84ed3344034bd0de'
'd1de3ffba0ec3f5cf54c86339182355809be28e43245e49b3f78b43e8e8572fa6e7ca5ed174c22cc6792a678157a61f30773e3c2243f199d5178b6929f34bd41'
'f39f36b385f09722026a7759ee49b89ec6b5f06db0d56b472628cc68fd9badd35cc6b977122eb8e6ae108fa71b075315377ee83e9fc85e2d1722c434cfdc18b4'
'07c8b496045e5d9d4256ad854734d6228abb67455f2349b20173d42fc733cb0663559818542c257ef2cdd84e6d08f673bfea38591087498e2e2466f555af3b04')
build() {
cd $srcdir/$pkgname-core-$pkgver
# add missing contrib-libs needed by LibO 3.6, patch by FC
patch -Np1 -i ${srcdir}/clucene-core-2.3.3.4-install_contribs_lib.patch
# pkgconfig file is missing clucene-shared (upstream ID: 3461512), patch by FC
patch -Np1 -i ${srcdir}/clucene-core-2.3.3.4-pkgconfig.patch
# one upstream postrelease commit for proper zlib detection
patch -Np1 -i ${srcdir}/fix_zlib_detections.diff
# LibreOffice patches http://cgit.freedesktop.org/libreoffice/core/tree/clucene/patches
patch -Np0 -i ${srcdir}/clucene-warnings.patch
patch -Np0 -i ${srcdir}/clucene-gcc-atomics.patch
patch -Np0 -i ${srcdir}/clucene-debug.patch
patch -Np0 -i ${srcdir}/clucene-narrowing-conversions.patch
patch -Np0 -i ${srcdir}/clucene-multimap-put.patch
mkdir build
pushd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_ASCII_MODE=OFF \
-DENABLE_PACKAGING=OFF \
-DBUILD_CONTRIBS_LIB:BOOL=ON \
-DLIB_DESTINATION:PATH=/usr/lib \
-DLUCENE_SYS_INCLUDES:PATH=/usr/lib \
-DDISABLE_MULTITHREADING=OFF
popd
make -C build
}
#check() {
# cd $srcdir/$pkgname-core-$pkgver
# make cl_test -C build
# make test -C build || /bin/true # currently fails the tests as expected (see FC comment)
#}
package() {
cd $srcdir/$pkgname-core-$pkgver
make DESTDIR="$pkgdir" install -C build
rm -rfv $pkgdir/usr/lib/CLuceneConfig.cmake
cd $pkgdir/usr/include//CLucene
ln -s /usr/lib/CLucene/clucene-config.h .
}

View File

@ -0,0 +1,42 @@
diff -NaurpBb clucene-core-2.3.3.4/CMakeLists.txt clucene-core-2.3.3.4-mod/CMakeLists.txt
--- clucene-core-2.3.3.4/CMakeLists.txt 2011-03-17 03:21:07.000000000 +0300
+++ clucene-core-2.3.3.4-mod/CMakeLists.txt 2011-08-16 16:56:55.968268152 +0400
@@ -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 )
diff -NaurpBb clucene-core-2.3.3.4/src/contribs-lib/CMakeLists.txt clucene-core-2.3.3.4-mod/src/contribs-lib/CMakeLists.txt
--- clucene-core-2.3.3.4/src/contribs-lib/CMakeLists.txt 2011-03-17 03:21:07.000000000 +0300
+++ clucene-core-2.3.3.4-mod/src/contribs-lib/CMakeLists.txt 2011-08-16 17:14:13.499275499 +0400
@@ -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 )

View File

@ -0,0 +1,12 @@
diff -up clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake.pkgconfig_sys_includes clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake
--- clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake.pkgconfig_sys_includes 2011-03-16 19:21:07.000000000 -0500
+++ clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake 2012-03-19 09:01:00.689263954 -0500
@@ -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
-Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext
+Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared
+Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext -I@LUCENE_SYS_INCLUDES@
~

View File

@ -0,0 +1,11 @@
--- src/core/CLucene/index/TermInfosReader.cpp
+++ src/core/CLucene/index/TermInfosReader.cpp
@@ -111,7 +111,7 @@
//destroy their elements
#ifdef _DEBUG
for ( int32_t i=0; i<indexTermsLength;++i ){
- indexTerms[i].__cl_refcount--;
+ indexTerms[i].__cl_decref();
}
#endif
//Delete the arrays

View File

@ -0,0 +1,31 @@
--- src/shared/CLucene/config/threads.cpp 2012-02-23 12:06:55.355506304 +0000
+++ src/shared/CLucene/config/threads.cpp 2012-02-23 12:07:17.131766381 +0000
@@ -185,7 +185,7 @@
}
int32_t atomic_threads::atomic_increment(_LUCENE_ATOMIC_INT *theInteger){
- #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
+ #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
return __sync_add_and_fetch(theInteger, 1);
#else
SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK)
@@ -193,7 +193,7 @@
#endif
}
int32_t atomic_threads::atomic_decrement(_LUCENE_ATOMIC_INT *theInteger){
- #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
+ #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
return __sync_sub_and_fetch(theInteger, 1);
#else
SCOPED_LOCK_MUTEX(theInteger->THIS_LOCK)
--- src/shared/CLucene/LuceneThreads.h 2012-02-23 12:36:28.388299322 +0000
+++ src/shared/CLucene/LuceneThreads.h 2012-02-23 12:37:23.131885433 +0000
@@ -70,7 +70,7 @@
void NotifyAll();
};
- #ifdef _CL_HAVE_GCC_ATOMIC_FUNCTIONS
+ #if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
#define _LUCENE_ATOMIC_INT uint32_t
#define _LUCENE_ATOMIC_INT_SET(x,v) x=v
#define _LUCENE_ATOMIC_INT_GET(x) x

View File

@ -0,0 +1,10 @@
--- src/core/CLucene/util/VoidMap.h
+++ src/core/CLucene/util/VoidMap.h
@@ -316,6 +316,7 @@ public:
if ( _this::dk || _this::dv )
_this::remove(k);
+ (*this)[k] = v;
}
};

View File

@ -0,0 +1,25 @@
--- src/core/CLucene/queryParser/QueryParser.cpp.sav 2011-03-17 01:21:07.000000000 +0100
+++ src/core/CLucene/queryParser/QueryParser.cpp 2012-03-09 18:20:58.000000000 +0100
@@ -79,7 +79,7 @@
_T("<RANGEEX_GOOP>")
};
-const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
+const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,int32_t(0x80000000),0x20000000,int32_t(0x80000000),0x10000,0x80000,0x10000,0x1f68000};
const int32_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
struct QueryParser::JJCalls {
--- src/core/CLucene/queryParser/QueryParserTokenManager.cpp.sav 2011-03-17 01:21:07.000000000 +0100
+++ src/core/CLucene/queryParser/QueryParserTokenManager.cpp 2012-03-09 18:20:24.000000000 +0100
@@ -15,9 +15,9 @@
CL_NS_DEF(queryParser)
-const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
+const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))};
const int64_t QueryParserTokenManager::jjbitVec0[] = {
- _ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)
+ int64_t(_ILONGLONG(0xfffffffffffffffe)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))
};
const int32_t QueryParserTokenManager::jjnextStates[]={
15, 17, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27,

View File

@ -0,0 +1,54 @@
--- src/core/CLucene/analysis/AnalysisHeader.h 2012-02-22 12:37:22.531637934 +0000
+++ src/core/CLucene/analysis/AnalysisHeader.h 2012-02-22 12:39:15.369916728 +0000
@@ -7,6 +7,8 @@
#ifndef _lucene_analysis_AnalysisHeader_
#define _lucene_analysis_AnalysisHeader_
+#pragma GCC system_header
+
#include "CLucene/index/Payload.h"
#include "CLucene/util/VoidList.h"
#include "CLucene/LuceneThreads.h"
--- src/core/CLucene/search/Searchable.h 2012-02-22 12:37:22.513637729 +0000
+++ src/core/CLucene/search/Searchable.h 2012-02-22 12:38:51.073641550 +0000
@@ -7,6 +7,7 @@
#ifndef _lucene_search_Searcher_
#define _lucene_search_Searcher_
+#pragma GCC system_header
//#include "CLucene/index/IndexReader.h"
CL_CLASS_DEF(index,Term)
--- src/core/CLucene/store/IndexInput.h 2012-02-22 12:37:22.508637673 +0000
+++ src/core/CLucene/store/IndexInput.h 2012-02-22 12:39:00.465747935 +0000
@@ -7,6 +7,8 @@
#ifndef _lucene_store_IndexInput_
#define _lucene_store_IndexInput_
+#pragma GCC system_header
+
#include "CLucene/LuceneThreads.h"
#include "CLucene/util/Equators.h"
--- src/core/CLucene/util/Array.h 2012-02-22 12:37:22.510637696 +0000
+++ src/core/CLucene/util/Array.h 2012-02-22 12:38:33.714444884 +0000
@@ -7,6 +7,8 @@
#ifndef _lucene_util_Array_
#define _lucene_util_Array_
+#pragma GCC system_header
+
#include <stdlib.h>
#include <string.h>
--- src/core/CLucene/util/PriorityQueue.h 2012-02-22 12:37:22.510637696 +0000
+++ src/core/CLucene/util/PriorityQueue.h 2012-02-22 12:38:40.316519685 +0000
@@ -7,6 +7,8 @@
#ifndef _lucene_util_PriorityQueue_
#define _lucene_util_PriorityQueue_
+#pragma GCC system_header
+
#include <stdlib.h>
CL_NS_DEF(util)

View File

@ -0,0 +1,21 @@
From: Veit Jahns <idolum@users.sourceforge.net>
Date: Thu, 26 May 2011 11:35:28 +0000 (+0200)
Subject: Fixing ZLIB configuration in shared's CMakeLists
X-Git-Url: http://clucene.git.sourceforge.net/git/gitweb.cgi?p=clucene%2Fclucene;a=commitdiff_plain;h=772481ca94071ddfe65102a451926e4f9aeb4d2c;hp=a834f87bad3543b2a0331cef7202c15ded4245be
Fixing ZLIB configuration in shared's CMakeLists
---
diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt
index 68314a7..3d1975e 100644
--- 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})