diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2023-01-14 22:32:00 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2023-01-15 00:32:34 +0100 |
commit | ae6be4eb7f7d89b4dd95eee9f9e0a18401bc6161 (patch) | |
tree | 300688398a96834e34a2e0928441ec056e770588 /kde-frameworks/kfilemetadata | |
parent | kde-frameworks/kdoctools: 5.102.0 version bump (diff) | |
download | gentoo-ae6be4eb7f7d89b4dd95eee9f9e0a18401bc6161.tar.gz gentoo-ae6be4eb7f7d89b4dd95eee9f9e0a18401bc6161.tar.bz2 gentoo-ae6be4eb7f7d89b4dd95eee9f9e0a18401bc6161.zip |
kde-frameworks/kfilemetadata: 5.102.0 version bump
Downstream backport from 5.103: Fix loading of external plugins
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=463598
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-frameworks/kfilemetadata')
3 files changed, 155 insertions, 0 deletions
diff --git a/kde-frameworks/kfilemetadata/Manifest b/kde-frameworks/kfilemetadata/Manifest index 224867fc57c9..9c349b8588ae 100644 --- a/kde-frameworks/kfilemetadata/Manifest +++ b/kde-frameworks/kfilemetadata/Manifest @@ -1,2 +1,3 @@ DIST kfilemetadata-5.101.0.tar.xz 459916 BLAKE2B 29c32738a6ca568c094e2c000da5e668f82bdcc4a2cd38bbe9fbfb50dab82de2ff1c9ea4796e9e5810248960bcc54f6b8bf25e9979acc68ca209c380fc208499 SHA512 47ebe582b27470a77a6c04622b4c882005ab80e2b5467a2c75301bc0397e778c6e6b2a75b98d8c4d0c4fadca5a4f6fd92b3870c8b58b40f57f3d42e49c2d15a6 +DIST kfilemetadata-5.102.0.tar.xz 469548 BLAKE2B 4b63c93e94e37a58e8d415c2fce7c83758abdcba91102eccb042a0ba80e6424f075abe0c1814341a4c13a65bdff227ef2eaea42d2b58bdb1da7477baa477b0c0 SHA512 2be85d8f80ecbc5b1337c621d3807cd40b5dac010ce73e97b248cbcb0eeef7e258a1086c7de5809c15ccf6d81bc4956f1e5d415388b995b94b751ad570177bdd DIST kfilemetadata-5.99.0.tar.xz 439532 BLAKE2B 251617854bb7aa1b2a916e7f35651f29219066c7ce9659b60c93c29ab03156d3dda4d3536e4916f2a00db614c1e23f8ee4cc5de90f461593f2568e9cc20461fc SHA512 1499c9158fe6e1bf59f5150350b8f698e78881ddb251994ad6e6be0e471ffa1b4c092abc154e8a440eaa14a1f081ca411815800a3541a45bdd7d0b6767942db3 diff --git a/kde-frameworks/kfilemetadata/files/kfilemetadata-5.102.0-fix-loading-external-plugins.patch b/kde-frameworks/kfilemetadata/files/kfilemetadata-5.102.0-fix-loading-external-plugins.patch new file mode 100644 index 000000000000..5a40d129bc40 --- /dev/null +++ b/kde-frameworks/kfilemetadata/files/kfilemetadata-5.102.0-fix-loading-external-plugins.patch @@ -0,0 +1,86 @@ +From 543abf86e6747e406e176ac4e8fc52090bae373b Mon Sep 17 00:00:00 2001 +From: Alexander Lohnau <alexander.lohnau@gmx.de> +Date: Thu, 5 Jan 2023 20:57:54 +0100 +Subject: [PATCH] Fix loading of external extractors and writers + +In 5bbdfc4749f92c510cc82dbd66f5d3b2bc3763ac, the external extractors were mistakenly ported to KPluginMetaData::findPlugins. + +However, the logic was broken before, because the dir entries must *not* be plugins, but normal files. +This was introduced in 73da9a53cb500da000c50b164dd5693ef7474041. + +Considering that we tell QDir to only list dirs, the check if we have a plugin or not doesn't make sense anyways. + +BUG: 463598 +(cherry picked from commit 5bd67e925db7db2f9619139f7e8000ce0321d52d) +--- + src/extractorcollection.cpp | 23 ++++++++++++----------- + src/writercollection.cpp | 3 --- + 2 files changed, 12 insertions(+), 14 deletions(-) + + +From 36efc6c632ad88bf6b1f16649ec28cc78dad5c15 Mon Sep 17 00:00:00 2001 +From: Alexander Lohnau <alexander.lohnau@gmx.de> +Date: Thu, 12 Jan 2023 15:15:14 +0100 +Subject: [PATCH] Also add external extractors to vector of all plugins + +Amends 5bd67e925db7db2f9619139f7e8000ce0321d52d + +BUG: 463598 + + +(cherry picked from commit 34637beb6bb4dbaf80377f12142c799ed9e000d5) +--- + src/extractorcollection.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/extractorcollection.cpp b/src/extractorcollection.cpp +--- a/src/extractorcollection.cpp ++++ b/src/extractorcollection.cpp +@@ -72,19 +72,30 @@ + } + } + +- const QVector<KPluginMetaData> externalExtractors = +- KPluginMetaData::findPlugins(QStringLiteral(LIBEXEC_INSTALL_DIR "/kfilemetadata/externalextractors"), {}, KPluginMetaData::AllowEmptyMetaData); +- for (const KPluginMetaData &externalPlugin : externalExtractors) { +- qCDebug(KFILEMETADATA_LOG) << "Adding plugin - " << externalPlugin.fileName(); ++ QStringList externalPlugins; ++ const QDir externalPluginDir(QStringLiteral(LIBEXEC_INSTALL_DIR "/kfilemetadata/externalextractors")); ++ qCDebug(KFILEMETADATA_LOG) << "Searching for external extractors:" << externalPluginDir.path(); ++ // For external plugins, we look into the directories ++ const QStringList externalPluginEntryList = externalPluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); ++ for (const QString &externalPlugin : externalPluginEntryList) { ++ if (externalPlugins.contains(externalPlugin)) { ++ qCDebug(KFILEMETADATA_LOG) << "Skipping duplicate - " << externalPluginDir.path() << ":" << externalPlugin; ++ continue; ++ } ++ ++ qCDebug(KFILEMETADATA_LOG) << "Adding plugin - " << externalPluginDir.path() << ":" << externalPlugin; ++ externalPlugins << externalPlugin; + + Extractor extractor; +- ExternalExtractor *plugin = new ExternalExtractor(externalPlugin.fileName()); ++ auto pluginPath = externalPluginDir.absoluteFilePath(externalPlugin); ++ ExternalExtractor *plugin = new ExternalExtractor(pluginPath); + if (plugin && !plugin->mimetypes().isEmpty()) { + extractor.setExtractorPlugin(plugin); + extractor.setAutoDeletePlugin(Extractor::AutoDeletePlugin); + m_allExtractors.push_back(std::move(extractor)); + } + } ++ externalPlugins.clear(); + + for (Extractor& extractor : m_allExtractors) { + auto pluginProperties = extractor.extractorProperties(); +--- a/src/writercollection.cpp ++++ b/src/writercollection.cpp +@@ -68,9 +68,6 @@ void WriterCollectionPrivate::findWriters() + // For external plugins, we look into the directories. Those are executables and not C++ plugins. + const QStringList externalPluginEntryList = externalPluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + for (const QString& externalPlugin : externalPluginEntryList) { +- if (!QLibrary::isLibrary(externalPlugin)) { +- continue; +- } + if (externalPlugins.contains(externalPlugin)) { + continue; + } diff --git a/kde-frameworks/kfilemetadata/kfilemetadata-5.102.0.ebuild b/kde-frameworks/kfilemetadata/kfilemetadata-5.102.0.ebuild new file mode 100644 index 000000000000..d6e13e5386e3 --- /dev/null +++ b/kde-frameworks/kfilemetadata/kfilemetadata-5.102.0.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +PVCUT=$(ver_cut 1-2) +QTMIN=5.15.5 +inherit ecm frameworks.kde.org optfeature python-any-r1 + +DESCRIPTION="Library for extracting file metadata" + +LICENSE="LGPL-2+" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" +IUSE="epub exif ffmpeg mobi pdf taglib" + +RESTRICT="test" + +RDEPEND=" + >=dev-qt/qtxml-${QTMIN}:5 + =kde-frameworks/karchive-${PVCUT}*:5 + =kde-frameworks/kcoreaddons-${PVCUT}*:5 + =kde-frameworks/ki18n-${PVCUT}*:5 + epub? ( app-text/ebook-tools ) + exif? ( media-gfx/exiv2:= ) + ffmpeg? ( media-video/ffmpeg:0= ) + mobi? ( kde-apps/kdegraphics-mobipocket:5 ) + pdf? ( app-text/poppler[qt5] ) + taglib? ( media-libs/taglib ) +" +DEPEND="${RDEPEND} + kernel_linux? ( sys-apps/attr ) +" +BDEPEND="test? ( ${PYTHON_DEPS} )" + +PATCHES=( "${FILESDIR}/${P}-fix-loading-external-plugins.patch" ) # KDE-bug 463598 + +pkg_setup() { + use test && python-any-r1_pkg_setup + ecm_pkg_setup +} + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package epub EPub) + $(cmake_use_find_package exif LibExiv2) + $(cmake_use_find_package ffmpeg FFmpeg) + $(cmake_use_find_package mobi QMobipocket) + $(cmake_use_find_package pdf Poppler) + $(cmake_use_find_package taglib Taglib) + ) + + ecm_src_configure +} + +src_test() { + # FIXME: bug 644650, fails on tmpfs (but not for everyone) + local myctestargs=( -E "(usermetadatawritertest)" ) + ecm_src_test +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + optfeature "Microsoft Word/Powerpoint file indexing" app-text/catdoc + optfeature "Microsoft Excel file indexing" dev-libs/libxls + fi + ecm_pkg_postinst +} |