diff options
Diffstat (limited to 'dev-cpp/clucene')
-rw-r--r-- | dev-cpp/clucene/clucene-2.3.3.4-r9.ebuild (renamed from dev-cpp/clucene/clucene-2.3.3.4-r6.ebuild) | 36 | ||||
-rw-r--r-- | dev-cpp/clucene/files/clucene-2.3.3.4-fix-binary-function.patch | 199 | ||||
-rw-r--r-- | dev-cpp/clucene/files/clucene-2.3.3.4-fix-clang.patch | 35 | ||||
-rw-r--r-- | dev-cpp/clucene/files/clucene-2.3.3.4-gmtime.patch | 12 | ||||
-rw-r--r-- | dev-cpp/clucene/files/clucene-2.3.3.4-libcxx.patch | 48 | ||||
-rw-r--r-- | dev-cpp/clucene/files/clucene-2.3.3.4-musl-pthread.patch | 11 | ||||
-rw-r--r-- | dev-cpp/clucene/metadata.xml | 2 |
7 files changed, 323 insertions, 20 deletions
diff --git a/dev-cpp/clucene/clucene-2.3.3.4-r6.ebuild b/dev-cpp/clucene/clucene-2.3.3.4-r9.ebuild index 1c0a68cd765f..37746cd881f2 100644 --- a/dev-cpp/clucene/clucene-2.3.3.4-r6.ebuild +++ b/dev-cpp/clucene/clucene-2.3.3.4-r9.ebuild @@ -1,42 +1,40 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=8 MY_PN="${PN}"-core MY_P="${MY_PN}"-"${PV}" - -inherit cmake-utils multilib +inherit cmake DESCRIPTION="High-performance, full-featured text search engine based off of lucene in C++" -HOMEPAGE="http://clucene.sourceforge.net/" -SRC_URI="mirror://sourceforge/clucene/${MY_P}.tar.gz" +HOMEPAGE="https://clucene.sourceforge.net" +SRC_URI="https://downloads.sourceforge.net/clucene/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_PN}-${PV}" LICENSE="|| ( Apache-2.0 LGPL-2.1 )" SLOT="1" -KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos" - +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos" IUSE="debug doc static-libs" - -DEPEND=" - doc? ( >=app-doc/doxygen-1.4.2 ) -" -RDEPEND="" - RESTRICT="test" -DOCS=(AUTHORS ChangeLog README README.PACKAGE REQUESTS) +BDEPEND="doc? ( >=app-text/doxygen-1.4.2 )" -S="${WORKDIR}/${MY_PN}-${PV}" +DOCS=(AUTHORS ChangeLog README README.PACKAGE REQUESTS) PATCHES=( + "${FILESDIR}/${P}-fix-clang.patch" "${FILESDIR}/${P}-contrib.patch" "${FILESDIR}/${P}-pkgconfig.patch" "${FILESDIR}/${P}-gcc6.patch" + "${FILESDIR}/${P}-gmtime.patch" + "${FILESDIR}/${P}-musl-pthread.patch" + "${FILESDIR}/${P}-libcxx.patch" + "${FILESDIR}/${P}-fix-binary-function.patch" ) src_prepare() { - cmake-utils_src_prepare + cmake_src_prepare # patch out installing bundled boost headers, we build against system one sed -i \ @@ -53,11 +51,11 @@ src_configure() { -DENABLE_PACKAGING=OFF -DDISABLE_MULTITHREADING=OFF -DBUILD_CONTRIBS_LIB=ON - "-DLIB_DESTINATION=${EPREFIX}/usr/$(get_libdir)" + -DLIB_DESTINATION="${EPREFIX}/usr/$(get_libdir)" -DENABLE_DEBUG=$(usex debug) -DENABLE_CLDOCS=$(usex doc) -DBUILD_STATIC_LIBRARIES=$(usex static-libs) ) - cmake-utils_src_configure + cmake_src_configure } diff --git a/dev-cpp/clucene/files/clucene-2.3.3.4-fix-binary-function.patch b/dev-cpp/clucene/files/clucene-2.3.3.4-fix-binary-function.patch new file mode 100644 index 000000000000..dbcff1bb1169 --- /dev/null +++ b/dev-cpp/clucene/files/clucene-2.3.3.4-fix-binary-function.patch @@ -0,0 +1,199 @@ +Replace std::binary_function with typedefs (deprecated in c++11 and removed in c++17). +Bug: https://bugs.gentoo.org/869170 +--- a/src/core/CLucene/index/_Term.h ++++ b/src/core/CLucene/index/_Term.h +@@ -13,9 +13,12 @@ + CL_NS_DEF(index) + + +-class Term_Equals:public CL_NS_STD(binary_function)<const Term*,const Term*,bool> ++class Term_Equals + { + public: ++ typedef const Term* first_argument_type; ++ typedef const Term* second_argument_type; ++ typedef bool result_type; + bool operator()( const Term* val1, const Term* val2 ) const{ + return val1->equals(val2); + } +--- a/src/core/CLucene/search/BooleanQuery.cpp ++++ b/src/core/CLucene/search/BooleanQuery.cpp +@@ -25,9 +25,12 @@ CL_NS_USE(index) + CL_NS_USE(util) + CL_NS_DEF(search) + +- class BooleanClause_Compare:public CL_NS_STD(binary_function)<const BooleanClause*,const BooleanClause*,bool> ++ class BooleanClause_Compare + { + public: ++ typedef const BooleanClause* first_argument_type; ++ typedef const BooleanClause* second_argument_type; ++ typedef bool result_type; + bool operator()( const BooleanClause* val1, const BooleanClause* val2 ) const { + return val1->equals(val2); + } +--- a/src/core/CLucene/search/MultiPhraseQuery.cpp ++++ b/src/core/CLucene/search/MultiPhraseQuery.cpp +@@ -377,9 +377,12 @@ TCHAR* MultiPhraseQuery::toString(const TCHAR* f) const { + return buffer.giveBuffer(); + } + +-class TermArray_Equals:public CL_NS_STD(binary_function)<const Term**,const Term**,bool> ++class TermArray_Equals + { + public: ++ typedef const Term** first_argument_type; ++ typedef const Term** second_argument_type; ++ typedef bool result_type; + bool operator()( CL_NS(util)::ArrayBase<CL_NS(index)::Term*>* val1, CL_NS(util)::ArrayBase<CL_NS(index)::Term*>* val2 ) const{ + if ( val1->length != val2->length ) + return false; +--- a/src/core/CLucene/util/Equators.h ++++ b/src/core/CLucene/util/Equators.h +@@ -22,21 +22,30 @@ CL_NS_DEF(util) + /** @internal */ + class CLUCENE_INLINE_EXPORT Equals{ + public: +- class CLUCENE_INLINE_EXPORT Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> ++ class CLUCENE_INLINE_EXPORT Int32 + { + public: ++ typedef const int32_t* first_argument_type; ++ typedef const int32_t* second_argument_type; ++ typedef bool result_type; + bool operator()( const int32_t val1, const int32_t val2 ) const; + }; + +- class CLUCENE_INLINE_EXPORT Char:public CL_NS_STD(binary_function)<const char*,const char*,bool> ++ class CLUCENE_INLINE_EXPORT Char + { + public: ++ typedef const char* first_argument_type; ++ typedef const char* second_argument_type; ++ typedef bool result_type; + bool operator()( const char* val1, const char* val2 ) const; + }; + #ifdef _UCS2 +- class CLUCENE_INLINE_EXPORT WChar: public CL_NS_STD(binary_function)<const wchar_t*,const wchar_t*,bool> ++ class CLUCENE_INLINE_EXPORT WChar + { + public: ++ typedef const wchar_t* first_argument_type; ++ typedef const wchar_t* second_argument_type; ++ typedef bool result_type; + bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; + }; + class CLUCENE_INLINE_EXPORT TChar: public WChar{ +@@ -48,9 +57,12 @@ public: + + + template<typename _cl> +- class CLUCENE_INLINE_EXPORT Void:public CL_NS_STD(binary_function)<const void*,const void*,bool> ++ class CLUCENE_INLINE_EXPORT Void + { + public: ++ typedef const void* first_argument_type; ++ typedef const void* second_argument_type; ++ typedef bool result_type; + bool operator()( _cl* val1, _cl* val2 ) const{ + return val1==val2; + } +--- a/src/core/CLucene/util/_Arrays.h ++++ b/src/core/CLucene/util/_Arrays.h +@@ -124,12 +124,14 @@ CL_NS_DEF(util) + + template <typename _kt, typename _comparator, + typename class1, typename class2> +- class CLListEquals: +- public CL_NS_STD(binary_function)<class1*,class2*,bool> ++ class CLListEquals + { + typedef typename class1::const_iterator _itr1; + typedef typename class2::const_iterator _itr2; + public: ++ typedef class1* first_argument_type; ++ typedef class2* second_argument_type; ++ typedef bool result_type; + CLListEquals(){ + } + bool equals( class1* val1, class2* val2 ) const{ +--- a/src/test/index/TestTermVectorsReader.cpp ++++ b/src/test/index/TestTermVectorsReader.cpp +@@ -93,17 +93,21 @@ CL_NS_USE(util); + } + }; + +- struct MyTCharCompare : +- public std::binary_function<const TCHAR*, const TCHAR*, bool> ++ struct MyTCharCompare + { ++ typedef const TCHAR* first_argument_type; ++ typedef const TCHAR* second_argument_type; ++ typedef bool result_type; + bool operator () (const TCHAR* v1, const TCHAR* v2) const { + return _tcscmp(v1, v2) < 0; + } + }; + +- struct TestTokenCompare : +- public std::binary_function<const TestToken*, const TestToken*, bool> ++ struct TestTokenCompare + { ++ typedef const TestToken* first_argument_type; ++ typedef const TestToken* second_argument_type; ++ typedef bool result_type; + bool operator () (const TestToken* t1, const TestToken* t2) const { + return t1->pos < t2->pos; + } +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,6 +45,14 @@ ELSE(NOT CMAKE_BUILD_TYPE) + MESSAGE( "Compiling as ${CMAKE_BUILD_TYPE}" ) + ENDIF(NOT CMAKE_BUILD_TYPE) + ++IF(CMAKE_C_COMPILER_ID MATCHES "Clang") ++ SET(CMAKE_COMPILER_IS_CLANG 1) ++ENDIF(CMAKE_C_COMPILER_ID MATCHES "Clang") ++ ++IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ SET(CMAKE_COMPILER_IS_CLANGXX 1) ++ENDIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ++ + OPTION(ENABLE_DEBUG + "enable debug support" + OFF) +@@ -62,14 +70,14 @@ OPTION(ENABLE_ASCII_MODE + OFF) + + SET(ENABLE_ANSI_MODE OFF) +-IF(CMAKE_COMPILER_IS_GNUCXX) ++IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) + SET(ENABLE_ANSI_MODE ON) + + #exceptions: + IF(MINGW OR CYGWIN) + SET(ENABLE_ANSI_MODE OFF) + ENDIF(MINGW OR CYGWIN) +-ENDIF(CMAKE_COMPILER_IS_GNUCXX) ++ENDIF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) + + OPTION(ENABLE_ANSI_MODE + "compile with -ansi flag" +@@ -109,7 +117,7 @@ OPTION(ENABLE_COMPILE_TESTS + + #check flags... + INCLUDE (TestCXXAcceptsFlag) +-IF ( CMAKE_COMPILER_IS_GNUCC ) ++IF ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG ) + CHECK_CXX_ACCEPTS_FLAG(-pg GccFlagPg) + IF ( GccFlagPg ) + OPTION(ENABLE_GPROF +@@ -131,7 +139,7 @@ IF ( CMAKE_COMPILER_IS_GNUCC ) + IF( ENABLE_ANSI_MODE ) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi") + ENDIF ( ENABLE_ANSI_MODE ) +-ENDIF(CMAKE_COMPILER_IS_GNUCC) ++ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) + + + #Single output directory for building all executables and libraries. diff --git a/dev-cpp/clucene/files/clucene-2.3.3.4-fix-clang.patch b/dev-cpp/clucene/files/clucene-2.3.3.4-fix-clang.patch new file mode 100644 index 000000000000..f81f812c4978 --- /dev/null +++ b/dev-cpp/clucene/files/clucene-2.3.3.4-fix-clang.patch @@ -0,0 +1,35 @@ +--- a/src/core/CLucene/queryParser/QueryParser.cpp ++++ b/src/core/CLucene/queryParser/QueryParser.cpp +@@ -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 { +--- a/src/core/CLucene/queryParser/QueryParserTokenManager.cpp ++++ b/src/core/CLucene/queryParser/QueryParserTokenManager.cpp +@@ -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, +--- a/src/core/CLucene/document/DateTools.cpp ++++ b/src/core/CLucene/document/DateTools.cpp +@@ -8,6 +8,7 @@ + + #include "DateTools.h" + #include "CLucene/util/Misc.h" ++#include <time.h> + + CL_NS_USE(util) + CL_NS_DEF(document) diff --git a/dev-cpp/clucene/files/clucene-2.3.3.4-gmtime.patch b/dev-cpp/clucene/files/clucene-2.3.3.4-gmtime.patch new file mode 100644 index 000000000000..d4c702bf217b --- /dev/null +++ b/dev-cpp/clucene/files/clucene-2.3.3.4-gmtime.patch @@ -0,0 +1,12 @@ +diff -Naur clucene-core-2.3.3.4/src/core/CLucene/document/DateTools.cpp clucene-core-2.3.3.4.new/src/core/CLucene/document/DateTools.cpp +--- clucene-core-2.3.3.4/src/core/CLucene/document/DateTools.cpp 2011-03-17 03:21:07.000000000 +0300 ++++ clucene-core-2.3.3.4.new/src/core/CLucene/document/DateTools.cpp 2020-02-21 15:20:17.382575302 +0300 +@@ -9,6 +9,8 @@ + #include "DateTools.h" + #include "CLucene/util/Misc.h" + ++#include <ctime> ++ + CL_NS_USE(util) + CL_NS_DEF(document) + diff --git a/dev-cpp/clucene/files/clucene-2.3.3.4-libcxx.patch b/dev-cpp/clucene/files/clucene-2.3.3.4-libcxx.patch new file mode 100644 index 000000000000..268b887f6d86 --- /dev/null +++ b/dev-cpp/clucene/files/clucene-2.3.3.4-libcxx.patch @@ -0,0 +1,48 @@ +https://bugs.gentoo.org/862195 +https://cgit.freebsd.org/ports/tree/textproc/clucene/files/patch-src__core__CLucene__index__DocumentsWriter.cpp +https://cgit.freebsd.org/ports/plain/textproc/clucene/files/patch-src__core__CLucene__util__VoidMap.h +--- a/src/core/CLucene/index/DocumentsWriter.cpp ++++ b/src/core/CLucene/index/DocumentsWriter.cpp +@@ -125,7 +125,7 @@ + if (this->postingsFreeListDW.values){ + if (this->postingsFreeCountDW < this->postingsFreeListDW.length) { + memset(this->postingsFreeListDW.values + this->postingsFreeCountDW +- , NULL ++ , 0 + , sizeof(Posting*)); + } + postingsFreeListDW.deleteUntilNULL(); + +--- a/src/core/CLucene/util/VoidMap.h ++++ b/src/core/CLucene/util/VoidMap.h +@@ -11,8 +11,13 @@ + #include "CLucene/LuceneThreads.h" + + #if defined(_CL_HAVE_TR1_UNORDERED_MAP) && defined(_CL_HAVE_TR1_UNORDERED_SET) ++#if defined(_LIBCPP_VERSION) ++ #include <unordered_map> ++ #include <unordered_set> ++#else + #include <tr1/unordered_map> + #include <tr1/unordered_set> ++#endif + #elif defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) + //hashing is all or nothing! + #include <hash_map> +@@ -83,7 +88,7 @@ + _vt get( _kt k) const { + const_iterator itr = base::find(k); + if ( itr==base::end() ) +- return (_vt)NULL; ++ return static_cast<_vt>(0); + else + return itr->second; + } +@@ -316,6 +321,7 @@ + if ( _this::dk || _this::dv ) + _this::remove(k); + ++ (*this)[k] = v;; + } + }; + diff --git a/dev-cpp/clucene/files/clucene-2.3.3.4-musl-pthread.patch b/dev-cpp/clucene/files/clucene-2.3.3.4-musl-pthread.patch new file mode 100644 index 000000000000..5fdbb3e3d97d --- /dev/null +++ b/dev-cpp/clucene/files/clucene-2.3.3.4-musl-pthread.patch @@ -0,0 +1,11 @@ +https://bugs.gentoo.org/855071 +--- a/src/shared/CLucene/LuceneThreads.h ++++ b/src/shared/CLucene/LuceneThreads.h +@@ -7,6 +7,7 @@ + #ifndef _LuceneThreads_h + #define _LuceneThreads_h + ++#include <pthread.h> + + CL_NS_DEF(util) + class CLuceneThreadIdCompare; diff --git a/dev-cpp/clucene/metadata.xml b/dev-cpp/clucene/metadata.xml index 1bbc87e2688d..c837748f4921 100644 --- a/dev-cpp/clucene/metadata.xml +++ b/dev-cpp/clucene/metadata.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <!--maintainer-needed--> <upstream> |