@@ -14,10 +14,16 @@ i = "-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLIB_DESTINATION=/usr/lib \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DENABLE_TEST=OFF \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_CXX_FLAGS='-std=c++20 -DBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT' \
|
||||
-DENABLE_DEMO=OFF \
|
||||
"
|
||||
|
||||
def setup():
|
||||
shelltools.system("""sed -i \
|
||||
-e 's#SET(LUCENE++_VERSION_REVISION.*#SET(LUCENE++_VERSION_REVISION "5")#' \
|
||||
-e 's#SET(LUCENE++_VERSION_PATCH.*#SET(LUCENE++_VERSION_PATCH "0")#' \
|
||||
CMakeLists.txt""")
|
||||
shelltools.export("CXXFLAGS", "-DBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT")
|
||||
shelltools.export("CXXFLAGS", "-lpthread")
|
||||
shelltools.makedirs("build")
|
||||
@@ -26,7 +32,7 @@ def setup():
|
||||
|
||||
def build():
|
||||
shelltools.cd("build")
|
||||
cmaketools.make()
|
||||
cmaketools.make("CMAKE_POLICY_VERSION_MINIMUM=3.5")
|
||||
|
||||
def install():
|
||||
shelltools.cd("build")
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From c18ead2b0c4aa62af01450cb12353a0baa51411f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@lindev.ch>
|
||||
Date: Wed, 27 Mar 2024 12:00:18 +0100
|
||||
Subject: [PATCH] Fix build with boost 1.85.0
|
||||
|
||||
boost::filesystem::wpath has been deprecated (and typedef-ed to
|
||||
boost::filesystem::path) for a long time; it is removed from boost
|
||||
starting with 1.85.0-beta1.
|
||||
|
||||
Use boost::filesystem::path instead.
|
||||
|
||||
boost/filesystem/convenience.hpp has been removed (and was being
|
||||
included without being used anyway - its only use was indirectly
|
||||
pulling in boost/filesystem/directory.hpp, which is actually used).
|
||||
|
||||
Include boost/filesystem/directory.hpp directly instead.
|
||||
---
|
||||
src/core/store/MMapDirectory.cpp | 2 +-
|
||||
src/core/util/FileUtils.cpp | 6 +++---
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/core/store/MMapDirectory.cpp b/src/core/store/MMapDirectory.cpp
|
||||
index beac7828..46156e3a 100644
|
||||
--- a/src/core/store/MMapDirectory.cpp
|
||||
+++ b/src/core/store/MMapDirectory.cpp
|
||||
@@ -36,7 +36,7 @@ MMapIndexInput::MMapIndexInput(const String& path) {
|
||||
bufferPosition = 0;
|
||||
if (!path.empty()) {
|
||||
try {
|
||||
- file.open(boost::filesystem::wpath(path), _length);
|
||||
+ file.open(boost::filesystem::path(path), _length);
|
||||
} catch (...) {
|
||||
boost::throw_exception(FileNotFoundException(path));
|
||||
}
|
||||
diff --git a/src/core/util/FileUtils.cpp b/src/core/util/FileUtils.cpp
|
||||
index 51508b57..d92efbb8 100644
|
||||
--- a/src/core/util/FileUtils.cpp
|
||||
+++ b/src/core/util/FileUtils.cpp
|
||||
@@ -5,9 +5,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "LuceneInc.h"
|
||||
-#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
+#include <boost/filesystem/directory.hpp>
|
||||
#include "LuceneThread.h"
|
||||
#include "StringUtils.h"
|
||||
#include "FileUtils.h"
|
||||
@@ -128,12 +128,12 @@ String joinPath(const String& path, const String& file) {
|
||||
}
|
||||
|
||||
String extractPath(const String& path) {
|
||||
- boost::filesystem::wpath parentPath(path.c_str());
|
||||
+ boost::filesystem::path parentPath(path.c_str());
|
||||
return parentPath.parent_path().wstring().c_str();
|
||||
}
|
||||
|
||||
String extractFile(const String& path) {
|
||||
- boost::filesystem::wpath fileName(path.c_str());
|
||||
+ boost::filesystem::path fileName(path.c_str());
|
||||
return fileName.filename().wstring().c_str();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/cmake/dependencies.cmake LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/cmake/dependencies.cmake
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/cmake/dependencies.cmake 2025-10-16 21:52:17.599168371 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/cmake/dependencies.cmake 2025-10-16 21:53:07.900119402 +0200
|
||||
@@ -7,7 +7,6 @@
|
||||
filesystem
|
||||
iostreams
|
||||
regex
|
||||
- system
|
||||
thread
|
||||
REQUIRED
|
||||
)
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/contrib/CMakeLists.txt LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/contrib/CMakeLists.txt
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/contrib/CMakeLists.txt 2025-10-16 21:52:17.620913579 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/contrib/CMakeLists.txt 2025-10-16 21:55:39.509895982 +0200
|
||||
@@ -67,7 +67,6 @@
|
||||
Boost::filesystem
|
||||
Boost::iostreams
|
||||
Boost::regex
|
||||
- Boost::system
|
||||
Boost::thread
|
||||
ZLIB::ZLIB
|
||||
lucene++::lucene++)
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/core/CMakeLists.txt LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/core/CMakeLists.txt
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/core/CMakeLists.txt 2025-10-16 21:52:17.630332868 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/core/CMakeLists.txt 2025-10-16 21:55:39.510349119 +0200
|
||||
@@ -57,7 +57,6 @@
|
||||
Boost::filesystem
|
||||
Boost::iostreams
|
||||
Boost::regex
|
||||
- Boost::system
|
||||
Boost::thread
|
||||
ZLIB::ZLIB
|
||||
)
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/demo/deletefiles/CMakeLists.txt LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/demo/deletefiles/CMakeLists.txt
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/demo/deletefiles/CMakeLists.txt 2025-10-16 21:52:17.648223127 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/demo/deletefiles/CMakeLists.txt 2025-10-16 21:55:39.510708458 +0200
|
||||
@@ -38,7 +38,6 @@
|
||||
Boost::filesystem
|
||||
Boost::iostreams
|
||||
Boost::regex
|
||||
- Boost::system
|
||||
Boost::thread
|
||||
ZLIB::ZLIB
|
||||
lucene++::lucene++
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/demo/indexfiles/CMakeLists.txt LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/demo/indexfiles/CMakeLists.txt
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/demo/indexfiles/CMakeLists.txt 2025-10-16 21:52:17.648476446 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/demo/indexfiles/CMakeLists.txt 2025-10-16 21:55:39.510875032 +0200
|
||||
@@ -39,7 +39,6 @@
|
||||
Boost::filesystem
|
||||
Boost::iostreams
|
||||
Boost::regex
|
||||
- Boost::system
|
||||
Boost::thread
|
||||
ZLIB::ZLIB
|
||||
lucene++::lucene++
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/demo/searchfiles/CMakeLists.txt LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/demo/searchfiles/CMakeLists.txt
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/demo/searchfiles/CMakeLists.txt 2025-10-16 21:52:17.648728577 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/demo/searchfiles/CMakeLists.txt 2025-10-16 21:55:39.511044539 +0200
|
||||
@@ -38,7 +38,6 @@
|
||||
Boost::filesystem
|
||||
Boost::iostreams
|
||||
Boost::regex
|
||||
- Boost::system
|
||||
Boost::thread
|
||||
ZLIB::ZLIB
|
||||
lucene++::lucene++
|
||||
diff -ru LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/test/CMakeLists.txt LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/test/CMakeLists.txt
|
||||
--- LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9.orig/src/test/CMakeLists.txt 2025-10-16 21:52:17.649059769 +0200
|
||||
+++ LucenePlusPlus-b545dba48639ac5ecb691f49fb2748c847cf5be9/src/test/CMakeLists.txt 2025-10-16 21:55:39.511226059 +0200
|
||||
@@ -59,7 +59,6 @@
|
||||
Boost::filesystem
|
||||
Boost::iostreams
|
||||
Boost::regex
|
||||
- Boost::system
|
||||
Boost::thread
|
||||
ZLIB::ZLIB
|
||||
gtest_main
|
||||
@@ -0,0 +1,253 @@
|
||||
diff -Nuar a/src/core/util/BitSet.cpp b/src/core/util/BitSet.cpp
|
||||
--- a/src/core/util/BitSet.cpp 2024-02-18 21:18:26.000000000 +0300
|
||||
+++ b/src/core/util/BitSet.cpp 2026-02-14 13:50:04.395991563 +0300
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "LuceneInc.h"
|
||||
#include "BitSet.h"
|
||||
#include "BitUtil.h"
|
||||
+#include <boost/version.hpp>
|
||||
+#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
namespace Lucene {
|
||||
|
||||
@@ -16,8 +18,12 @@
|
||||
BitSet::~BitSet() {
|
||||
}
|
||||
|
||||
-const uint64_t* BitSet::getBits() {
|
||||
+BitSet::get_bits_result BitSet::getBits() {
|
||||
+#if BOOST_VERSION < 109000
|
||||
return bitSet.empty() ? NULL : static_cast<const uint64_t*>(&bitSet.m_bits[0]);
|
||||
+#else
|
||||
+ return bitSet;
|
||||
+#endif
|
||||
}
|
||||
|
||||
void BitSet::clear() {
|
||||
@@ -35,16 +41,20 @@
|
||||
}
|
||||
|
||||
void BitSet::clear(uint32_t fromIndex, uint32_t toIndex) {
|
||||
+#if BOOST_VERSION >= 106900
|
||||
+ fromIndex = std::min<bitset_type::size_type>(fromIndex, bitSet.size());
|
||||
+ toIndex = std::min<bitset_type::size_type>(toIndex, bitSet.size());
|
||||
+ bitSet.reset(fromIndex, toIndex - fromIndex);
|
||||
+#else
|
||||
toIndex = std::min(toIndex, (uint32_t)bitSet.size());
|
||||
for (bitset_type::size_type i = std::min(fromIndex, (uint32_t)bitSet.size()); i < toIndex; ++i) {
|
||||
bitSet.set(i, false);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void BitSet::fastClear(uint32_t fromIndex, uint32_t toIndex) {
|
||||
- for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
- bitSet.set(i, false);
|
||||
- }
|
||||
+ fastSet(fromIndex, toIndex, false);
|
||||
}
|
||||
|
||||
void BitSet::set(uint32_t bitIndex) {
|
||||
@@ -70,33 +80,28 @@
|
||||
}
|
||||
|
||||
void BitSet::set(uint32_t fromIndex, uint32_t toIndex) {
|
||||
- if (toIndex >= bitSet.size()) {
|
||||
- resize(toIndex + 1);
|
||||
- }
|
||||
- for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
- bitSet.set(i, true);
|
||||
- }
|
||||
+ set(fromIndex, toIndex, true);
|
||||
}
|
||||
|
||||
void BitSet::fastSet(uint32_t fromIndex, uint32_t toIndex) {
|
||||
- for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
- bitSet.set(i, true);
|
||||
- }
|
||||
+ fastSet(fromIndex, toIndex, true);
|
||||
}
|
||||
|
||||
void BitSet::set(uint32_t fromIndex, uint32_t toIndex, bool value) {
|
||||
if (toIndex >= bitSet.size()) {
|
||||
resize(toIndex + 1);
|
||||
}
|
||||
- for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
- bitSet.set(i, value);
|
||||
- }
|
||||
+ fastSet(fromIndex, toIndex, value);
|
||||
}
|
||||
|
||||
void BitSet::fastSet(uint32_t fromIndex, uint32_t toIndex, bool value) {
|
||||
+#if BOOST_VERSION >= 106900
|
||||
+ bitSet.set(fromIndex, toIndex - fromIndex, value);
|
||||
+#else
|
||||
for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
bitSet.set(i, value);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void BitSet::flip(uint32_t bitIndex) {
|
||||
@@ -114,15 +119,17 @@
|
||||
if (toIndex >= bitSet.size()) {
|
||||
resize(toIndex + 1);
|
||||
}
|
||||
- for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
- bitSet.flip(i);
|
||||
- }
|
||||
+ fastFlip(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
void BitSet::fastFlip(uint32_t fromIndex, uint32_t toIndex) {
|
||||
+#if BOOST_VERSION >= 106900
|
||||
+ bitSet.flip(fromIndex, toIndex - fromIndex);
|
||||
+#else
|
||||
for (bitset_type::size_type i = fromIndex; i < toIndex; ++i) {
|
||||
bitSet.flip(i);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
uint32_t BitSet::size() const {
|
||||
@@ -146,51 +153,46 @@
|
||||
}
|
||||
|
||||
int32_t BitSet::nextSetBit(uint32_t fromIndex) const {
|
||||
+#if BOOST_VERSION >= 108800
|
||||
+ return bitSet.find_first(fromIndex);
|
||||
+#else
|
||||
bitset_type::size_type next = fromIndex == 0 ? bitSet.find_first() : bitSet.find_next(fromIndex - 1);
|
||||
return next == bitset_type::npos ? -1 : next;
|
||||
+#endif
|
||||
}
|
||||
|
||||
void BitSet::_and(const BitSetPtr& set) {
|
||||
- bitset_type::size_type minBlocks = std::min(bitSet.num_blocks(), set->bitSet.num_blocks());
|
||||
- for (bitset_type::size_type i = 0; i < minBlocks; ++i) {
|
||||
- bitSet.m_bits[i] &= set->bitSet.m_bits[i];
|
||||
- }
|
||||
- if (bitSet.num_blocks() > minBlocks) {
|
||||
- std::fill(bitSet.m_bits.begin() + minBlocks, bitSet.m_bits.end(), bitset_type::block_type(0));
|
||||
- }
|
||||
+ bitset_type other = set->bitSet;
|
||||
+ other.resize(bitSet.size());
|
||||
+ bitSet &= other;
|
||||
}
|
||||
|
||||
void BitSet::_or(const BitSetPtr& set) {
|
||||
- bitset_type::size_type minBlocks = std::min(bitSet.num_blocks(), set->bitSet.num_blocks());
|
||||
if (set->bitSet.size() > bitSet.size()) {
|
||||
resize(set->bitSet.size());
|
||||
- }
|
||||
- for (bitset_type::size_type i = 0; i < minBlocks; ++i) {
|
||||
- bitSet.m_bits[i] |= set->bitSet.m_bits[i];
|
||||
- }
|
||||
- if (bitSet.num_blocks() > minBlocks) {
|
||||
- std::copy(set->bitSet.m_bits.begin() + minBlocks, set->bitSet.m_bits.end(), bitSet.m_bits.begin() + minBlocks);
|
||||
+ bitSet |= set->bitSet;
|
||||
+ } else {
|
||||
+ bitset_type other = set->bitSet;
|
||||
+ other.resize(bitSet.size());
|
||||
+ bitSet |= other;
|
||||
}
|
||||
}
|
||||
|
||||
void BitSet::_xor(const BitSetPtr& set) {
|
||||
- bitset_type::size_type minBlocks = std::min(bitSet.num_blocks(), set->bitSet.num_blocks());
|
||||
if (set->bitSet.size() > bitSet.size()) {
|
||||
resize(set->bitSet.size());
|
||||
- }
|
||||
- for (bitset_type::size_type i = 0; i < minBlocks; ++i) {
|
||||
- bitSet.m_bits[i] ^= set->bitSet.m_bits[i];
|
||||
- }
|
||||
- if (bitSet.num_blocks() > minBlocks) {
|
||||
- std::copy(set->bitSet.m_bits.begin() + minBlocks, set->bitSet.m_bits.end(), bitSet.m_bits.begin() + minBlocks);
|
||||
+ bitSet ^= set->bitSet;
|
||||
+ } else {
|
||||
+ bitset_type other = set->bitSet;
|
||||
+ other.resize(bitSet.size());
|
||||
+ bitSet ^= other;
|
||||
}
|
||||
}
|
||||
|
||||
void BitSet::andNot(const BitSetPtr& set) {
|
||||
- bitset_type::size_type minBlocks = std::min(bitSet.num_blocks(), set->bitSet.num_blocks());
|
||||
- for (bitset_type::size_type i = 0; i < minBlocks; ++i) {
|
||||
- bitSet.m_bits[i] &= ~set->bitSet.m_bits[i];
|
||||
- }
|
||||
+ bitset_type other = set->bitSet;
|
||||
+ other.resize(bitSet.size());
|
||||
+ bitSet &= other.flip();
|
||||
}
|
||||
|
||||
bool BitSet::intersectsBitSet(const BitSetPtr& set) const {
|
||||
@@ -198,20 +200,11 @@
|
||||
}
|
||||
|
||||
uint32_t BitSet::cardinality() {
|
||||
- return bitSet.num_blocks() == 0 ? 0 : (uint32_t)BitUtil::pop_array((int64_t*)getBits(), 0, bitSet.num_blocks());
|
||||
+ return bitSet.count();
|
||||
}
|
||||
|
||||
void BitSet::resize(uint32_t size) {
|
||||
- bitset_type::size_type old_num_blocks = bitSet.num_blocks();
|
||||
- bitset_type::size_type required_blocks = bitSet.calc_num_blocks(size);
|
||||
- if (required_blocks != old_num_blocks) {
|
||||
- bitSet.m_bits.resize(required_blocks, bitset_type::block_type(0));
|
||||
- }
|
||||
- bitSet.m_num_bits = size;
|
||||
- uint64_t extra_bits = static_cast<uint64_t>(bitSet.size() % bitSet.bits_per_block);
|
||||
- if (extra_bits != 0) {
|
||||
- bitSet.m_bits.back() &= ~(~static_cast<bitset_type::block_type>(0) << extra_bits);
|
||||
- }
|
||||
+ bitSet.resize(size);
|
||||
}
|
||||
|
||||
bool BitSet::equals(const LuceneObjectPtr& other) {
|
||||
@@ -224,31 +217,28 @@
|
||||
}
|
||||
BitSetPtr first = bitSet.num_blocks() < otherBitSet->bitSet.num_blocks() ? otherBitSet : shared_from_this();
|
||||
BitSetPtr second = bitSet.num_blocks() < otherBitSet->bitSet.num_blocks() ? shared_from_this() : otherBitSet;
|
||||
- bitset_type::size_type firstLength = first->bitSet.num_blocks();
|
||||
- bitset_type::size_type secondLength = second->bitSet.num_blocks();
|
||||
- for (bitset_type::size_type i = secondLength; i < firstLength; ++i) {
|
||||
- if (first->bitSet.m_bits[i] != 0) {
|
||||
- return false;
|
||||
+ bitset_type::size_type f = first->bitSet.find_first();
|
||||
+ bitset_type::size_type s = second->bitSet.find_first();
|
||||
+ while (f == s) {
|
||||
+ if (f == bitset_type::npos) {
|
||||
+ return true;
|
||||
}
|
||||
+ f = first->bitSet.find_next(f);
|
||||
+ s = second->bitSet.find_next(s);
|
||||
}
|
||||
- for (bitset_type::size_type i = 0; i < secondLength; ++i) {
|
||||
- if (first->bitSet.m_bits[i] != second->bitSet.m_bits[i]) {
|
||||
- return false;
|
||||
- }
|
||||
- }
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
int32_t BitSet::hashCode() {
|
||||
// Start with a zero hash and use a mix that results in zero if the input is zero.
|
||||
// This effectively truncates trailing zeros without an explicit check.
|
||||
int64_t hash = 0;
|
||||
- uint32_t maxSize = bitSet.num_blocks();
|
||||
- const uint64_t* bits = getBits();
|
||||
- for (uint32_t bit = 0; bit < maxSize; ++bit) {
|
||||
- hash ^= bits[bit];
|
||||
- hash = (hash << 1) | (hash >> 63); // rotate left
|
||||
- }
|
||||
+ to_block_range(bitSet, boost::make_function_output_iterator(
|
||||
+ [&hash](bitset_type::block_type block) {
|
||||
+ hash ^= block;
|
||||
+ hash = (hash << 1) | (hash >> 63); // rotate left
|
||||
+ }
|
||||
+ ));
|
||||
// Fold leftmost bits into right and add a constant to prevent empty sets from
|
||||
// returning 0, which is too common.
|
||||
return (int32_t)((hash >> 32) ^ hash) + 0x98761234;
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/src/test/gtest/googletest/src/gtest-death-test.cc b/src/test/gtest/googletest/src/gtest-death-test.cc
|
||||
index da09a1c..dc9b952 100644
|
||||
--- a/src/test/gtest/googletest/src/gtest-death-test.cc
|
||||
+++ b/src/test/gtest/googletest/src/gtest-death-test.cc
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "gtest/gtest-death-test.h"
|
||||
|
||||
+#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
#include "gtest/internal/gtest-port.h"
|
||||
@@ -0,0 +1,77 @@
|
||||
From a58673753234fff8fa9729fc91962c578a76c5d6 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Heusel <christian@heusel.eu>
|
||||
Date: Tue, 21 Jan 2025 01:01:58 +0100
|
||||
Subject: [PATCH] Migrate to boost::asio::io_context
|
||||
|
||||
The code previously used the deprecated (and with bost 1.87.0 removed)
|
||||
`boost::asio::io_service`, which used to be an alias to `io_context`.
|
||||
The new version heavily changes the `io_context` API and therefore is no
|
||||
the old interface was removed.
|
||||
---
|
||||
include/lucene++/ThreadPool.h | 10 ++++++----
|
||||
src/core/util/ThreadPool.cpp | 9 +++++----
|
||||
2 files changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/include/lucene++/ThreadPool.h b/include/lucene++/ThreadPool.h
|
||||
index dc6446f..175ac8a 100644
|
||||
--- a/include/lucene++/ThreadPool.h
|
||||
+++ b/include/lucene++/ThreadPool.h
|
||||
@@ -14,7 +14,9 @@
|
||||
|
||||
namespace Lucene {
|
||||
|
||||
-typedef boost::shared_ptr<boost::asio::io_service::work> workPtr;
|
||||
+
|
||||
+typedef boost::asio::io_context io_context_t;
|
||||
+typedef boost::asio::executor_work_guard<io_context_t::executor_type> work_t;
|
||||
|
||||
/// A Future represents the result of an asynchronous computation. Methods are provided to check if the computation
|
||||
/// is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be
|
||||
@@ -51,8 +53,8 @@ public:
|
||||
LUCENE_CLASS(ThreadPool);
|
||||
|
||||
protected:
|
||||
- boost::asio::io_service io_service;
|
||||
- workPtr work;
|
||||
+ io_context_t io_context;
|
||||
+ work_t work;
|
||||
boost::thread_group threadGroup;
|
||||
|
||||
static const int32_t THREADPOOL_SIZE;
|
||||
@@ -64,7 +66,7 @@ public:
|
||||
template <typename FUNC>
|
||||
FuturePtr scheduleTask(FUNC func) {
|
||||
FuturePtr future(newInstance<Future>());
|
||||
- io_service.post(boost::bind(&ThreadPool::execute<FUNC>, this, func, future));
|
||||
+ boost::asio::post(io_context, boost::bind(&ThreadPool::execute<FUNC>, this, func, future));
|
||||
return future;
|
||||
}
|
||||
|
||||
diff --git a/src/core/util/ThreadPool.cpp b/src/core/util/ThreadPool.cpp
|
||||
index 8086d8b..116f521 100644
|
||||
--- a/src/core/util/ThreadPool.cpp
|
||||
+++ b/src/core/util/ThreadPool.cpp
|
||||
@@ -14,15 +14,16 @@ Future::~Future() {
|
||||
|
||||
const int32_t ThreadPool::THREADPOOL_SIZE = 5;
|
||||
|
||||
-ThreadPool::ThreadPool() {
|
||||
- work.reset(new boost::asio::io_service::work(io_service));
|
||||
+ThreadPool::ThreadPool()
|
||||
+ :
|
||||
+ work(boost::asio::make_work_guard(io_context))
|
||||
+{
|
||||
for (int32_t i = 0; i < THREADPOOL_SIZE; ++i) {
|
||||
- threadGroup.create_thread(boost::bind(&boost::asio::io_service::run, &io_service));
|
||||
+ threadGroup.create_thread(boost::bind(&boost::asio::io_context::run, &io_context));
|
||||
}
|
||||
}
|
||||
|
||||
ThreadPool::~ThreadPool() {
|
||||
- work.reset(); // stop all threads
|
||||
threadGroup.join_all(); // wait for all competition
|
||||
}
|
||||
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
<PartOf>programming.library</PartOf>
|
||||
<Summary>An up to date C++ port of the popular Java Lucene library, a high-performance, full-featured text search engine.</Summary>
|
||||
<Description>Lucene++ is an up to date C++ port of the popular Java Lucene library, a high-performance, full-featured text search engine.</Description>
|
||||
<Archive sha1sum="5162eed4da211ca792ee41187298a56c80468d88" type="targz">
|
||||
https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_3.0.8.tar.gz
|
||||
</Archive>
|
||||
<Archive sha1sum="88ba1c52132feb26c32e2f42565db75db6b97b67" type="zip">https://github.com/luceneplusplus/LucenePlusPlus/archive/29fcfed6b4c92710dd16685c9fcc7b8575789ddb.zip</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency>cmake</Dependency>
|
||||
<Dependency>boost-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch level="1">fix_various_cmake_issues.patch</Patch>
|
||||
<Patch level="1">use_correct_libdir.patch</Patch>
|
||||
<Patch level="1">fix_typo.patch</Patch>
|
||||
<Patch level="1">gcc-15.patch</Patch>
|
||||
<!-- <Patch level="1">boost-1.89.patch</Patch> -->
|
||||
<!-- <Patch level="1">lucene-fix-boost-asio-io_service-deprecation.patch</Patch> -->
|
||||
<!-- <Patch level="1">76dc90f2.patch</Patch> -->
|
||||
<!-- <Patch level="1">boost.patch</Patch> -->
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
@@ -51,7 +51,21 @@
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<History>
|
||||
<Update release="6">
|
||||
<Date>2026-02-14</Date>
|
||||
<Version>3.0.9</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Pisi Linux Community</Name>
|
||||
<Email>admin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="5">
|
||||
<Date>2026-02-14</Date>
|
||||
<Version>3.0.8</Version>
|
||||
<Comment>Rebuild boost.</Comment>
|
||||
<Name>fury</Name>
|
||||
<Email>uglyside@yandex.ru</Email>
|
||||
</Update>
|
||||
<Update release="4">
|
||||
<Date>2023-10-25</Date>
|
||||
<Version>3.0.8</Version>
|
||||
|
||||
Reference in New Issue
Block a user