1 |
commit: 4a44b133f79c25e8f67691f592aa04004b4ecf60 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 1 09:37:49 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 1 09:39:04 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a44b133 |
7 |
|
8 |
kde-frameworks/kfilemetadata: Fix crashing over .spx binary files |
9 |
|
10 |
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=403902 |
11 |
Package-Manager: Portage-2.3.66, Repoman-2.3.12 |
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
|
14 |
...filemetadata-5.57.0-non-speex-files-crash.patch | 46 +++++++++++++++ |
15 |
.../kfilemetadata/kfilemetadata-5.57.0-r1.ebuild | 68 ++++++++++++++++++++++ |
16 |
2 files changed, 114 insertions(+) |
17 |
|
18 |
diff --git a/kde-frameworks/kfilemetadata/files/kfilemetadata-5.57.0-non-speex-files-crash.patch b/kde-frameworks/kfilemetadata/files/kfilemetadata-5.57.0-non-speex-files-crash.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..5664cf024b2 |
21 |
--- /dev/null |
22 |
+++ b/kde-frameworks/kfilemetadata/files/kfilemetadata-5.57.0-non-speex-files-crash.patch |
23 |
@@ -0,0 +1,46 @@ |
24 |
+From 61b1916c3e87c3b8f4fc3d1f1d19bf427b9247da Mon Sep 17 00:00:00 2001 |
25 |
+From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de> |
26 |
+Date: Tue, 30 Apr 2019 03:51:14 +0200 |
27 |
+Subject: [TagLibExtractor] Fix crash on invalid Speex files |
28 |
+ |
29 |
+Summary: |
30 |
+TagLib::Ogg::Speex::File::isValid() returns true even for invalid files, |
31 |
+but tag() only returns a valid XiphComment when the file is valid. |
32 |
+ |
33 |
+Other TagLib::Ogg::* classes properly clear the valid flag when |
34 |
+encountering files. |
35 |
+ |
36 |
+See https://github.com/taglib/taglib/issues/902 |
37 |
+ |
38 |
+BUG: 403902 |
39 |
+ |
40 |
+Reviewers: #baloo, #frameworks, ngraham, astippich |
41 |
+ |
42 |
+Reviewed By: #baloo, ngraham, astippich |
43 |
+ |
44 |
+Subscribers: kde-frameworks-devel |
45 |
+ |
46 |
+Tags: #frameworks, #baloo |
47 |
+ |
48 |
+Differential Revision: https://phabricator.kde.org/D20913 |
49 |
+--- |
50 |
+ src/extractors/taglibextractor.cpp | 4 +++- |
51 |
+ 1 file changed, 3 insertions(+), 1 deletion(-) |
52 |
+ |
53 |
+diff --git a/src/extractors/taglibextractor.cpp b/src/extractors/taglibextractor.cpp |
54 |
+index 1954cac..e355907 100644 |
55 |
+--- a/src/extractors/taglibextractor.cpp |
56 |
++++ b/src/extractors/taglibextractor.cpp |
57 |
+@@ -476,7 +476,9 @@ void TagLibExtractor::extract(ExtractionResult* result) |
58 |
+ } |
59 |
+ } else if (mimeType == QLatin1String("audio/speex") || mimeType == QLatin1String("audio/x-speex+ogg")) { |
60 |
+ TagLib::Ogg::Speex::File file(&stream, true); |
61 |
+- if (file.isValid()) { |
62 |
++ // Workaround for buggy taglib: |
63 |
++ // isValid() returns true for invalid files, but XiphComment* tag() returns a nullptr |
64 |
++ if (file.isValid() && file.tag()) { |
65 |
+ extractAudioProperties(&file, result); |
66 |
+ readGenericProperties(file.properties(), result); |
67 |
+ } |
68 |
+-- |
69 |
+cgit v1.1 |
70 |
|
71 |
diff --git a/kde-frameworks/kfilemetadata/kfilemetadata-5.57.0-r1.ebuild b/kde-frameworks/kfilemetadata/kfilemetadata-5.57.0-r1.ebuild |
72 |
new file mode 100644 |
73 |
index 00000000000..92679579c66 |
74 |
--- /dev/null |
75 |
+++ b/kde-frameworks/kfilemetadata/kfilemetadata-5.57.0-r1.ebuild |
76 |
@@ -0,0 +1,68 @@ |
77 |
+# Copyright 1999-2019 Gentoo Authors |
78 |
+# Distributed under the terms of the GNU General Public License v2 |
79 |
+ |
80 |
+EAPI=7 |
81 |
+ |
82 |
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} ) |
83 |
+inherit kde5 python-any-r1 |
84 |
+ |
85 |
+DESCRIPTION="Library for extracting file metadata" |
86 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
87 |
+IUSE="epub exif ffmpeg kernel_linux libav office pdf taglib" |
88 |
+ |
89 |
+BDEPEND=" |
90 |
+ test? ( ${PYTHON_DEPS} ) |
91 |
+" |
92 |
+RDEPEND=" |
93 |
+ $(add_frameworks_dep kcoreaddons) |
94 |
+ $(add_frameworks_dep ki18n) |
95 |
+ $(add_qt_dep qtxml) |
96 |
+ epub? ( app-text/ebook-tools ) |
97 |
+ exif? ( media-gfx/exiv2:= ) |
98 |
+ ffmpeg? ( |
99 |
+ libav? ( >=media-video/libav-12.2:= ) |
100 |
+ !libav? ( media-video/ffmpeg:0= ) |
101 |
+ ) |
102 |
+ office? ( $(add_frameworks_dep karchive) ) |
103 |
+ pdf? ( app-text/poppler[qt5] ) |
104 |
+ taglib? ( media-libs/taglib ) |
105 |
+" |
106 |
+DEPEND="${RDEPEND} |
107 |
+ kernel_linux? ( sys-apps/attr ) |
108 |
+" |
109 |
+ |
110 |
+PATCHES=( "${FILESDIR}/${P}-non-speex-files-crash.patch" ) |
111 |
+ |
112 |
+pkg_setup() { |
113 |
+ use test && python-any-r1_pkg_setup |
114 |
+ kde5_pkg_setup |
115 |
+} |
116 |
+ |
117 |
+src_configure() { |
118 |
+ local mycmakeargs=( |
119 |
+ $(cmake-utils_use_find_package epub EPub) |
120 |
+ $(cmake-utils_use_find_package exif LibExiv2) |
121 |
+ $(cmake-utils_use_find_package ffmpeg FFmpeg) |
122 |
+ $(cmake-utils_use_find_package office KF5Archive) |
123 |
+ $(cmake-utils_use_find_package pdf Poppler) |
124 |
+ $(cmake-utils_use_find_package taglib Taglib) |
125 |
+ ) |
126 |
+ |
127 |
+ kde5_src_configure |
128 |
+} |
129 |
+ |
130 |
+src_test() { |
131 |
+ # FIXME: bug 644650, fails on tmpfs (but not for everyone) |
132 |
+ local myctestargs=( -E "(usermetadatawritertest)" ) |
133 |
+ kde5_src_test |
134 |
+} |
135 |
+ |
136 |
+pkg_postinst() { |
137 |
+ kde5_pkg_postinst |
138 |
+ |
139 |
+ if ! has_version app-text/catdoc || ! has_version dev-libs/libxls; then |
140 |
+ elog "To get additional features, optional runtime dependencies may be installed:" |
141 |
+ elog "app-text/catdoc - indexing of Microsoft Word or Powerpoint files" |
142 |
+ elog "dev-libs/libxls - indexing of Microsoft Excel files" |
143 |
+ fi |
144 |
+} |