From bafadc8930ed96ed2b699d0f2effa67b44dd3322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 8 Aug 2025 22:01:16 +0700 Subject: [PATCH] Lucene++: update to 3.0.9. --- srcpkgs/Lucene++/patches/boost-1.85.patch | 64 ++++++++++++++++++ srcpkgs/Lucene++/patches/boost-1.87.patch | 74 +++++++++++++++++++++ srcpkgs/Lucene++/patches/cxx-standard.patch | 11 +++ srcpkgs/Lucene++/template | 27 +++----- 4 files changed, 158 insertions(+), 18 deletions(-) create mode 100644 srcpkgs/Lucene++/patches/boost-1.85.patch create mode 100644 srcpkgs/Lucene++/patches/boost-1.87.patch create mode 100644 srcpkgs/Lucene++/patches/cxx-standard.patch diff --git a/srcpkgs/Lucene++/patches/boost-1.85.patch b/srcpkgs/Lucene++/patches/boost-1.85.patch new file mode 100644 index 00000000000..05babf97a08 --- /dev/null +++ b/srcpkgs/Lucene++/patches/boost-1.85.patch @@ -0,0 +1,64 @@ +From c18ead2b0c4aa62af01450cb12353a0baa51411f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= +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 + #include + #include ++#include + #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(); + } + diff --git a/srcpkgs/Lucene++/patches/boost-1.87.patch b/srcpkgs/Lucene++/patches/boost-1.87.patch new file mode 100644 index 00000000000..40f09de3974 --- /dev/null +++ b/srcpkgs/Lucene++/patches/boost-1.87.patch @@ -0,0 +1,74 @@ +From e6a376836e5c891577eae6369263152106b9bc02 Mon Sep 17 00:00:00 2001 +From: Christian Heusel +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. + +Fixes https://github.com/luceneplusplus/LucenePlusPlus/issues/208 + +Signed-off-by: Christian Heusel +--- + include/lucene++/ThreadPool.h | 10 ++++++---- + src/core/util/ThreadPool.cpp | 9 +++++---- + 2 files changed, 11 insertions(+), 8 deletions(-) + +--- a/include/lucene++/ThreadPool.h ++++ b/include/lucene++/ThreadPool.h +@@ -14,7 +14,9 @@ + + namespace Lucene { + +-typedef boost::shared_ptr workPtr; ++ ++typedef boost::asio::io_context io_context_t; ++typedef boost::asio::executor_work_guard 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 + FuturePtr scheduleTask(FUNC func) { + FuturePtr future(newInstance()); +- io_service.post(boost::bind(&ThreadPool::execute, this, func, future)); ++ boost::asio::post(io_context, boost::bind(&ThreadPool::execute, this, func, future)); + return future; + } + +--- 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 + } + diff --git a/srcpkgs/Lucene++/patches/cxx-standard.patch b/srcpkgs/Lucene++/patches/cxx-standard.patch new file mode 100644 index 00000000000..d44b33349ef --- /dev/null +++ b/srcpkgs/Lucene++/patches/cxx-standard.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,7 +47,7 @@ include(dependencies) + include(Lucene++Docs) + + # Enable C++11 +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + + #################################### diff --git a/srcpkgs/Lucene++/template b/srcpkgs/Lucene++/template index 931e80cdbee..12de2e53570 100644 --- a/srcpkgs/Lucene++/template +++ b/srcpkgs/Lucene++/template @@ -1,33 +1,24 @@ # Template file for 'Lucene++' pkgname=Lucene++ -version=3.0.7 -revision=15 +version=3.0.9 +revision=1 build_style=cmake configure_args="-Wno-dev" -makedepends="boost-devel gtest-devel" +makedepends="boost-devel-minimal libboost_filesystem libboost_iostreams + libboost_thread libboost_date_time gtest-devel zlib-devel" short_desc="C++ port of the popular text search engine" maintainer="Enno Boland " license="LGPL-3.0-or-later, Apache-2.0" homepage="https://github.com/luceneplusplus/LucenePlusPlus" distfiles="https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_${version}.tar.gz" -checksum=6c19f203311e4b44a0ccf7b1127db77436eb47159ea1c54f7531a0b1ca585e0c +checksum=4e69e29d5d79a976498ef71eab70c9c88c7014708be4450a9fda7780fe93584e -post_extract() { - sed -i 's/boost::get/boost::relaxed_get/' include/VariantUtils.h +post_patch() { + sed -i '/cmake_minimum_require/d' cmake/*.cmake + sed -i '/add_subdirectory.gtest/d' src/test/CMakeLists.txt } -pre_configure() { - # Disable tests - echo > CMakeExternal.txt - rm -r src/test - sed -i \ - -e "/find_package(Subversion REQUIRED)/d" \ - -e "/enable_testing/d" \ - -e "/add_subdirectory(src\/test)/d" \ - CMakeLists.txt -} - -post_install() { +xpost_install() { # Install missing header files vcopy "include/*" usr/include/lucene++ vcopy "build/include/*" usr/include/lucene++