Revert "system-clucene patch fixes: some required QDir::mkpath in QtCLucene, cleanups"

This reverts commit aab042cb30.
This commit is contained in:
Rex Dieter 2014-12-11 06:52:02 -06:00
parent b91848f999
commit c4abe2a74a
2 changed files with 49 additions and 77 deletions

View File

@ -1,8 +1,6 @@
%global qt_module qttools
%if 0%{?fedora} > 19 || 0%{?rhel} > 6
%global system_clucene 1
%endif
# define to build docs, need to undef this for bootstrapping
# where qt5-qttools builds are not yet available
@ -14,7 +12,7 @@
Summary: Qt5 - QtTool components
Name: qt5-qttools
Version: 5.3.2
Release: 4%{?dist}
Release: 3%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -25,7 +23,7 @@ Source0: http://download.qt-project.org/development_releases/qt/5.3/%{version}-%
Source0: http://download.qt-project.org/official_releases/qt/5.3/%{version}/submodules/%{qt_module}-opensource-src-%{version}.tar.xz
%endif
Patch1: qttools-opensource-src-5.3.2-system-clucene.patch
Patch1: qttools-opensource-src-5.3.0-system-clucene.patch
# help lrelease/lupdate use/prefer qmake-qt5
# https://bugzilla.redhat.com/show_bug.cgi?id=1009893
@ -49,7 +47,12 @@ BuildRequires: qt5-qtdeclarative-static
BuildRequires: qt5-qtwebkit-devel
%if 0%{?system_clucene}
BuildRequires: clucene09-core-devel >= 0.9.21b-12
%if 0%{?fedora} || 0%{?rhel} > 6
BuildRequires: clucene09-core-devel
%else
BuildConflicts: clucene-core-devel > 2
BuildRequires: clucene-core-devel
%endif
%endif
%{?_qt5_version:Requires: qt5-qtbase%{?_isa} >= %{_qt5_version}}
@ -355,11 +358,6 @@ fi
%changelog
* Thu Dec 04 2014 Kevin Kofler <Kevin@tigcc.ticalc.org> 5.3.2-4
- system-clucene patch fixes: some required QDir::mkpath in QtCLucene, cleanups
- F20+/EL7+: BR reference-counting-enabled clucene09 (#1128293)
- disable system-clucene where refcounted clucene09 not available (#1128293)
* Wed Dec 03 2014 Rex Dieter <rdieter@fedoraproject.org> 5.3.2-3
- rebuild (clucene09)

View File

@ -1,7 +1,7 @@
diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/fulltextsearch.pri qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/fulltextsearch.pri
--- qttools-opensource-src-5.3.2/src/assistant/clucene/fulltextsearch.pri 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/fulltextsearch.pri 2014-10-31 23:44:32.368856494 +0100
@@ -1,125 +1,7 @@
diff -up qttools-opensource-src-5.3.0/src/assistant/clucene/fulltextsearch.pri.system_clucene qttools-opensource-src-5.3.0/src/assistant/clucene/fulltextsearch.pri
--- qttools-opensource-src-5.3.0/src/assistant/clucene/fulltextsearch.pri.system_clucene 2014-05-15 12:12:39.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/clucene/fulltextsearch.pri 2014-05-30 12:31:10.921201196 -0500
@@ -1,125 +1,8 @@
-DEFINES += _BUILD_FOR_QT_ LUCENE_DISABLE_MEMTRACKING
-win32:DEFINES += _CRT_SECURE_NO_DEPRECATE _MT
-
@ -126,13 +126,14 @@ diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/fulltextsearch.pri q
+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!)
+DEFINES += LUCENE_ENABLE_REFCOUNT
+QMAKE_CXXFLAGS += -fpermissive
#Header files
HEADERS += qclucene_global_p.h \
diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene-config_p.h qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qclucene-config_p.h
--- qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene-config_p.h 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qclucene-config_p.h 2014-10-31 23:44:32.368856494 +0100
diff -up qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene-config_p.h.system_clucene qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene-config_p.h
--- qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene-config_p.h.system_clucene 2014-05-15 12:12:39.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene-config_p.h 2014-05-30 12:31:10.922201214 -0500
@@ -15,6 +15,8 @@
**
****************************************************************************/
@ -142,9 +143,9 @@ diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene-config_p.h
#ifndef QCLUCENE_CONFIG_P_H
#define QCLUCENE_CONFIG_P_H
diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene_global_p.h qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qclucene_global_p.h
--- qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene_global_p.h 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qclucene_global_p.h 2014-10-31 23:44:32.368856494 +0100
diff -up qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene_global_p.h.system_clucene qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene_global_p.h
--- qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene_global_p.h.system_clucene 2014-05-15 12:12:39.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/clucene/qclucene_global_p.h 2014-05-30 12:31:10.923201233 -0500
@@ -29,20 +29,10 @@
// We mean it.
//
@ -167,7 +168,7 @@ diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene_global_p.h
QT_BEGIN_NAMESPACE
@@ -54,52 +44,6 @@
@@ -54,52 +44,6 @@ QT_BEGIN_NAMESPACE
# define Q_CLUCENE_EXPORT Q_DECL_IMPORT
#endif
@ -220,78 +221,65 @@ diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qclucene_global_p.h
namespace QtCLuceneHelpers {
inline TCHAR* QStringToTChar(const QString &str)
{
diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qindexreader.cpp qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qindexreader.cpp
--- qttools-opensource-src-5.3.2/src/assistant/clucene/qindexreader.cpp 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qindexreader.cpp 2014-10-31 23:47:52.184907583 +0100
@@ -18,6 +18,8 @@
#include "qindexreader_p.h"
#include "qclucene_global_p.h"
+#include <QtCore/QDir>
+
#include <CLucene.h>
#include <CLucene/index/IndexReader.h>
@@ -59,13 +61,13 @@
diff -up qttools-opensource-src-5.3.0/src/assistant/clucene/qindexreader.cpp.system_clucene qttools-opensource-src-5.3.0/src/assistant/clucene/qindexreader.cpp
--- qttools-opensource-src-5.3.0/src/assistant/clucene/qindexreader.cpp.system_clucene 2014-05-15 12:12:39.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/clucene/qindexreader.cpp 2014-05-30 12:31:10.924201251 -0500
@@ -59,13 +59,13 @@ bool QCLuceneIndexReader::isLuceneFile(c
{
using namespace lucene::index;
- return IndexReader::isLuceneFile(filename);
+ return IndexReader::isLuceneFile(filename.toLocal8Bit().constData());
+ return IndexReader::isLuceneFile(filename.toStdString().c_str());
}
bool QCLuceneIndexReader::indexExists(const QString &directory)
{
using namespace lucene::index;
- return IndexReader::indexExists(directory);
+ return IndexReader::indexExists(directory.toLocal8Bit().constData());
+ return IndexReader::indexExists(directory.toStdString().c_str());
}
QCLuceneIndexReader QCLuceneIndexReader::open(const QString &path)
@@ -73,7 +75,7 @@
@@ -73,7 +73,7 @@ QCLuceneIndexReader QCLuceneIndexReader:
using namespace lucene::index;
QCLuceneIndexReader indexReader;
- indexReader.d->reader = IndexReader::open(path);
+ indexReader.d->reader = IndexReader::open(path.toLocal8Bit().constData());
+ indexReader.d->reader = IndexReader::open(path.toStdString().c_str());
return indexReader;
}
@@ -81,25 +83,29 @@
@@ -81,25 +81,25 @@ QCLuceneIndexReader QCLuceneIndexReader:
void QCLuceneIndexReader::unlock(const QString &path)
{
using namespace lucene::index;
- IndexReader::unlock(path);
+ IndexReader::unlock(path.toLocal8Bit().constData());
+ IndexReader::unlock(path.toStdString().c_str());
}
bool QCLuceneIndexReader::isLocked(const QString &directory)
{
+ // The system CLucene fails here if the directory does not exist yet, unlike
+ // the bundled one. Work around that.
+ QDir::current().mkpath(directory);
+
using namespace lucene::index;
- return IndexReader::isLocked(directory);
+ return IndexReader::isLocked(directory.toLocal8Bit().constData());
+ return IndexReader::isLocked(directory.toStdString().c_str());
}
quint64 QCLuceneIndexReader::lastModified(const QString &directory)
{
using namespace lucene::index;
- return quint64(IndexReader::lastModified(directory));
+ return quint64(IndexReader::lastModified(directory.toLocal8Bit().constData()));
+ return quint64(IndexReader::lastModified(directory.toStdString().c_str()));
}
qint64 QCLuceneIndexReader::getCurrentVersion(const QString &directory)
{
using namespace lucene::index;
- return qint64(IndexReader::getCurrentVersion(directory));
+ return qint64(IndexReader::getCurrentVersion(directory.toLocal8Bit().constData()));
+ return qint64(IndexReader::getCurrentVersion(directory.toStdString().c_str()));
}
void QCLuceneIndexReader::close()
@@ -155,7 +161,7 @@
@@ -155,7 +155,7 @@ bool QCLuceneIndexReader::document(qint3
void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, qreal value)
{
TCHAR *fieldName = QStringToTChar(field);
@ -300,48 +288,34 @@ diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qindexreader.cpp qtt
delete [] fieldName;
}
diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qindexwriter.cpp qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qindexwriter.cpp
--- qttools-opensource-src-5.3.2/src/assistant/clucene/qindexwriter.cpp 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qindexwriter.cpp 2014-10-31 23:44:32.369856502 +0100
@@ -18,6 +18,8 @@
#include "qindexwriter_p.h"
#include "qindexreader_p.h"
+#include <QtCore/QDir>
+
#include <CLucene.h>
#include <CLucene/index/IndexWriter.h>
@@ -50,7 +52,12 @@
diff -up qttools-opensource-src-5.3.0/src/assistant/clucene/qindexwriter.cpp.system_clucene qttools-opensource-src-5.3.0/src/assistant/clucene/qindexwriter.cpp
--- qttools-opensource-src-5.3.0/src/assistant/clucene/qindexwriter.cpp.system_clucene 2014-05-15 12:12:39.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/clucene/qindexwriter.cpp 2014-05-30 12:31:10.925201269 -0500
@@ -50,7 +50,7 @@ QCLuceneIndexWriter::QCLuceneIndexWriter
: d(new QCLuceneIndexWriterPrivate())
, analyzer(analyzer)
{
- d->writer = new lucene::index::IndexWriter(path,
+ // The system CLucene cannot create directories recursively, so do it here.
+ // Ignore failure: If it failed, we will get an error from CLucene anyway.
+ if (create)
+ QDir::current().mkpath(path);
+
+ d->writer = new lucene::index::IndexWriter(path.toLocal8Bit().constData(),
+ d->writer = new lucene::index::IndexWriter(path.toStdString().c_str(),
analyzer.d->analyzer, create, closeDir);
}
diff -ur qttools-opensource-src-5.3.2/src/assistant/clucene/qsearchable.cpp qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qsearchable.cpp
--- qttools-opensource-src-5.3.2/src/assistant/clucene/qsearchable.cpp 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/clucene/qsearchable.cpp 2014-10-31 23:44:32.369856502 +0100
@@ -95,7 +95,7 @@
diff -up qttools-opensource-src-5.3.0/src/assistant/clucene/qsearchable.cpp.system_clucene qttools-opensource-src-5.3.0/src/assistant/clucene/qsearchable.cpp
--- qttools-opensource-src-5.3.0/src/assistant/clucene/qsearchable.cpp.system_clucene 2014-05-15 12:12:39.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/clucene/qsearchable.cpp 2014-05-30 12:31:10.926201287 -0500
@@ -95,7 +95,7 @@ QCLuceneIndexSearcher::QCLuceneIndexSear
: QCLuceneSearcher()
{
lucene::search::IndexSearcher *searcher =
- new lucene::search::IndexSearcher(path);
+ new lucene::search::IndexSearcher(path.toLocal8Bit().constData());
+ new lucene::search::IndexSearcher(path.toStdString().c_str());
reader.d->reader = searcher->getReader();
reader.d->deleteCLuceneIndexReader = false;
diff -ur qttools-opensource-src-5.3.2/src/assistant/help/help.pro qttools-opensource-src-5.3.2-system-clucene/src/assistant/help/help.pro
--- qttools-opensource-src-5.3.2/src/assistant/help/help.pro 2014-09-11 12:48:25.000000000 +0200
+++ qttools-opensource-src-5.3.2-system-clucene/src/assistant/help/help.pro 2014-10-31 23:44:32.369856502 +0100
@@ -34,6 +34,7 @@
diff -up qttools-opensource-src-5.3.0/src/assistant/help/help.pro.system_clucene qttools-opensource-src-5.3.0/src/assistant/help/help.pro
--- qttools-opensource-src-5.3.0/src/assistant/help/help.pro.system_clucene 2014-05-15 12:12:40.000000000 -0500
+++ qttools-opensource-src-5.3.0/src/assistant/help/help.pro 2014-05-30 12:50:57.233287205 -0500
@@ -34,6 +34,7 @@ SOURCES += qhelpenginecore.cpp \
qhelp_global.cpp
# access to clucene