[kf5-ki18n] Add upstream patch to fix plugin installation destination

Daniel Vrátil dvratil at fedoraproject.org
Mon Jun 9 09:47:38 UTC 2014


commit a7eed17952e06a7dd71b7f2819717fcbbc5d970b
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Mon Jun 9 11:32:03 2014 +0200

    Add upstream patch to fix plugin installation destination

 kf5-ki18n.spec                 |    9 ++++-
 ki18n-plugin-install-dir.patch |   76 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+), 1 deletions(-)
---
diff --git a/kf5-ki18n.spec b/kf5-ki18n.spec
index ae9dd61..2305456 100644
--- a/kf5-ki18n.spec
+++ b/kf5-ki18n.spec
@@ -3,7 +3,7 @@
 
 Name:           kf5-%{framework}
 Version:        4.100.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        KDE Frameworks 5 Tier 1 addon for localization
 
 License:        LGPLv2+
@@ -14,6 +14,8 @@ URL:            http://www.kde.org
 #Source0:        %{name}-%{version}-%{snapshot}git.tar.bz2
 Source0:        http://download.kde.org/unstable/frameworks/%{version}/%{framework}-%{version}.tar.xz
 
+Patch0:		ki18n-plugin-install-dir.patch
+
 BuildRequires:  perl
 
 BuildRequires:  kf5-rpm-macros
@@ -39,6 +41,8 @@ developing applications that use %{name}.
 %prep
 %setup -q -n %{framework}-%{version}
 
+%patch0 -p1 -b .pluginInstallDir
+
 %build
 mkdir -p %{_target_platform}
 pushd %{_target_platform}
@@ -70,6 +74,9 @@ make %{?_smp_mflags} -C %{_target_platform}
 %{_kf5_archdatadir}/mkspecs/modules/qt_KI18n.pri
 
 %changelog
+* Mon Jun 09 2014 Daniel Vrátil <dvratil at redhat.com> - 4.100.0-2
+- add upstream patch to fix plugins installation destination
+
 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.100.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/ki18n-plugin-install-dir.patch b/ki18n-plugin-install-dir.patch
new file mode 100644
index 0000000..e83ad62
--- /dev/null
+++ b/ki18n-plugin-install-dir.patch
@@ -0,0 +1,76 @@
+From: Alex Merry <alex.merry at kde.org>
+Date: Mon, 02 Jun 2014 22:00:26 +0000
+Subject: Put transcript plugin in kf5 subdir and simplify search logic
+X-Git-Url: http://quickgit.kde.org/?p=ki18n.git&a=commitdiff&h=8bb821a959fa71c405a1e94bc73aa20920254122
+---
+Put transcript plugin in kf5 subdir and simplify search logic
+
+Putting the plugin in a versioned subdirectory ensures there will not be
+any coinstallability issues with KF6 if it is Qt5-based. Using
+QPluginLoader to find the plugin makes for simpler, more reliable code.
+
+REVIEW: 118486
+---
+
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -46,10 +46,9 @@
+ )
+ add_library(ktranscript MODULE ${ktranscript_LIB_SRCS})
+ generate_export_header(ktranscript BASE_NAME KTranscript)
+-set_target_properties(ktranscript PROPERTIES PREFIX "") # remove lib prefix
+ target_link_libraries(ktranscript PRIVATE Qt5::Script Qt5::Core)
+ 
+-install(TARGETS ktranscript DESTINATION ${PLUGIN_INSTALL_DIR})
++install(TARGETS ktranscript DESTINATION ${PLUGIN_INSTALL_DIR}/kf5)
+ 
+ 
+ include(ECMGeneratePriFile)
+
+--- a/src/klocalizedstring.cpp
++++ b/src/klocalizedstring.cpp
+@@ -31,6 +31,7 @@
+ #include <QFile>
+ #include <QFileInfo>
+ #include <QLibrary>
++#include <QPluginLoader>
+ #include <QDir>
+ #include <QCoreApplication>
+ #include <qstandardpaths.h>
+@@ -1362,29 +1363,14 @@
+     s->loadTranscriptCalled = true;
+     s->ktrs = NULL; // null indicates that Transcript is not available
+ 
+-#if 0
+-    // FIXME: Automatic plugin path resolution does not work at the moment,
+-    // so search manually through library paths.
+-    QString pluginPathNoExt = QLatin1String("kf5/ktranscript");
+-#else
+-    QString pluginPathNoExt;
+-    QStringList nameFilters;
+-    QString pluginName = QLatin1String("ktranscript");
+-    nameFilters.append(pluginName + QLatin1String(".*"));
+-    foreach (const QString &dirPath, QCoreApplication::libraryPaths()) {
+-        QString dirPathKf = dirPath + QLatin1Char('/');
+-        if (!QDir(dirPathKf).entryList(nameFilters).isEmpty()) {
+-            pluginPathNoExt = dirPathKf + QLatin1Char('/') + pluginName;
+-            break;
+-        }
+-    }
+-    if (pluginPathNoExt.isEmpty()) {
++    // QPluginLoader is just used to find the plugin
++    QPluginLoader loader(QStringLiteral("kf5/ktranscript"));
++    if (loader.fileName().isEmpty()) {
+         qWarning() << QString::fromLatin1("Cannot find Transcript plugin.");
+         return;
+     }
+-#endif
+-
+-    QLibrary lib(pluginPathNoExt);
++
++    QLibrary lib(loader.fileName());
+     if (!lib.load()) {
+         qWarning() << QString::fromLatin1("Cannot load Transcript plugin:")
+                    << lib.errorString();
+


More information about the scm-commits mailing list