[qt] build against the system clucene09-core (same patch as for qt5-qttools)
Kevin Kofler
kkofler at fedoraproject.org
Sun Oct 26 02:58:15 UTC 2014
commit 53156e5052aeb6078b3b10874d22d0dd3d3a166c
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date: Sun Oct 26 03:58:06 2014 +0100
build against the system clucene09-core (same patch as for qt5-qttools)
* Sun Oct 26 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1:4.8.6-14
- build against the system clucene09-core (same patch as for qt5-qttools)
...where-opensource-src-4.8.6-system-clucene.patch | 324 ++++++++++++++++++++
qt.spec | 23 ++-
2 files changed, 346 insertions(+), 1 deletions(-)
---
diff --git a/qt-everywhere-opensource-src-4.8.6-system-clucene.patch b/qt-everywhere-opensource-src-4.8.6-system-clucene.patch
new file mode 100644
index 0000000..6e0c116
--- /dev/null
+++ b/qt-everywhere-opensource-src-4.8.6-system-clucene.patch
@@ -0,0 +1,324 @@
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/fulltextsearch.pri qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/fulltextsearch.pri
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/fulltextsearch.pri 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/fulltextsearch.pri 2014-10-26 03:33:45.000000000 +0100
+@@ -1,125 +1,7 @@
+-DEFINES += _BUILD_FOR_QT_ LUCENE_DISABLE_MEMTRACKING
+-win32:DEFINES += _CRT_SECURE_NO_DEPRECATE _MT
+-
+-CLUCENEDIR = ../../../../src/3rdparty/clucene/src/CLucene
+-
+-INCLUDEPATH += . .. \
+- $$CLUCENEDIR \
+- $$CLUCENEDIR/../ \
+- $$CLUCENEDIR/analysis \
+- $$CLUCENEDIR/analysis/standard \
+- $$CLUCENEDIR/config \
+- $$CLUCENEDIR/debug \
+- $$CLUCENEDIR/document \
+- $$CLUCENEDIR/index \
+- $$CLUCENEDIR/queryParser \
+- $$CLUCENEDIR/search \
+- $$CLUCENEDIR/store \
+- $$CLUCENEDIR/util
+-
+-
+-SOURCES += $$CLUCENEDIR/StdHeader.cpp \
+- $$CLUCENEDIR/analysis/AnalysisHeader.cpp \
+- $$CLUCENEDIR/analysis/Analyzers.cpp \
+- $$CLUCENEDIR/config/gunichartables.cpp \
+- $$CLUCENEDIR/config/repl_lltot.cpp \
+- $$CLUCENEDIR/config/repl_tcscasecmp.cpp \
+- $$CLUCENEDIR/config/repl_tcslwr.cpp \
+- $$CLUCENEDIR/config/repl_tcstod.cpp \
+- $$CLUCENEDIR/config/repl_tcstoll.cpp \
+- $$CLUCENEDIR/config/repl_tprintf.cpp \
+- $$CLUCENEDIR/config/threads.cpp \
+- $$CLUCENEDIR/config/utf8.cpp \
+- $$CLUCENEDIR/debug/condition.cpp \
+- $$CLUCENEDIR/debug/error.cpp \
+- $$CLUCENEDIR/debug/memtracking.cpp \
+- $$CLUCENEDIR/document/DateField.cpp \
+- $$CLUCENEDIR/document/Document.cpp \
+- $$CLUCENEDIR/document/Field.cpp \
+- $$CLUCENEDIR/index/CompoundFile.cpp \
+- $$CLUCENEDIR/index/DocumentWriter.cpp \
+- $$CLUCENEDIR/index/FieldInfos.cpp \
+- $$CLUCENEDIR/index/FieldsReader.cpp \
+- $$CLUCENEDIR/index/FieldsWriter.cpp \
+- $$CLUCENEDIR/index/IndexModifier.cpp \
+- $$CLUCENEDIR/index/IndexReader.cpp \
+- $$CLUCENEDIR/index/IndexWriter.cpp \
+- $$CLUCENEDIR/index/MultiReader.cpp \
+- $$CLUCENEDIR/index/SegmentInfos.cpp \
+- $$CLUCENEDIR/index/SegmentMergeInfo.cpp \
+- $$CLUCENEDIR/index/SegmentMergeQueue.cpp \
+- $$CLUCENEDIR/index/SegmentMerger.cpp \
+- $$CLUCENEDIR/index/SegmentReader.cpp \
+- $$CLUCENEDIR/index/SegmentTermDocs.cpp \
+- $$CLUCENEDIR/index/SegmentTermEnum.cpp \
+- $$CLUCENEDIR/index/SegmentTermPositions.cpp \
+- $$CLUCENEDIR/index/SegmentTermVector.cpp \
+- $$CLUCENEDIR/index/Term.cpp \
+- $$CLUCENEDIR/index/TermInfo.cpp \
+- $$CLUCENEDIR/index/TermInfosReader.cpp \
+- $$CLUCENEDIR/index/TermInfosWriter.cpp \
+- $$CLUCENEDIR/index/TermVectorReader.cpp \
+- $$CLUCENEDIR/index/TermVectorWriter.cpp \
+- $$CLUCENEDIR/queryParser/Lexer.cpp \
+- $$CLUCENEDIR/queryParser/MultiFieldQueryParser.cpp \
+- $$CLUCENEDIR/queryParser/QueryParser.cpp \
+- $$CLUCENEDIR/queryParser/QueryParserBase.cpp \
+- $$CLUCENEDIR/queryParser/QueryToken.cpp \
+- $$CLUCENEDIR/queryParser/TokenList.cpp \
+- $$CLUCENEDIR/search/BooleanQuery.cpp \
+- $$CLUCENEDIR/search/BooleanScorer.cpp \
+- $$CLUCENEDIR/search/CachingWrapperFilter.cpp \
+- $$CLUCENEDIR/search/ChainedFilter.cpp \
+- $$CLUCENEDIR/search/ConjunctionScorer.cpp \
+- $$CLUCENEDIR/search/DateFilter.cpp \
+- $$CLUCENEDIR/search/ExactPhraseScorer.cpp \
+- $$CLUCENEDIR/search/Explanation.cpp \
+- $$CLUCENEDIR/search/FieldCache.cpp \
+- $$CLUCENEDIR/search/FieldCacheImpl.cpp \
+- $$CLUCENEDIR/search/FieldDocSortedHitQueue.cpp \
+- $$CLUCENEDIR/search/FieldSortedHitQueue.cpp \
+- $$CLUCENEDIR/search/FilteredTermEnum.cpp \
+- $$CLUCENEDIR/search/FuzzyQuery.cpp \
+- $$CLUCENEDIR/search/HitQueue.cpp \
+- $$CLUCENEDIR/search/Hits.cpp \
+- $$CLUCENEDIR/search/IndexSearcher.cpp \
+- $$CLUCENEDIR/search/MultiSearcher.cpp \
+- $$CLUCENEDIR/search/MultiTermQuery.cpp \
+- $$CLUCENEDIR/search/PhrasePositions.cpp \
+- $$CLUCENEDIR/search/PhraseQuery.cpp \
+- $$CLUCENEDIR/search/PhraseScorer.cpp \
+- $$CLUCENEDIR/search/PrefixQuery.cpp \
+- $$CLUCENEDIR/search/QueryFilter.cpp \
+- $$CLUCENEDIR/search/RangeFilter.cpp \
+- $$CLUCENEDIR/search/RangeQuery.cpp \
+- $$CLUCENEDIR/search/SearchHeader.cpp \
+- $$CLUCENEDIR/search/Similarity.cpp \
+- $$CLUCENEDIR/search/SloppyPhraseScorer.cpp \
+- $$CLUCENEDIR/search/Sort.cpp \
+- $$CLUCENEDIR/search/TermQuery.cpp \
+- $$CLUCENEDIR/search/TermScorer.cpp \
+- $$CLUCENEDIR/search/WildcardQuery.cpp \
+- $$CLUCENEDIR/search/WildcardTermEnum.cpp \
+- $$CLUCENEDIR/store/FSDirectory.cpp \
+- $$CLUCENEDIR/store/IndexInput.cpp \
+- $$CLUCENEDIR/store/IndexOutput.cpp \
+- $$CLUCENEDIR/store/Lock.cpp \
+- $$CLUCENEDIR/store/MMapInput.cpp \
+- $$CLUCENEDIR/store/RAMDirectory.cpp \
+- $$CLUCENEDIR/store/TransactionalRAMDirectory.cpp \
+- $$CLUCENEDIR/util/BitSet.cpp \
+- $$CLUCENEDIR/util/Equators.cpp \
+- $$CLUCENEDIR/util/FastCharStream.cpp \
+- $$CLUCENEDIR/util/fileinputstream.cpp \
+- $$CLUCENEDIR/util/Misc.cpp \
+- $$CLUCENEDIR/util/Reader.cpp \
+- $$CLUCENEDIR/util/StringBuffer.cpp \
+- $$CLUCENEDIR/util/StringIntern.cpp \
+- $$CLUCENEDIR/util/ThreadLocal.cpp \
+- $$CLUCENEDIR/analysis/standard/StandardAnalyzer.cpp \
+- $$CLUCENEDIR/analysis/standard/StandardFilter.cpp \
+- $$CLUCENEDIR/analysis/standard/StandardTokenizer.cpp
+
++INCLUDEPATH += /usr/include/clucene09 $$[QT_INSTALL_LIBS]/clucene09 $$[QT_INSTALL_LIBS]
++LIBS += -L$$[QT_INSTALL_LIBS]/clucene09 -lclucene
++#DEFINES += LUCENE_ENABLE_REFCOUNT (must be set at CLucene build time!)
+
+ #Header files
+ HEADERS += qclucene_global_p.h \
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qclucene-config_p.h qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qclucene-config_p.h
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qclucene-config_p.h 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qclucene-config_p.h 2014-10-26 02:28:54.000000000 +0100
+@@ -15,6 +15,8 @@
+ **
+ ****************************************************************************/
+
++#error This header must not be included when building against system CLucene.
++
+ #ifndef QCLUCENE_CONFIG_P_H
+ #define QCLUCENE_CONFIG_P_H
+
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qclucene_global_p.h qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qclucene_global_p.h
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qclucene_global_p.h 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qclucene_global_p.h 2014-10-26 02:31:54.000000000 +0100
+@@ -29,20 +29,10 @@
+ // We mean it.
+ //
+
+-#if !defined(_MSC_VER)
+-# include "qclucene-config_p.h"
+-#endif
+-
+ #include <QtCore/QChar>
+ #include <QtCore/QString>
+
+-#if !defined(_MSC_VER) && !defined(__MINGW32__) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)
+-# if !defined(TCHAR)
+-# define TCHAR wchar_t
+-# endif
+-#else
+-# include <windows.h>
+-#endif
++#include <CLucene/StdHeader.h>
+
+ QT_BEGIN_HEADER
+
+@@ -56,52 +46,6 @@
+ # define QHELP_EXPORT Q_DECL_IMPORT
+ #endif
+
+-//
+-// W A R N I N G
+-// -------------
+-//
+-// adjustments here, need to be done in
+-// QTDIR/src/3rdparty/clucene/src/CLucene/StdHeader.h as well
+-//
+-#if defined(_LUCENE_DONTIMPLEMENT_NS_MACROS)
+-
+-#elif !defined(DISABLE_NAMESPACE)
+-# ifdef QT_NAMESPACE
+-# define CL_NS_DEF(sub) namespace QT_NAMESPACE { namespace lucene{ namespace sub{
+-# define CL_NS_DEF2(sub,sub2) namespace QT_NAMESPACE { namespace lucene{ namespace sub{ namespace sub2 {
+-
+-# define CL_NS_END }}}
+-# define CL_NS_END2 }}}}
+-
+-# define CL_NS_USE(sub) using namespace QT_NAMESPACE::lucene::sub;
+-# define CL_NS_USE2(sub,sub2) using namespace QT_NAMESPACE::lucene::sub::sub2;
+-
+-# define CL_NS(sub) QT_NAMESPACE::lucene::sub
+-# define CL_NS2(sub,sub2) QT_NAMESPACE::lucene::sub::sub2
+-# else
+-# define CL_NS_DEF(sub) namespace lucene{ namespace sub{
+-# define CL_NS_DEF2(sub,sub2) namespace lucene{ namespace sub{ namespace sub2 {
+-
+-# define CL_NS_END }}
+-# define CL_NS_END2 }}}
+-
+-# define CL_NS_USE(sub) using namespace lucene::sub;
+-# define CL_NS_USE2(sub,sub2) using namespace lucene::sub::sub2;
+-
+-# define CL_NS(sub) lucene::sub
+-# define CL_NS2(sub,sub2) lucene::sub::sub2
+-# endif
+-#else
+-# define CL_NS_DEF(sub)
+-# define CL_NS_DEF2(sub, sub2)
+-# define CL_NS_END
+-# define CL_NS_END2
+-# define CL_NS_USE(sub)
+-# define CL_NS_USE2(sub,sub2)
+-# define CL_NS(sub)
+-# define CL_NS2(sub,sub2)
+-#endif
+-
+ namespace {
+ TCHAR* QStringToTChar(const QString &str)
+ {
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qindexreader.cpp qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qindexreader.cpp
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qindexreader.cpp 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qindexreader.cpp 2014-10-26 02:48:02.000000000 +0100
+@@ -59,13 +59,13 @@
+ {
+ using namespace lucene::index;
+
+- return IndexReader::isLuceneFile(filename);
++ return IndexReader::isLuceneFile(filename.toLocal8Bit().constData());
+ }
+
+ bool QCLuceneIndexReader::indexExists(const QString &directory)
+ {
+ using namespace lucene::index;
+- return IndexReader::indexExists(directory);
++ return IndexReader::indexExists(directory.toLocal8Bit().constData());
+ }
+
+ QCLuceneIndexReader QCLuceneIndexReader::open(const QString &path)
+@@ -73,7 +73,7 @@
+ using namespace lucene::index;
+
+ QCLuceneIndexReader indexReader;
+- indexReader.d->reader = IndexReader::open(path);
++ indexReader.d->reader = IndexReader::open(path.toLocal8Bit().constData());
+
+ return indexReader;
+ }
+@@ -81,25 +81,25 @@
+ void QCLuceneIndexReader::unlock(const QString &path)
+ {
+ using namespace lucene::index;
+- IndexReader::unlock(path);
++ IndexReader::unlock(path.toLocal8Bit().constData());
+ }
+
+ bool QCLuceneIndexReader::isLocked(const QString &directory)
+ {
+ using namespace lucene::index;
+- return IndexReader::isLocked(directory);
++ return IndexReader::isLocked(directory.toLocal8Bit().constData());
+ }
+
+ quint64 QCLuceneIndexReader::lastModified(const QString &directory)
+ {
+ using namespace lucene::index;
+- return quint64(IndexReader::lastModified(directory));
++ return quint64(IndexReader::lastModified(directory.toLocal8Bit().constData()));
+ }
+
+ qint64 QCLuceneIndexReader::getCurrentVersion(const QString &directory)
+ {
+ using namespace lucene::index;
+- return qint64(IndexReader::getCurrentVersion(directory));
++ return qint64(IndexReader::getCurrentVersion(directory.toLocal8Bit().constData()));
+ }
+
+ void QCLuceneIndexReader::close()
+@@ -155,7 +155,7 @@
+ void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, qreal value)
+ {
+ TCHAR *fieldName = QStringToTChar(field);
+- d->reader->setNorm(int32_t(doc), fieldName, qreal(value));
++ d->reader->setNorm(int32_t(doc), fieldName, (float_t)value);
+ delete [] fieldName;
+ }
+
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qindexwriter.cpp qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qindexwriter.cpp
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qindexwriter.cpp 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qindexwriter.cpp 2014-10-26 02:48:27.000000000 +0100
+@@ -50,7 +50,7 @@
+ : d(new QCLuceneIndexWriterPrivate())
+ , analyzer(analyzer)
+ {
+- d->writer = new lucene::index::IndexWriter(path,
++ d->writer = new lucene::index::IndexWriter(path.toLocal8Bit().constData(),
+ analyzer.d->analyzer, create, closeDir);
+ }
+
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qsearchable.cpp qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qsearchable.cpp
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/fulltextsearch/qsearchable.cpp 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/fulltextsearch/qsearchable.cpp 2014-10-26 02:48:44.000000000 +0100
+@@ -95,7 +95,7 @@
+ : QCLuceneSearcher()
+ {
+ lucene::search::IndexSearcher *searcher =
+- new lucene::search::IndexSearcher(path);
++ new lucene::search::IndexSearcher(path.toLocal8Bit().constData());
+
+ reader.d->reader = searcher->getReader();
+ reader.d->deleteCLuceneIndexReader = false;
+diff -ur qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/lib.pro qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/lib.pro
+--- qt-everywhere-opensource-src-4.8.6/tools/assistant/lib/lib.pro 2014-04-10 20:37:12.000000000 +0200
++++ qt-everywhere-opensource-src-4.8.6-system-clucene/tools/assistant/lib/lib.pro 2014-10-26 02:27:55.000000000 +0100
+@@ -43,6 +43,7 @@
+ qhelp_global.cpp
+
+ # access to clucene
++INCLUDEPATH += /usr/include/clucene09 $$[QT_INSTALL_LIBS]/clucene09 $$[QT_INSTALL_LIBS]
+ SOURCES += qhelpsearchindexwriter_clucene.cpp \
+ qhelpsearchindexreader_clucene.cpp
+ HEADERS += qhelpenginecore.h \
diff --git a/qt.spec b/qt.spec
index 8df8d64..c9f35ba 100644
--- a/qt.spec
+++ b/qt.spec
@@ -13,6 +13,10 @@
%define qt_settings 1
%endif
+%if 0%{?fedora}
+%global system_clucene 1
+%endif
+
%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
# trim changelog included in binary rpms
@@ -31,7 +35,7 @@ Summary: Qt toolkit
Name: qt
Epoch: 1
Version: 4.8.6
-Release: 13%{?dist}
+Release: 14%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
@@ -152,6 +156,9 @@ Patch87: qt-everywhere-opensource-src-4.8.6-QTBUG-37380.patch
Patch88: qt-everywhere-opensource-src-4.8.6-QTBUG-34614.patch
Patch89: qt-everywhere-opensource-src-4.8.6-QTBUG-38585.patch
+# build against the system clucene09-core
+Patch90: qt-everywhere-opensource-src-4.8.6-system-clucene.patch
+
# upstream patches
# backported from Qt5 (essentially)
# http://bugzilla.redhat.com/702493
@@ -264,6 +271,10 @@ BuildRequires: rsync
BuildRequires: %{gl_deps}
BuildRequires: %{x_deps}
+%if 0%{?system_clucene}
+BuildRequires: clucene09-core-devel >= 0.9.21b-12
+%endif
+
%if "%{?ibase}" != "-no-sql-ibase"
BuildRequires: firebird-devel
%endif
@@ -543,6 +554,12 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags
%patch88 -p0 -b .QTBUG-34614
%patch89 -p0 -b .QTBUG-38585
+%if 0%{?system_clucene}
+%patch90 -p1 -b .system_clucene
+# delete bundled copy
+rm -rf src/3rdparty/clucene
+%endif
+
# upstream patches
%patch102 -p1 -b .qgtkstyle_disable_gtk_theme_check
%patch113 -p1 -b .QTBUG-22829
@@ -564,6 +581,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags
# security fixes
# regression fixes for the security fixes
%patch84 -p1 -b .QTBUG-35459
+
%patch86 -p1 -b .systemtrayicon
# drop -fexceptions from $RPM_OPT_FLAGS
@@ -1284,6 +1302,9 @@ fi
%changelog
+* Sun Oct 26 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1:4.8.6-14
+- build against the system clucene09-core (same patch as for qt5-qttools)
+
* Tue Sep 16 2014 Rex Dieter <rdieter at fedoraproject.org> - 1:4.8.6-13
- qmlviewer: -qt4 wrapper, move to -devel
- pull in some upstream fixes
More information about the scm-commits
mailing list