From 9401fc604228b3236a8893038fbb6264f8ab376d Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 24 Mar 2017 22:00:18 +0100 Subject: [PATCH] clucene: clean up package, enable x86_64. * enable contrib libs for LibreOffice. --- dev-cpp/clucene/clucene-2.3.3.4.recipe | 60 ++-- .../clucene/patches/clucene-2.3.3.4.patchset | 257 +++++++++++++++++- 2 files changed, 294 insertions(+), 23 deletions(-) diff --git a/dev-cpp/clucene/clucene-2.3.3.4.recipe b/dev-cpp/clucene/clucene-2.3.3.4.recipe index fe994e3d9..f6a716ef3 100644 --- a/dev-cpp/clucene/clucene-2.3.3.4.recipe +++ b/dev-cpp/clucene/clucene-2.3.3.4.recipe @@ -21,53 +21,71 @@ COPYRIGHT="2003-2006 Ben van Klinken 2003-2006 CLucene Team 2003-2006 Jos van den Oever" LICENSE="Apache v2" -REVISION="1" -SOURCE_URI="http://downloads.sourceforge.net/clucene/clucene-core-2.3.3.4.tar.gz" +REVISION="2" +SOURCE_URI="http://downloads.sourceforge.net/clucene/clucene-core-$portVersion.tar.gz" CHECKSUM_SHA256="ddfdc433dd8ad31b5c5819cc4404a8d2127472a3b720d3e744e8c51d79732eab" -SOURCE_DIR="clucene-core-2.3.3.4" -PATCHES="clucene-2.3.3.4.patchset" +SOURCE_DIR="clucene-core-$portVersion" +PATCHES="clucene-$portVersion.patchset" -ARCHITECTURES="" -if [ $effectiveTargetArchitecture != x86_gcc2 ]; then - # x86_gcc2 is fine as primary target architecture as long as we're building - # for a different secondary architecture. - ARCHITECTURES="$ARCHITECTURES x86_gcc2" -fi +ARCHITECTURES="x86 x86_64" SECONDARY_ARCHITECTURES="x86" PROVIDES=" clucene$secondaryArchSuffix = $portVersion + lib:libclucene_contribs_lib$secondaryArchSuffix = $portVersion + lib:libclucene_core$secondaryArchSuffix = $portVersion + lib:libclucene_shared$secondaryArchSuffix = $portVersion " REQUIRES=" - haiku${secondaryArchSuffix} - boost$secondaryArchSuffix + haiku$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +PROVIDES_devel=" + clucene${secondaryArchSuffix}_devel = $portVersion + devel:libclucene_contribs_lib$secondaryArchSuffix = $portVersion + devel:libclucene_core$secondaryArchSuffix = $portVersion + devel:libclucene_shared$secondaryArchSuffix = $portVersion + " +REQUIRES_devel=" + clucene$secondaryArchSuffix == $portVersion base " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix devel:libboost_atomic$secondaryArchSuffix + devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:cmake + cmd:gcc$secondaryArchSuffix cmd:make - cmd:gcc${secondaryArchSuffix} " BUILD() { - mkdir -p build_x86 - cd build_x86 - cmake -G "Unix Makefiles" .. -DLUCENE_SYS_INCLUDES=$relativeIncludeDir + mkdir -p build && cd build + cmake -G "Unix Makefiles" .. \ + -DCMAKE_INSTALL_PREFIX=$prefix \ + -DCMAKE_BUILD_TYPE=Release \ + -DLIB_DESTINATION:PATH=$libDir \ + -DLUCENE_SYS_INCLUDES:PATH=$relativeIncludeDir \ + -DBUILD_CONTRIBS_LIB:BOOL=ON \ + -DDISABLE_MULTITHREADING=OFF make $jobArgs } INSTALL() { - cd build_x86 - make install CMAKE_INSTALL_PREFIX=$prefix - prepareInstalledDevelLibs libclucene + cd build + make install + + rm -rf $libDir/CLuceneConfig.cmake + + prepareInstalledDevelLibs libclucene-core libclucene-shared \ + libclucene-contribs-lib + fixPkgconfig packageEntries devel \ - $developDir $includeDir + $developDir } diff --git a/dev-cpp/clucene/patches/clucene-2.3.3.4.patchset b/dev-cpp/clucene/patches/clucene-2.3.3.4.patchset index 82786a4a4..7306bb4de 100644 --- a/dev-cpp/clucene/patches/clucene-2.3.3.4.patchset +++ b/dev-cpp/clucene/patches/clucene-2.3.3.4.patchset @@ -1,4 +1,4 @@ -From bcd1d27ed66d195552d689c322a3bded92bbec5d Mon Sep 17 00:00:00 2001 +From 3089fbbe004c3c18ca50ff9f826560365446861d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 8 Nov 2014 17:51:36 +0100 Subject: Fix include paths. @@ -43,5 +43,258 @@ index 0ab402e..1055a4b 100644 ENDFOREACH(file) -- -1.8.3.4 +2.10.2 + + +From 6c14fd5afc029f1442e4edb082808f82a733b693 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Fri, 24 Mar 2017 23:25:58 +0100 +Subject: Fedora patches + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4950ddb..349ed75 100644 +--- 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 ) + + +diff --git a/src/contribs-lib/CMakeLists.txt b/src/contribs-lib/CMakeLists.txt +index c3cd213..7109e02 100644 +--- 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/src/core/libclucene-core.pc.cmake b/src/core/libclucene-core.pc.cmake +index 0152b25..c3f68e9 100644 +--- a/src/core/libclucene-core.pc.cmake ++++ b/src/core/libclucene-core.pc.cmake +@@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/include/CLucene/ext + 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@ + ~ +-- +2.10.2 + + +From 5b0afa71b2cfd609dd1db919f8df8ddc527f872b Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Fri, 24 Mar 2017 23:32:16 +0100 +Subject: LibreOffice patches + + +diff --git a/src/core/CLucene/analysis/AnalysisHeader.h b/src/core/CLucene/analysis/AnalysisHeader.h +index f79d8bf..5c19675 100644 +--- a/src/core/CLucene/analysis/AnalysisHeader.h ++++ b/src/core/CLucene/analysis/AnalysisHeader.h +@@ -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" +diff --git a/src/core/CLucene/index/TermInfosReader.cpp b/src/core/CLucene/index/TermInfosReader.cpp +index 6ede797..ebbb315 100644 +--- a/src/core/CLucene/index/TermInfosReader.cpp ++++ b/src/core/CLucene/index/TermInfosReader.cpp +@@ -111,7 +111,7 @@ CL_NS_DEF(index) + //destroy their elements + #ifdef _DEBUG + for ( int32_t i=0; i") + }; + +-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 { +diff --git a/src/core/CLucene/queryParser/QueryParserTokenManager.cpp b/src/core/CLucene/queryParser/QueryParserTokenManager.cpp +index 14de0cf..5d9eccf 100644 +--- 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, +diff --git a/src/core/CLucene/search/Searchable.h b/src/core/CLucene/search/Searchable.h +index 86ab605..dfbf78a 100644 +--- a/src/core/CLucene/search/Searchable.h ++++ b/src/core/CLucene/search/Searchable.h +@@ -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) +diff --git a/src/core/CLucene/store/IndexInput.h b/src/core/CLucene/store/IndexInput.h +index 8a43d59..8ab61c4 100644 +--- a/src/core/CLucene/store/IndexInput.h ++++ b/src/core/CLucene/store/IndexInput.h +@@ -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" + +diff --git a/src/core/CLucene/util/Array.h b/src/core/CLucene/util/Array.h +index 969426a..0f07137 100644 +--- a/src/core/CLucene/util/Array.h ++++ b/src/core/CLucene/util/Array.h +@@ -7,6 +7,8 @@ + #ifndef _lucene_util_Array_ + #define _lucene_util_Array_ + ++#pragma GCC system_header ++ + #include + #include + +diff --git a/src/core/CLucene/util/PriorityQueue.h b/src/core/CLucene/util/PriorityQueue.h +index ac25cde..ddd5854 100644 +--- a/src/core/CLucene/util/PriorityQueue.h ++++ b/src/core/CLucene/util/PriorityQueue.h +@@ -7,6 +7,8 @@ + #ifndef _lucene_util_PriorityQueue_ + #define _lucene_util_PriorityQueue_ + ++#pragma GCC system_header ++ + #include + + CL_NS_DEF(util) +diff --git a/src/core/CLucene/util/VoidMap.h b/src/core/CLucene/util/VoidMap.h +index b666dcf..61a597b 100644 +--- a/src/core/CLucene/util/VoidMap.h ++++ b/src/core/CLucene/util/VoidMap.h +@@ -316,6 +316,7 @@ public: + if ( _this::dk || _this::dv ) + _this::remove(k); + ++ (*this)[k] = v; + } + }; + +diff --git a/src/shared/CLucene/LuceneThreads.h b/src/shared/CLucene/LuceneThreads.h +index 97072ee..d32d131 100644 +--- a/src/shared/CLucene/LuceneThreads.h ++++ b/src/shared/CLucene/LuceneThreads.h +@@ -70,7 +70,7 @@ class CLuceneThreadIdCompare; + 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 +diff --git a/src/shared/CLucene/config/threads.cpp b/src/shared/CLucene/config/threads.cpp +index 0b5f30a..15e766d 100644 +--- a/src/shared/CLucene/config/threads.cpp ++++ b/src/shared/CLucene/config/threads.cpp +@@ -185,7 +185,7 @@ CL_NS_DEF(util) + } + + 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 @@ CL_NS_DEF(util) + #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) +-- +2.10.2 + + +From ab2f5f09c47ce204f837f1326e020f4c311f87c2 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Fri, 24 Mar 2017 23:41:45 +0100 +Subject: Fix include path. + + +diff --git a/src/contribs-lib/CMakeLists.txt b/src/contribs-lib/CMakeLists.txt +index 7109e02..c6e8fb1 100644 +--- a/src/contribs-lib/CMakeLists.txt ++++ b/src/contribs-lib/CMakeLists.txt +@@ -113,7 +113,7 @@ FOREACH(file ${HEADERS}) + file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath}) + IF ( NOT aname MATCHES "^_.*" ) + install(FILES ${file} +- DESTINATION include/${relpath} ++ DESTINATION develop/headers/${relpath} + COMPONENT development) + ENDIF ( NOT aname MATCHES "^_.*" ) + ENDFOREACH(file) +-- +2.10.2