pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/textproc/lucene++
Module Name: pkgsrc
Committed By: adam
Date: Sun Dec 28 22:40:03 UTC 2025
Modified Files:
pkgsrc/textproc/lucene++: distinfo
Added Files:
pkgsrc/textproc/lucene++/patches: patch-include_lucene++_BitSet.h
patch-src_core_util_BitSet.cpp
Log Message:
lucene++: fix build with Boost 1.90.0
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 pkgsrc/textproc/lucene++/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/textproc/lucene++/patches/patch-include_lucene++_BitSet.h \
pkgsrc/textproc/lucene++/patches/patch-src_core_util_BitSet.cpp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/textproc/lucene++/distinfo
diff -u pkgsrc/textproc/lucene++/distinfo:1.8 pkgsrc/textproc/lucene++/distinfo:1.9
--- pkgsrc/textproc/lucene++/distinfo:1.8 Thu Oct 16 15:01:51 2025
+++ pkgsrc/textproc/lucene++/distinfo Sun Dec 28 22:40:03 2025
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2025/10/16 15:01:51 adam Exp $
+$NetBSD: distinfo,v 1.9 2025/12/28 22:40:03 adam Exp $
BLAKE2s (lucene++-3.0.9.tar.gz) = 3dcc3352e3c0e1f13c093be12f982f6ef9107a9250884c22288fc568d7205f69
SHA512 (lucene++-3.0.9.tar.gz) = 220fe1b46518018d176ae16434f03b1453fc345d8d552a294d1af927ea4ab69a83ee4b03c82938e648edaa3e7064526ca047fc86e1c71743b0958b520d59e225
@@ -6,11 +6,13 @@ Size (lucene++-3.0.9.tar.gz) = 2458287 b
SHA1 (patch-CMakeLists.txt) = db25e72a4c4d5dc38b9c805b75bf7c4469f7029d
SHA1 (patch-cmake_cotire.cmake) = a0a8416e54054ae9c4871ed987f8a2cb51848daa
SHA1 (patch-cmake_dependencies.cmake) = 26275630ce9cd2766eb01be6fffc0673f12634c0
+SHA1 (patch-include_lucene++_BitSet.h) = 8a5a70fb94101b33477485473dc81a5d73f70d95
SHA1 (patch-include_lucene++_Collection.h) = 1fbfbcc8128ed1379fcde791e60b94249dfdfbf2
SHA1 (patch-include_lucene++_Set.h) = 5ef271985b1fe69515c515603b9386b161eb1c36
SHA1 (patch-include_lucene++_ThreadPool.h) = f7038f90852b45ff4ffe9775cd2878150bb996a9
SHA1 (patch-src_contrib_CMakeLists.txt) = 34ff1ed5c2b4c4b6a44c7f3a69029f1881c93747
SHA1 (patch-src_core_CMakeLists.txt) = d06080834aaa77a8d14b5c5bcd094e3cdb6784b3
SHA1 (patch-src_core_store_MMapDirectory.cpp) = b71a9f30cef213beb8f777f5bcbde721281e5f6c
+SHA1 (patch-src_core_util_BitSet.cpp) = 84b2db15dd3bc390a60ba6a431b722b4a8f5578d
SHA1 (patch-src_core_util_FileUtils.cpp) = e77b05f575cdcc56d5e4b85fad8411b11b53be26
SHA1 (patch-src_core_util_ThreadPool.cpp) = 6ce4b1f0333c420a83a69fe3f2d8e89acb51e3e2
Added files:
Index: pkgsrc/textproc/lucene++/patches/patch-include_lucene++_BitSet.h
diff -u /dev/null pkgsrc/textproc/lucene++/patches/patch-include_lucene++_BitSet.h:1.1
--- /dev/null Sun Dec 28 22:40:03 2025
+++ pkgsrc/textproc/lucene++/patches/patch-include_lucene++_BitSet.h Sun Dec 28 22:40:03 2025
@@ -0,0 +1,25 @@
+$NetBSD: patch-include_lucene++_BitSet.h,v 1.1 2025/12/28 22:40:03 adam Exp $
+
+Fix build with Boost 1.90.0.
+https://github.com/void-linux/void-packages/blob/master/srcpkgs/Lucene%2B%2B/patches/boost-1.90.patch
+
+--- include/lucene++/BitSet.h.orig 2024-02-18 18:18:26.000000000 +0000
++++ include/lucene++/BitSet.h
+@@ -8,6 +8,7 @@
+ #define BITSET_H
+
+ #include <boost/dynamic_bitset.hpp>
++#include <boost/version.hpp>
+ #include "LuceneObject.h"
+
+ namespace Lucene {
+@@ -24,7 +25,9 @@ protected:
+ bitset_type bitSet;
+
+ public:
++#if BOOST_VERSION < 109000
+ const uint64_t* getBits();
++#endif
+ void clear();
+ void clear(uint32_t bitIndex);
+ void fastClear(uint32_t bitIndex);
Index: pkgsrc/textproc/lucene++/patches/patch-src_core_util_BitSet.cpp
diff -u /dev/null pkgsrc/textproc/lucene++/patches/patch-src_core_util_BitSet.cpp:1.1
--- /dev/null Sun Dec 28 22:40:03 2025
+++ pkgsrc/textproc/lucene++/patches/patch-src_core_util_BitSet.cpp Sun Dec 28 22:40:03 2025
@@ -0,0 +1,255 @@
+$NetBSD: patch-src_core_util_BitSet.cpp,v 1.1 2025/12/28 22:40:03 adam Exp $
+
+Fix build with Boost 1.90.0.
+https://github.com/void-linux/void-packages/blob/master/srcpkgs/Lucene%2B%2B/patches/boost-1.90.patch
+
+--- src/core/util/BitSet.cpp.orig 2024-02-18 18:18:26.000000000 +0000
++++ src/core/util/BitSet.cpp
+@@ -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,9 +18,11 @@ BitSet::BitSet(uint32_t size) : bitSet(s
+ BitSet::~BitSet() {
+ }
+
++#if BOOST_VERSION < 109000
+ const uint64_t* BitSet::getBits() {
+ return bitSet.empty() ? NULL : static_cast<const uint64_t*>(&bitSet.m_bits[0]);
+ }
++#endif
+
+ void BitSet::clear() {
+ bitSet.clear();
+@@ -35,16 +39,20 @@ void BitSet::fastClear(uint32_t bitIndex
+ }
+
+ 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 +78,28 @@ void BitSet::fastSet(uint32_t bitIndex,
+ }
+
+ 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 +117,17 @@ void BitSet::flip(uint32_t fromIndex, ui
+ 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 +151,46 @@ bool BitSet::fastGet(uint32_t bitIndex)
+ }
+
+ 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 +198,11 @@ bool BitSet::intersectsBitSet(const BitS
+ }
+
+ 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 +215,28 @@ bool BitSet::equals(const LuceneObjectPt
+ }
+ 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;
Home |
Main Index |
Thread Index |
Old Index