1 |
commit: 8314b692cec95b14220ce96cf8f02f0e7b58c736 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 26 22:13:06 2018 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 27 07:48:49 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8314b692 |
7 |
|
8 |
kde-frameworks/kio: Restore sendfile support |
9 |
|
10 |
Backport from 5.53.0, fixes KF5-porting regression. |
11 |
|
12 |
Package-Manager: Portage-2.3.52, Repoman-2.3.12 |
13 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
14 |
|
15 |
kde-frameworks/kio/files/kio-5.52.0-sendfile.patch | 109 +++++++++++++++++++++ |
16 |
kde-frameworks/kio/kio-5.52.0-r1.ebuild | 82 ++++++++++++++++ |
17 |
2 files changed, 191 insertions(+) |
18 |
|
19 |
diff --git a/kde-frameworks/kio/files/kio-5.52.0-sendfile.patch b/kde-frameworks/kio/files/kio-5.52.0-sendfile.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..d02b8f50b19 |
22 |
--- /dev/null |
23 |
+++ b/kde-frameworks/kio/files/kio-5.52.0-sendfile.patch |
24 |
@@ -0,0 +1,109 @@ |
25 |
+From 31980ecd1cacac9bd75ce35e3048946e1c27e1a0 Mon Sep 17 00:00:00 2001 |
26 |
+From: David Edmundson <kde@×××××××××××××××××.uk> |
27 |
+Date: Wed, 21 Nov 2018 15:30:48 +0000 |
28 |
+Subject: Restore sendfile support |
29 |
+ |
30 |
+Summary: |
31 |
+Somehow in the kdelibs -> framework port the cmake checks for |
32 |
+HAVE_SENDFILE got lost. |
33 |
+ |
34 |
+That re-enables a massive optimisation in the file kioslave that has all the code existing and used in kdelibs4 that we're currently missing. |
35 |
+ |
36 |
+Test Plan: |
37 |
+Put a compilation fail inside the #ifdef, before it wasn't triggered, now it is. |
38 |
+ |
39 |
+Ran unit tests |
40 |
+Moved a file in dolphin |
41 |
+ |
42 |
+Reviewers: dfaure |
43 |
+ |
44 |
+Reviewed By: dfaure |
45 |
+ |
46 |
+Subscribers: ngraham, apol, kde-frameworks-devel |
47 |
+ |
48 |
+Tags: #frameworks |
49 |
+ |
50 |
+Differential Revision: https://phabricator.kde.org/D17048 |
51 |
+--- |
52 |
+ src/ioslaves/file/ConfigureChecks.cmake | 1 + |
53 |
+ src/ioslaves/file/config-kioslave-file.h.cmake | 2 ++ |
54 |
+ src/ioslaves/file/file_unix.cpp | 2 +- |
55 |
+ 3 files changed, 4 insertions(+), 1 deletion(-) |
56 |
+ |
57 |
+diff --git a/src/ioslaves/file/ConfigureChecks.cmake b/src/ioslaves/file/ConfigureChecks.cmake |
58 |
+index 5a83d1b..39fcd6f 100644 |
59 |
+--- a/src/ioslaves/file/ConfigureChecks.cmake |
60 |
++++ b/src/ioslaves/file/ConfigureChecks.cmake |
61 |
+@@ -7,6 +7,7 @@ include(CheckStructHasMember) |
62 |
+ check_include_files(sys/time.h HAVE_SYS_TIME_H) |
63 |
+ check_include_files(string.h HAVE_STRING_H) |
64 |
+ check_include_files(limits.h HAVE_LIMITS_H) |
65 |
++check_function_exists(sendfile HAVE_SENDFILE) |
66 |
+ |
67 |
+ check_function_exists(posix_fadvise HAVE_FADVISE) # kioslave |
68 |
+ |
69 |
+diff --git a/src/ioslaves/file/config-kioslave-file.h.cmake b/src/ioslaves/file/config-kioslave-file.h.cmake |
70 |
+index e47fdb2..3df7ebd 100644 |
71 |
+--- a/src/ioslaves/file/config-kioslave-file.h.cmake |
72 |
++++ b/src/ioslaves/file/config-kioslave-file.h.cmake |
73 |
+@@ -13,3 +13,5 @@ |
74 |
+ /* Defined if system has extended file attributes support. */ |
75 |
+ #cmakedefine01 HAVE_SYS_XATTR_H |
76 |
+ |
77 |
++/* Defined if system has the sendfile function. */ |
78 |
++#cmakedefine01 HAVE_SENDFILE |
79 |
+diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp |
80 |
+index 817cce8..34422e5 100644 |
81 |
+--- a/src/ioslaves/file/file_unix.cpp |
82 |
++++ b/src/ioslaves/file/file_unix.cpp |
83 |
+@@ -49,7 +49,7 @@ |
84 |
+ #include "fdreceiver.h" |
85 |
+ |
86 |
+ //sendfile has different semantics in different platforms |
87 |
+-#if defined HAVE_SENDFILE && defined Q_OS_LINUX |
88 |
++#if HAVE_SENDFILE && defined Q_OS_LINUX |
89 |
+ #define USE_SENDFILE 1 |
90 |
+ #endif |
91 |
+ |
92 |
+-- |
93 |
+cgit v0.11.2 |
94 |
+From 8f926e4596221b11e62c7ac80bb5864d3d8cf4f6 Mon Sep 17 00:00:00 2001 |
95 |
+From: David Edmundson <kde@×××××××××××××××××.uk> |
96 |
+Date: Wed, 21 Nov 2018 15:30:53 +0000 |
97 |
+Subject: Use correct variable type for returned value from read/sendfile |
98 |
+ |
99 |
+Summary: |
100 |
+n stores the read/transferred bytes. This returns a ssize_t. |
101 |
+We were casting to an int, which theoretically is a loss of data. |
102 |
+ |
103 |
+In practice it isn't an issue as we only read a max of MAX_IPC_SIZE at a |
104 |
+time, which would fit in an int. |
105 |
+ |
106 |
+Reviewers: apol |
107 |
+ |
108 |
+Reviewed By: apol |
109 |
+ |
110 |
+Subscribers: kde-frameworks-devel |
111 |
+ |
112 |
+Tags: #frameworks |
113 |
+ |
114 |
+Differential Revision: https://phabricator.kde.org/D17051 |
115 |
+--- |
116 |
+ src/ioslaves/file/file_unix.cpp | 2 +- |
117 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
118 |
+ |
119 |
+diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp |
120 |
+index 34422e5..7ed0ae8 100644 |
121 |
+--- a/src/ioslaves/file/file_unix.cpp |
122 |
++++ b/src/ioslaves/file/file_unix.cpp |
123 |
+@@ -251,7 +251,7 @@ void FileProtocol::copy(const QUrl &srcUrl, const QUrl &destUrl, |
124 |
+ |
125 |
+ KIO::filesize_t processed_size = 0; |
126 |
+ char buffer[ MAX_IPC_SIZE ]; |
127 |
+- int n; |
128 |
++ ssize_t n = 0; |
129 |
+ #ifdef USE_SENDFILE |
130 |
+ bool use_sendfile = buff_src.st_size < 0x7FFFFFFF; |
131 |
+ #endif |
132 |
+-- |
133 |
+cgit v0.11.2 |
134 |
|
135 |
diff --git a/kde-frameworks/kio/kio-5.52.0-r1.ebuild b/kde-frameworks/kio/kio-5.52.0-r1.ebuild |
136 |
new file mode 100644 |
137 |
index 00000000000..7a9357c5fed |
138 |
--- /dev/null |
139 |
+++ b/kde-frameworks/kio/kio-5.52.0-r1.ebuild |
140 |
@@ -0,0 +1,82 @@ |
141 |
+# Copyright 1999-2018 Gentoo Authors |
142 |
+# Distributed under the terms of the GNU General Public License v2 |
143 |
+ |
144 |
+EAPI=6 |
145 |
+ |
146 |
+KDE_TEST="forceoptional" |
147 |
+VIRTUALX_REQUIRED="test" |
148 |
+inherit kde5 |
149 |
+ |
150 |
+DESCRIPTION="Framework providing transparent file and data management" |
151 |
+LICENSE="LGPL-2+" |
152 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
153 |
+IUSE="acl +handbook kerberos +kwallet X" |
154 |
+ |
155 |
+RDEPEND=" |
156 |
+ $(add_frameworks_dep kauth) |
157 |
+ $(add_frameworks_dep karchive) |
158 |
+ $(add_frameworks_dep kbookmarks) |
159 |
+ $(add_frameworks_dep kcodecs) |
160 |
+ $(add_frameworks_dep kcompletion) |
161 |
+ $(add_frameworks_dep kconfig) |
162 |
+ $(add_frameworks_dep kconfigwidgets) |
163 |
+ $(add_frameworks_dep kcoreaddons) |
164 |
+ $(add_frameworks_dep kcrash) |
165 |
+ $(add_frameworks_dep kdbusaddons) |
166 |
+ $(add_frameworks_dep ki18n) |
167 |
+ $(add_frameworks_dep kiconthemes) |
168 |
+ $(add_frameworks_dep kitemviews) |
169 |
+ $(add_frameworks_dep kjobwidgets) |
170 |
+ $(add_frameworks_dep knotifications) |
171 |
+ $(add_frameworks_dep kservice) |
172 |
+ $(add_frameworks_dep ktextwidgets) |
173 |
+ $(add_frameworks_dep kwidgetsaddons) |
174 |
+ $(add_frameworks_dep kwindowsystem) |
175 |
+ $(add_frameworks_dep kxmlgui) |
176 |
+ $(add_frameworks_dep solid) |
177 |
+ $(add_qt_dep qtdbus) |
178 |
+ $(add_qt_dep qtgui) |
179 |
+ $(add_qt_dep qtnetwork 'ssl') |
180 |
+ $(add_qt_dep qtscript) |
181 |
+ $(add_qt_dep qtwidgets) |
182 |
+ $(add_qt_dep qtxml) |
183 |
+ dev-libs/libxml2 |
184 |
+ dev-libs/libxslt |
185 |
+ acl? ( |
186 |
+ sys-apps/attr |
187 |
+ virtual/acl |
188 |
+ ) |
189 |
+ handbook? ( $(add_frameworks_dep kdoctools) ) |
190 |
+ kerberos? ( virtual/krb5 ) |
191 |
+ kwallet? ( $(add_frameworks_dep kwallet) ) |
192 |
+ X? ( $(add_qt_dep qtx11extras) ) |
193 |
+" |
194 |
+DEPEND="${RDEPEND} |
195 |
+ $(add_qt_dep qtconcurrent) |
196 |
+ test? ( sys-libs/zlib ) |
197 |
+ X? ( |
198 |
+ x11-base/xorg-proto |
199 |
+ x11-libs/libX11 |
200 |
+ x11-libs/libXrender |
201 |
+ ) |
202 |
+" |
203 |
+PDEPEND=" |
204 |
+ $(add_frameworks_dep kded) |
205 |
+" |
206 |
+ |
207 |
+# tests hang |
208 |
+RESTRICT+=" test" |
209 |
+ |
210 |
+PATCHES=( "${FILESDIR}/${P}-sendfile.patch" ) |
211 |
+ |
212 |
+src_configure() { |
213 |
+ local mycmakeargs=( |
214 |
+ $(cmake-utils_use_find_package acl ACL) |
215 |
+ $(cmake-utils_use_find_package handbook KF5DocTools) |
216 |
+ $(cmake-utils_use_find_package kerberos GSSAPI) |
217 |
+ $(cmake-utils_use_find_package kwallet KF5Wallet) |
218 |
+ $(cmake-utils_use_find_package X X11) |
219 |
+ ) |
220 |
+ |
221 |
+ kde5_src_configure |
222 |
+} |