1 |
commit: 87c6dd0ad1334280d0269be108dea4db30c6e8a4 |
2 |
Author: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net> |
3 |
AuthorDate: Sat Jul 4 22:12:28 2015 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 4 22:47:24 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=87c6dd0a |
7 |
|
8 |
dev-qt/qtcore: Fix socklen_t detection. Bug #551640 |
9 |
|
10 |
dev-qt/qtcore/Manifest | 11 + |
11 |
...isallow-deep-or-widely-nested-entity-refs.patch | 114 ++++++ |
12 |
.../CVE-2013-4549-02-fully-expand-entities.patch | 124 ++++++ |
13 |
...ExcludeSocketNotifiers-in-glib-event-loop.patch | 81 ++++ |
14 |
.../qtcore-4.8.5-moc-boost-lexical-cast.patch | 12 + |
15 |
.../qtcore-4.8.5-qeventdispatcher-recursive.patch | 94 +++++ |
16 |
.../files/qtcore-4.8.6-QNAM-corruptions-fix.patch | 431 +++++++++++++++++++++ |
17 |
.../files/qtcore-4.8.7-fix-socklent-for-musl.patch | 119 ++++++ |
18 |
dev-qt/qtcore/metadata.xml | 16 + |
19 |
dev-qt/qtcore/qtcore-4.8.7-r99.ebuild | 90 +++++ |
20 |
10 files changed, 1092 insertions(+) |
21 |
|
22 |
diff --git a/dev-qt/qtcore/Manifest b/dev-qt/qtcore/Manifest |
23 |
new file mode 100644 |
24 |
index 0000000..4c80db8 |
25 |
--- /dev/null |
26 |
+++ b/dev-qt/qtcore/Manifest |
27 |
@@ -0,0 +1,11 @@ |
28 |
+AUX CVE-2013-4549-01-disallow-deep-or-widely-nested-entity-refs.patch 4531 SHA256 fd6e59635ea7bc86fdc36333ecd77609ae5cdc52c3a388c3b0088887d9a21b72 SHA512 b81810d62e8652f91b787285e8208b42d723e89aef248aeca24f02cd84b4a098c82571ece7c8af9c25c0535bde61ee376b6c24992f55fbaef2dd77f54f14ef1a WHIRLPOOL f7e6d005c157314eba3501bb9fdcecdb1f0b317880d659ac42e9b17a79ba98892c6ad9b49651a81d2a8c5c77d9e6ab9b7953422435543b1e38f1eeef0865dbd3 |
29 |
+AUX CVE-2013-4549-02-fully-expand-entities.patch 6117 SHA256 848dbcd78c2ae0a3f6acca07b48067c453f721adfbe4dcdc90ca8267eedbc065 SHA512 1564fc1e299704c7f51015fdf3213e3c85460d2950821f53f94bbf98c80275e845aa8804250081df9db8172ca26fde11070e21ce18b8ee17961689ceb96daac9 WHIRLPOOL ccf1494fd0b243aed5149d6f1ebaadb5bfefff4698a95fae6d006247a9daee493e8e4c567a2bc930efc7b22c27761207afd1c8fe8f104c5a3fed491a669d14e8 |
30 |
+AUX qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch 3410 SHA256 9dbb9be4dfefc00711058b99fe2425bb43c811a1b36a6f046336e13c666d40ea SHA512 6770959ba01756d6a3fa9e03edd5f6c1df0d8625f4add65f7fef55a93b7b52c555a0ce749984938fb7ab905c2e0875cec0cb5d07f45c1b447fbc9e2d0ec678bb WHIRLPOOL d06e33e4d6545b99d930212f6ad767a6c59cb241cb0b28fe3401853700c26c9fd9a5dc0eb5cfaef62ed8f7874eccf906c7c39c469c6725e9db3836c8982422d8 |
31 |
+AUX qtcore-4.8.5-moc-boost-lexical-cast.patch 584 SHA256 dadd3eab516ee26f1c19f17dbcb7be46e7c9efba49924fa1d53cc0176491736a SHA512 ed2cc3d36ac8576cee42d1586b99913ce060a47e72c82890e7b5fe4fc500e857693f2348f4446ce7dfbd1bbdf6e51b99b57f2fc09d6c15f9075f10c4b5459fa6 WHIRLPOOL d4ee64605ad9dacd371519a9c08582c25ea891480c79795822cfe74e6bafb332d558dca5d024c6f369e3674fde5a89a15a7d79042093295ac9d0a0d516493583 |
32 |
+AUX qtcore-4.8.5-qeventdispatcher-recursive.patch 4017 SHA256 5db36cbb0686b8a503941779c821febc4a0330dc260e51d603f7aa1e4d8860ad SHA512 bd63961bcb695beebe8686142b84bff7702db4d85d737f5c2da927252b931700d03602f80048223cbbb05d85a5ddb9cb818321d756577f84843690b318f0c413 WHIRLPOOL f981bf3c3d1a62b486788433cabb2880b7f361ccdf99e502fb595608195168d72ba14018c93273f2726c60bae61a44cba3244026009823e832109a1f7418e773 |
33 |
+AUX qtcore-4.8.6-QNAM-corruptions-fix.patch 17586 SHA256 5309c0f1ed0fc54799537b6d0a51b9682f52b4b40cc76e6fa71afc7273120e40 SHA512 4367974513b230d0395d0d0ebff5007255c257126309b614c37e8297981b833b397792fe9dede1960e0027a87d3fbc5eb252253a7ed73f4f9383531ea39cc874 WHIRLPOOL 8eded4f95d00f2ce572cf1956745d5a06e07f54a6ed6e67578914c0d2c9be63994cbf9177212d25c3c2678bf7328b2364b5977ebb8e8d7b8e4ad79009be6a7ae |
34 |
+AUX qtcore-4.8.7-fix-socklent-for-musl.patch 3982 SHA256 2d3065b3a372ae03a58ee76a4a24e676abc36a16f5c564b4b25c537d2520700d SHA512 d578fa49270ae8d18ff4de3a15b6f4c485503c1de61e9732e6e55d0bd3db5a0c2e68d37327e500b71a85efe05b187f435d2e4c62f23481c73a9d593803ca345c WHIRLPOOL e95016f372dc7cfff32609b838774a339320073fde9c90aa92b0ee8003bbf740a545cb500518bdd611553016bc8d9f21ea060b97742478105474561d6f3ae3d4 |
35 |
+DIST qt-everywhere-opensource-src-4.8.7.tar.gz 241075567 SHA256 e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0 SHA512 f9f81a2e7205e1fd05c8d923dc73244f29aa33f951fa6b7c5c8193449328b37084796b9b71ad0c317e4e6fd00017c10ea5d67b1b2032551cde00548522218125 WHIRLPOOL ad8f01172f5bdb3a3a69fe7b03862c4c411bc8d95211053ad66ed1d60a3c0577d073d1075a1e0a80b25d9b2721addda55a2967e6ccf5e194cec8d08770ac5fc2 |
36 |
+EBUILD qtcore-4.8.7-r99.ebuild 2987 SHA256 f0499c2b754b3a9d8635f8f27883fb78edc07452a594a03e82491e6611ec0f89 SHA512 78d6b370f0039cd0905926109bee181f24d8c006b08f6d606e40ac89120a8fa0012e8457dea68ab2aa174bae2484e6f69d36a7f75cd171bbb073d881dc0fb189 WHIRLPOOL 4664e9cfe1e3d0e962328f70b6f75c244cbdac1711f57d6142fb8fa3681002c7d45cdd58a10a101ab4ec8428ed30e00d8123d23db46fb0bc6e6e7af172b31067 |
37 |
+MISC ChangeLog 39458 SHA256 538ab612e6a4236bdc8c54ead41013e9900532150871c00704179a997ebb102f SHA512 858615bf43caf12eeca50b45c1b61696291762f43bd96cd8949ba6d263a6c52e6e527289c4abc22d988e2f41420de52a919ab28bb889f6cc7c21c4e2a82a6a68 WHIRLPOOL 7355b16095460360dba36c8cfd0d917c34192013d1f43136d70f3f7547f406eab125815bc4cfc0b4d459eda70dc8fc275afcdaee642b1834b5f4461bca6ba543 |
38 |
+MISC metadata.xml 633 SHA256 b8a9342f8b5306a23b156316bb8f6cbf6efc162d678d41a8e13e46916f12cf7d SHA512 3adcde8bf745bf21b85c8dd7b4b9d420d427053ed7fcbc110057aed87ce3a786e72d942c11d81de87bda04c5e2484ff410641ea147a2748867e969da828e6957 WHIRLPOOL 30fce13f3de4d40391ca081df75d94b6e88e352d0c0b0c10b2e2942462e0df6491b1bd15074dce27bf6cebf7f9d0381ca17cf22cfc982e06bfae4e2d278fc1ef |
39 |
|
40 |
diff --git a/dev-qt/qtcore/files/CVE-2013-4549-01-disallow-deep-or-widely-nested-entity-refs.patch b/dev-qt/qtcore/files/CVE-2013-4549-01-disallow-deep-or-widely-nested-entity-refs.patch |
41 |
new file mode 100644 |
42 |
index 0000000..c472d42 |
43 |
--- /dev/null |
44 |
+++ b/dev-qt/qtcore/files/CVE-2013-4549-01-disallow-deep-or-widely-nested-entity-refs.patch |
45 |
@@ -0,0 +1,114 @@ |
46 |
+From 512a1ce0698d370c313bb561bbf078935fa0342e Mon Sep 17 00:00:00 2001 |
47 |
+From: Mitch Curtis <mitch.curtis@×××××.com> |
48 |
+Date: Thu, 7 Nov 2013 09:36:29 +0100 |
49 |
+Subject: Disallow deep or widely nested entity references. |
50 |
+ |
51 |
+Nested references with a depth of 2 or greater will fail. References |
52 |
+that partially expand to greater than 1024 characters will also fail. |
53 |
+ |
54 |
+This is a backport of 46a8885ae486e238a39efa5119c2714f328b08e4. |
55 |
+ |
56 |
+Change-Id: I0c2e1fa13d6ccb5f88641dae2ed3f28bfdeaf609 |
57 |
+Reviewed-by: Richard J. Moore <rich@×××.org> |
58 |
+Reviewed-by: Lars Knoll <lars.knoll@×××××.com> |
59 |
+ |
60 |
+diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp |
61 |
+index a1777c5..3904632 100644 |
62 |
+--- a/src/xml/sax/qxml.cpp |
63 |
++++ b/src/xml/sax/qxml.cpp |
64 |
+@@ -424,6 +424,10 @@ private: |
65 |
+ int stringValueLen; |
66 |
+ QString emptyStr; |
67 |
+ |
68 |
++ // The limit to the amount of times the DTD parsing functions can be called |
69 |
++ // for the DTD currently being parsed. |
70 |
++ int dtdRecursionLimit; |
71 |
++ |
72 |
+ const QString &string(); |
73 |
+ void stringClear(); |
74 |
+ void stringAddC(QChar); |
75 |
+@@ -492,6 +496,7 @@ private: |
76 |
+ void unexpectedEof(ParseFunction where, int state); |
77 |
+ void parseFailed(ParseFunction where, int state); |
78 |
+ void pushParseState(ParseFunction function, int state); |
79 |
++ bool isPartiallyExpandedEntityValueTooLarge(QString *errorMessage); |
80 |
+ |
81 |
+ Q_DECLARE_PUBLIC(QXmlSimpleReader) |
82 |
+ QXmlSimpleReader *q_ptr; |
83 |
+@@ -2759,6 +2764,7 @@ QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader) |
84 |
+ useNamespacePrefixes = false; |
85 |
+ reportWhitespaceCharData = true; |
86 |
+ reportEntities = false; |
87 |
++ dtdRecursionLimit = 2; |
88 |
+ } |
89 |
+ |
90 |
+ QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() |
91 |
+@@ -5018,6 +5024,11 @@ bool QXmlSimpleReaderPrivate::parseDoctype() |
92 |
+ } |
93 |
+ break; |
94 |
+ case Mup: |
95 |
++ if (dtdRecursionLimit > 0 && parameterEntities.size() > dtdRecursionLimit) { |
96 |
++ reportParseError(QString::fromLatin1( |
97 |
++ "DTD parsing exceeded recursion limit of %1.").arg(dtdRecursionLimit)); |
98 |
++ return false; |
99 |
++ } |
100 |
+ if (!parseMarkupdecl()) { |
101 |
+ parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); |
102 |
+ return false; |
103 |
+@@ -6627,6 +6638,37 @@ bool QXmlSimpleReaderPrivate::parseChoiceSeq() |
104 |
+ return false; |
105 |
+ } |
106 |
+ |
107 |
++bool QXmlSimpleReaderPrivate::isPartiallyExpandedEntityValueTooLarge(QString *errorMessage) |
108 |
++{ |
109 |
++ const QString value = string(); |
110 |
++ QMap<QString, int> referencedEntityCounts; |
111 |
++ foreach (QString entityName, entities.keys()) { |
112 |
++ for (int i = 0; i < value.size() && i != -1; ) { |
113 |
++ i = value.indexOf(entityName, i); |
114 |
++ if (i != -1) { |
115 |
++ // The entityName we're currently trying to find |
116 |
++ // was matched in this string; increase our count. |
117 |
++ ++referencedEntityCounts[entityName]; |
118 |
++ i += entityName.size(); |
119 |
++ } |
120 |
++ } |
121 |
++ } |
122 |
++ |
123 |
++ foreach (QString entityName, referencedEntityCounts.keys()) { |
124 |
++ const int timesReferenced = referencedEntityCounts[entityName]; |
125 |
++ const QString entityValue = entities[entityName]; |
126 |
++ if (entityValue.size() * timesReferenced > 1024) { |
127 |
++ if (errorMessage) { |
128 |
++ *errorMessage = QString::fromLatin1("The XML entity \"%1\"" |
129 |
++ "expands too a string that is too large to process when " |
130 |
++ "referencing \"%2\" %3 times.").arg(entityName).arg(entityName).arg(timesReferenced); |
131 |
++ } |
132 |
++ return true; |
133 |
++ } |
134 |
++ } |
135 |
++ return false; |
136 |
++} |
137 |
++ |
138 |
+ /* |
139 |
+ Parse a EntityDecl [70]. |
140 |
+ |
141 |
+@@ -6721,6 +6763,15 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl() |
142 |
+ switch (state) { |
143 |
+ case EValue: |
144 |
+ if ( !entityExist(name())) { |
145 |
++ QString errorMessage; |
146 |
++ if (isPartiallyExpandedEntityValueTooLarge(&errorMessage)) { |
147 |
++ // The entity at entityName is entityValue.size() characters |
148 |
++ // long in its unexpanded form, and was mentioned timesReferenced times, |
149 |
++ // resulting in a string that would be greater than 1024 characters. |
150 |
++ reportParseError(errorMessage); |
151 |
++ return false; |
152 |
++ } |
153 |
++ |
154 |
+ entities.insert(name(), string()); |
155 |
+ if (declHnd) { |
156 |
+ if (!declHnd->internalEntityDecl(name(), string())) { |
157 |
+-- |
158 |
+1.8.5.2 |
159 |
+ |
160 |
|
161 |
diff --git a/dev-qt/qtcore/files/CVE-2013-4549-02-fully-expand-entities.patch b/dev-qt/qtcore/files/CVE-2013-4549-02-fully-expand-entities.patch |
162 |
new file mode 100644 |
163 |
index 0000000..03ef64f |
164 |
--- /dev/null |
165 |
+++ b/dev-qt/qtcore/files/CVE-2013-4549-02-fully-expand-entities.patch |
166 |
@@ -0,0 +1,124 @@ |
167 |
+From cecceb0cdd87482124a73ecf537f3445d68be13e Mon Sep 17 00:00:00 2001 |
168 |
+From: Mitch Curtis <mitch.curtis@×××××.com> |
169 |
+Date: Tue, 12 Nov 2013 13:44:56 +0100 |
170 |
+Subject: Fully expand entities to ensure deep or widely nested ones fail |
171 |
+ parsing |
172 |
+ |
173 |
+With 512a1ce0698d370c313bb561bbf078935fa0342e, we failed when parsing |
174 |
+entities whose partially expanded size was greater than 1024 |
175 |
+characters. That was not enough, so now we fully expand all entities. |
176 |
+ |
177 |
+This is a backport of f1053d94f59f053ce4acad9320df14f1fbe4faac. |
178 |
+ |
179 |
+Change-Id: I41dd6f4525c63e82fd320a22d19248169627f7e0 |
180 |
+Reviewed-by: Richard J. Moore <rich@×××.org> |
181 |
+ |
182 |
+diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp |
183 |
+index 3904632..befa801 100644 |
184 |
+--- a/src/xml/sax/qxml.cpp |
185 |
++++ b/src/xml/sax/qxml.cpp |
186 |
+@@ -426,7 +426,9 @@ private: |
187 |
+ |
188 |
+ // The limit to the amount of times the DTD parsing functions can be called |
189 |
+ // for the DTD currently being parsed. |
190 |
+- int dtdRecursionLimit; |
191 |
++ static const int dtdRecursionLimit = 2; |
192 |
++ // The maximum amount of characters an entity value may contain, after expansion. |
193 |
++ static const int entityCharacterLimit = 1024; |
194 |
+ |
195 |
+ const QString &string(); |
196 |
+ void stringClear(); |
197 |
+@@ -496,7 +498,7 @@ private: |
198 |
+ void unexpectedEof(ParseFunction where, int state); |
199 |
+ void parseFailed(ParseFunction where, int state); |
200 |
+ void pushParseState(ParseFunction function, int state); |
201 |
+- bool isPartiallyExpandedEntityValueTooLarge(QString *errorMessage); |
202 |
++ bool isExpandedEntityValueTooLarge(QString *errorMessage); |
203 |
+ |
204 |
+ Q_DECLARE_PUBLIC(QXmlSimpleReader) |
205 |
+ QXmlSimpleReader *q_ptr; |
206 |
+@@ -2764,7 +2766,6 @@ QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader) |
207 |
+ useNamespacePrefixes = false; |
208 |
+ reportWhitespaceCharData = true; |
209 |
+ reportEntities = false; |
210 |
+- dtdRecursionLimit = 2; |
211 |
+ } |
212 |
+ |
213 |
+ QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() |
214 |
+@@ -6638,30 +6639,43 @@ bool QXmlSimpleReaderPrivate::parseChoiceSeq() |
215 |
+ return false; |
216 |
+ } |
217 |
+ |
218 |
+-bool QXmlSimpleReaderPrivate::isPartiallyExpandedEntityValueTooLarge(QString *errorMessage) |
219 |
++bool QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(QString *errorMessage) |
220 |
+ { |
221 |
+- const QString value = string(); |
222 |
+- QMap<QString, int> referencedEntityCounts; |
223 |
+- foreach (QString entityName, entities.keys()) { |
224 |
+- for (int i = 0; i < value.size() && i != -1; ) { |
225 |
+- i = value.indexOf(entityName, i); |
226 |
+- if (i != -1) { |
227 |
+- // The entityName we're currently trying to find |
228 |
+- // was matched in this string; increase our count. |
229 |
+- ++referencedEntityCounts[entityName]; |
230 |
+- i += entityName.size(); |
231 |
++ QMap<QString, int> literalEntitySizes; |
232 |
++ // The entity at (QMap<QString,) referenced the entities at (QMap<QString,) (int>) times. |
233 |
++ QMap<QString, QMap<QString, int> > referencesToOtherEntities; |
234 |
++ QMap<QString, int> expandedSizes; |
235 |
++ |
236 |
++ // For every entity, check how many times all entity names were referenced in its value. |
237 |
++ foreach (QString toSearch, entities.keys()) { |
238 |
++ // The amount of characters that weren't entity names, but literals, like 'X'. |
239 |
++ QString leftOvers = entities.value(toSearch); |
240 |
++ // How many times was entityName referenced by toSearch? |
241 |
++ foreach (QString entityName, entities.keys()) { |
242 |
++ for (int i = 0; i < leftOvers.size() && i != -1; ) { |
243 |
++ i = leftOvers.indexOf(QString::fromLatin1("&%1;").arg(entityName), i); |
244 |
++ if (i != -1) { |
245 |
++ leftOvers.remove(i, entityName.size() + 2); |
246 |
++ // The entityName we're currently trying to find was matched in this string; increase our count. |
247 |
++ ++referencesToOtherEntities[toSearch][entityName]; |
248 |
++ } |
249 |
+ } |
250 |
+ } |
251 |
++ literalEntitySizes[toSearch] = leftOvers.size(); |
252 |
+ } |
253 |
+ |
254 |
+- foreach (QString entityName, referencedEntityCounts.keys()) { |
255 |
+- const int timesReferenced = referencedEntityCounts[entityName]; |
256 |
+- const QString entityValue = entities[entityName]; |
257 |
+- if (entityValue.size() * timesReferenced > 1024) { |
258 |
++ foreach (QString entity, referencesToOtherEntities.keys()) { |
259 |
++ expandedSizes[entity] = literalEntitySizes[entity]; |
260 |
++ foreach (QString referenceTo, referencesToOtherEntities.value(entity).keys()) { |
261 |
++ const int references = referencesToOtherEntities.value(entity).value(referenceTo); |
262 |
++ // The total size of an entity's value is the expanded size of all of its referenced entities, plus its literal size. |
263 |
++ expandedSizes[entity] += expandedSizes[referenceTo] * references + literalEntitySizes[referenceTo] * references; |
264 |
++ } |
265 |
++ |
266 |
++ if (expandedSizes[entity] > entityCharacterLimit) { |
267 |
+ if (errorMessage) { |
268 |
+- *errorMessage = QString::fromLatin1("The XML entity \"%1\"" |
269 |
+- "expands too a string that is too large to process when " |
270 |
+- "referencing \"%2\" %3 times.").arg(entityName).arg(entityName).arg(timesReferenced); |
271 |
++ *errorMessage = QString::fromLatin1("The XML entity \"%1\" expands too a string that is too large to process (%2 characters > %3)."); |
272 |
++ *errorMessage = (*errorMessage).arg(entity).arg(expandedSizes[entity]).arg(entityCharacterLimit); |
273 |
+ } |
274 |
+ return true; |
275 |
+ } |
276 |
+@@ -6764,10 +6778,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl() |
277 |
+ case EValue: |
278 |
+ if ( !entityExist(name())) { |
279 |
+ QString errorMessage; |
280 |
+- if (isPartiallyExpandedEntityValueTooLarge(&errorMessage)) { |
281 |
+- // The entity at entityName is entityValue.size() characters |
282 |
+- // long in its unexpanded form, and was mentioned timesReferenced times, |
283 |
+- // resulting in a string that would be greater than 1024 characters. |
284 |
++ if (isExpandedEntityValueTooLarge(&errorMessage)) { |
285 |
+ reportParseError(errorMessage); |
286 |
+ return false; |
287 |
+ } |
288 |
+-- |
289 |
+1.8.5.2 |
290 |
+ |
291 |
|
292 |
diff --git a/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch b/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch |
293 |
new file mode 100644 |
294 |
index 0000000..0fcc1fa |
295 |
--- /dev/null |
296 |
+++ b/dev-qt/qtcore/files/qtcore-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch |
297 |
@@ -0,0 +1,81 @@ |
298 |
+From 267feb2de49eed0823ca0c29f1cd5238537c7116 Mon Sep 17 00:00:00 2001 |
299 |
+From: Jan-Marek Glogowski <glogow@×××××××.de> |
300 |
+Date: Thu, 6 Mar 2014 18:44:43 +0100 |
301 |
+Subject: Honor ExcludeSocketNotifiers in glib event loop |
302 |
+ |
303 |
+Implements QEventLoop::ExcludeSocketNotifiers in the same way |
304 |
+QEventLoop::X11ExcludeTimers is already implemented for the glib |
305 |
+event loop. |
306 |
+ |
307 |
+This prevents crashes when QClipboard checks for clipboard events |
308 |
+and |
309 |
+ qApp->clipboard()->setProperty( "useEventLoopWhenWaiting", true ); |
310 |
+is set. |
311 |
+ |
312 |
+Task-number: QTBUG-34614 |
313 |
+Task-number: QTBUG-37380 |
314 |
+ |
315 |
+Change-Id: Id4e2a74c6bdf8c3b439a4e3813d24d11368b607d |
316 |
+--- |
317 |
+ src/corelib/kernel/qeventdispatcher_glib.cpp | 10 ++++++++++ |
318 |
+ 1 file changed, 10 insertions(+) |
319 |
+ |
320 |
+diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp |
321 |
+index 0b0e308..ba522fa 100644 |
322 |
+--- a/src/corelib/kernel/qeventdispatcher_glib.cpp |
323 |
++++ b/src/corelib/kernel/qeventdispatcher_glib.cpp |
324 |
+@@ -65,6 +65,7 @@ struct GPollFDWithQSocketNotifier |
325 |
+ struct GSocketNotifierSource |
326 |
+ { |
327 |
+ GSource source; |
328 |
++ QEventLoop::ProcessEventsFlags processEventsFlags; |
329 |
+ QList<GPollFDWithQSocketNotifier *> pollfds; |
330 |
+ }; |
331 |
+ |
332 |
+@@ -80,6 +81,9 @@ static gboolean socketNotifierSourceCheck(GSource *source) |
333 |
+ GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source); |
334 |
+ |
335 |
+ bool pending = false; |
336 |
++ if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers) |
337 |
++ return pending; |
338 |
++ |
339 |
+ for (int i = 0; !pending && i < src->pollfds.count(); ++i) { |
340 |
+ GPollFDWithQSocketNotifier *p = src->pollfds.at(i); |
341 |
+ |
342 |
+@@ -103,6 +107,9 @@ static gboolean socketNotifierSourceDispatch(GSource *source, GSourceFunc, gpoin |
343 |
+ QEvent event(QEvent::SockAct); |
344 |
+ |
345 |
+ GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source); |
346 |
++ if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers) |
347 |
++ return true; |
348 |
++ |
349 |
+ for (int i = 0; i < src->pollfds.count(); ++i) { |
350 |
+ GPollFDWithQSocketNotifier *p = src->pollfds.at(i); |
351 |
+ |
352 |
+@@ -331,6 +338,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) |
353 |
+ reinterpret_cast<GSocketNotifierSource *>(g_source_new(&socketNotifierSourceFuncs, |
354 |
+ sizeof(GSocketNotifierSource))); |
355 |
+ (void) new (&socketNotifierSource->pollfds) QList<GPollFDWithQSocketNotifier *>(); |
356 |
++ socketNotifierSource->processEventsFlags = QEventLoop::AllEvents; |
357 |
+ g_source_set_can_recurse(&socketNotifierSource->source, true); |
358 |
+ g_source_attach(&socketNotifierSource->source, mainContext); |
359 |
+ |
360 |
+@@ -416,6 +424,7 @@ bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags) |
361 |
+ // tell postEventSourcePrepare() and timerSource about any new flags |
362 |
+ QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags; |
363 |
+ d->timerSource->processEventsFlags = flags; |
364 |
++ d->socketNotifierSource->processEventsFlags = flags; |
365 |
+ |
366 |
+ if (!(flags & QEventLoop::EventLoopExec)) { |
367 |
+ // force timers to be sent at normal priority |
368 |
+@@ -427,6 +436,7 @@ bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags) |
369 |
+ result = g_main_context_iteration(d->mainContext, canWait); |
370 |
+ |
371 |
+ d->timerSource->processEventsFlags = savedFlags; |
372 |
++ d->socketNotifierSource->processEventsFlags = savedFlags; |
373 |
+ |
374 |
+ if (canWait) |
375 |
+ emit awake(); |
376 |
+-- |
377 |
+2.0.0 |
378 |
+ |
379 |
|
380 |
diff --git a/dev-qt/qtcore/files/qtcore-4.8.5-moc-boost-lexical-cast.patch b/dev-qt/qtcore/files/qtcore-4.8.5-moc-boost-lexical-cast.patch |
381 |
new file mode 100644 |
382 |
index 0000000..b464c92 |
383 |
--- /dev/null |
384 |
+++ b/dev-qt/qtcore/files/qtcore-4.8.5-moc-boost-lexical-cast.patch |
385 |
@@ -0,0 +1,12 @@ |
386 |
+Index: qt-everywhere-opensource-src-4.8.9999/src/tools/moc/main.cpp |
387 |
+=================================================================== |
388 |
+--- qt-everywhere-opensource-src-4.8.9999.orig/src/tools/moc/main.cpp |
389 |
++++ qt-everywhere-opensource-src-4.8.9999/src/tools/moc/main.cpp |
390 |
+@@ -190,6 +190,7 @@ int runMoc(int _argc, char **_argv) |
391 |
+ |
392 |
+ // Workaround a bug while parsing the boost/type_traits/has_operator.hpp header. See QTBUG-22829 |
393 |
+ pp.macros["BOOST_TT_HAS_OPERATOR_HPP_INCLUDED"]; |
394 |
++ pp.macros["BOOST_LEXICAL_CAST_INCLUDED"]; |
395 |
+ |
396 |
+ QByteArray filename; |
397 |
+ QByteArray output; |
398 |
|
399 |
diff --git a/dev-qt/qtcore/files/qtcore-4.8.5-qeventdispatcher-recursive.patch b/dev-qt/qtcore/files/qtcore-4.8.5-qeventdispatcher-recursive.patch |
400 |
new file mode 100644 |
401 |
index 0000000..6d3bf2f |
402 |
--- /dev/null |
403 |
+++ b/dev-qt/qtcore/files/qtcore-4.8.5-qeventdispatcher-recursive.patch |
404 |
@@ -0,0 +1,94 @@ |
405 |
+--- src/corelib/kernel/qeventdispatcher_glib.cpp.sav 2014-03-28 15:26:37.000000000 +0100 |
406 |
++++ src/corelib/kernel/qeventdispatcher_glib.cpp 2014-04-24 09:44:09.358659204 +0200 |
407 |
+@@ -255,22 +255,30 @@ struct GPostEventSource |
408 |
+ GSource source; |
409 |
+ QAtomicInt serialNumber; |
410 |
+ int lastSerialNumber; |
411 |
++ QEventLoop::ProcessEventsFlags processEventsFlags; |
412 |
+ QEventDispatcherGlibPrivate *d; |
413 |
+ }; |
414 |
+ |
415 |
+ static gboolean postEventSourcePrepare(GSource *s, gint *timeout) |
416 |
+ { |
417 |
++ GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s); |
418 |
+ QThreadData *data = QThreadData::current(); |
419 |
+ if (!data) |
420 |
+ return false; |
421 |
+ |
422 |
++ QEventLoop::ProcessEventsFlags excludeAllFlags |
423 |
++ = QEventLoop::ExcludeUserInputEvents |
424 |
++ | QEventLoop::ExcludeSocketNotifiers |
425 |
++ | QEventLoop::X11ExcludeTimers; |
426 |
++ if ((source->processEventsFlags & excludeAllFlags) == excludeAllFlags) |
427 |
++ return false; |
428 |
++ |
429 |
+ gint dummy; |
430 |
+ if (!timeout) |
431 |
+ timeout = &dummy; |
432 |
+ const bool canWait = data->canWaitLocked(); |
433 |
+ *timeout = canWait ? -1 : 0; |
434 |
+ |
435 |
+- GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s); |
436 |
+ return (!canWait |
437 |
+ || (source->serialNumber != source->lastSerialNumber)); |
438 |
+ } |
439 |
+@@ -284,8 +292,14 @@ static gboolean postEventSourceDispatch( |
440 |
+ { |
441 |
+ GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s); |
442 |
+ source->lastSerialNumber = source->serialNumber; |
443 |
+- QCoreApplication::sendPostedEvents(); |
444 |
+- source->d->runTimersOnceWithNormalPriority(); |
445 |
++ QEventLoop::ProcessEventsFlags excludeAllFlags |
446 |
++ = QEventLoop::ExcludeUserInputEvents |
447 |
++ | QEventLoop::ExcludeSocketNotifiers |
448 |
++ | QEventLoop::X11ExcludeTimers; |
449 |
++ if ((source->processEventsFlags & excludeAllFlags) != excludeAllFlags) { |
450 |
++ QCoreApplication::sendPostedEvents(); |
451 |
++ source->d->runTimersOnceWithNormalPriority(); |
452 |
++ } |
453 |
+ return true; // i dunno, george... |
454 |
+ } |
455 |
+ |
456 |
+@@ -329,6 +343,7 @@ QEventDispatcherGlibPrivate::QEventDispa |
457 |
+ postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs, |
458 |
+ sizeof(GPostEventSource))); |
459 |
+ postEventSource->serialNumber = 1; |
460 |
++ postEventSource->processEventsFlags = QEventLoop::AllEvents; |
461 |
+ postEventSource->d = this; |
462 |
+ g_source_set_can_recurse(&postEventSource->source, true); |
463 |
+ g_source_attach(&postEventSource->source, mainContext); |
464 |
+@@ -423,6 +438,7 @@ bool QEventDispatcherGlib::processEvents |
465 |
+ |
466 |
+ // tell postEventSourcePrepare() and timerSource about any new flags |
467 |
+ QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags; |
468 |
++ d->postEventSource->processEventsFlags = flags; |
469 |
+ d->timerSource->processEventsFlags = flags; |
470 |
+ d->socketNotifierSource->processEventsFlags = flags; |
471 |
+ |
472 |
+@@ -435,6 +451,7 @@ bool QEventDispatcherGlib::processEvents |
473 |
+ while (!result && canWait) |
474 |
+ result = g_main_context_iteration(d->mainContext, canWait); |
475 |
+ |
476 |
++ d->postEventSource->processEventsFlags = savedFlags; |
477 |
+ d->timerSource->processEventsFlags = savedFlags; |
478 |
+ d->socketNotifierSource->processEventsFlags = savedFlags; |
479 |
+ |
480 |
+--- src/corelib/kernel/qeventdispatcher_unix.cpp.sav 2013-06-07 07:16:52.000000000 +0200 |
481 |
++++ src/corelib/kernel/qeventdispatcher_unix.cpp 2014-04-24 09:43:06.927589535 +0200 |
482 |
+@@ -905,7 +905,15 @@ bool QEventDispatcherUNIX::processEvents |
483 |
+ |
484 |
+ // we are awake, broadcast it |
485 |
+ emit awake(); |
486 |
+- QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); |
487 |
++ |
488 |
++ QEventLoop::ProcessEventsFlags excludeAllFlags |
489 |
++ = QEventLoop::ExcludeUserInputEvents |
490 |
++ | QEventLoop::ExcludeSocketNotifiers |
491 |
++ | QEventLoop::X11ExcludeTimers; |
492 |
++ if ((flags & excludeAllFlags) == excludeAllFlags) |
493 |
++ return false; |
494 |
++ if(( flags & excludeAllFlags ) != excludeAllFlags ) |
495 |
++ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); |
496 |
+ |
497 |
+ int nevents = 0; |
498 |
+ const bool canWait = (d->threadData->canWaitLocked() |
499 |
|
500 |
diff --git a/dev-qt/qtcore/files/qtcore-4.8.6-QNAM-corruptions-fix.patch b/dev-qt/qtcore/files/qtcore-4.8.6-QNAM-corruptions-fix.patch |
501 |
new file mode 100644 |
502 |
index 0000000..1d83caa |
503 |
--- /dev/null |
504 |
+++ b/dev-qt/qtcore/files/qtcore-4.8.6-QNAM-corruptions-fix.patch |
505 |
@@ -0,0 +1,431 @@ |
506 |
+From fa81aa6d027049e855b76f5408586a288f160575 Mon Sep 17 00:00:00 2001 |
507 |
+From: Markus Goetz <markus@×××××.com> |
508 |
+Date: Tue, 28 Apr 2015 11:57:36 +0200 |
509 |
+Subject: QNAM: Fix upload corruptions when server closes connection |
510 |
+ |
511 |
+This patch fixes several upload corruptions if the server closes the connection |
512 |
+while/before we send data into it. They happen inside multiple places in the HTTP |
513 |
+layer and are explained in the comments. |
514 |
+Corruptions are: |
515 |
+* The upload byte device has an in-flight signal with pending upload data, if |
516 |
+it gets reset (because server closes the connection) then the re-send of the |
517 |
+request was sometimes taking this stale in-flight pending upload data. |
518 |
+* Because some signals were DirectConnection and some were QueuedConnection, there |
519 |
+was a chance that a direct signal overtakes a queued signal. The state machine |
520 |
+then sent data down the socket which was buffered there (and sent later) although |
521 |
+it did not match the current state of the state machine when it was actually sent. |
522 |
+* A socket was seen as being able to have requests sent even though it was not |
523 |
+encrypted yet. This relates to the previous corruption where data is stored inside |
524 |
+the socket's buffer and then sent later. |
525 |
+ |
526 |
+The included auto test produces all fixed corruptions, I detected no regressions |
527 |
+via the other tests. |
528 |
+This code also adds a bit of sanity checking to protect from possible further |
529 |
+problems. |
530 |
+ |
531 |
+[ChangeLog][QtNetwork] Fix HTTP(s) upload corruption when server closes connection |
532 |
+ |
533 |
+(cherry picked from commit qtbase/cff39fba10ffc10ee4dcfdc66ff6528eb26462d3) |
534 |
+Change-Id: I9793297be6cf3edfb75b65ba03b65f7a133ef194 |
535 |
+Reviewed-by: Richard J. Moore <rich@×××.org> |
536 |
+--- |
537 |
+ src/corelib/io/qnoncontiguousbytedevice.cpp | 19 +++ |
538 |
+ src/corelib/io/qnoncontiguousbytedevice_p.h | 4 + |
539 |
+ .../access/qhttpnetworkconnectionchannel.cpp | 47 +++++- |
540 |
+ src/network/access/qhttpthreaddelegate_p.h | 36 ++++- |
541 |
+ src/network/access/qnetworkaccesshttpbackend.cpp | 24 ++- |
542 |
+ src/network/access/qnetworkaccesshttpbackend_p.h | 5 +- |
543 |
+ tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 174 ++++++++++++++++++++- |
544 |
+ 7 files changed, 280 insertions(+), 29 deletions(-) |
545 |
+ |
546 |
+diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp |
547 |
+index bf58eee..1a0591e 100644 |
548 |
+--- a/src/corelib/io/qnoncontiguousbytedevice.cpp |
549 |
++++ b/src/corelib/io/qnoncontiguousbytedevice.cpp |
550 |
+@@ -245,6 +245,12 @@ qint64 QNonContiguousByteDeviceByteArrayImpl::size() |
551 |
+ return byteArray->size(); |
552 |
+ } |
553 |
+ |
554 |
++qint64 QNonContiguousByteDeviceByteArrayImpl::pos() |
555 |
++{ |
556 |
++ return currentPosition; |
557 |
++} |
558 |
++ |
559 |
++ |
560 |
+ QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb) |
561 |
+ : QNonContiguousByteDevice(), currentPosition(0) |
562 |
+ { |
563 |
+@@ -296,6 +302,11 @@ qint64 QNonContiguousByteDeviceRingBufferImpl::size() |
564 |
+ return ringBuffer->size(); |
565 |
+ } |
566 |
+ |
567 |
++qint64 QNonContiguousByteDeviceRingBufferImpl::pos() |
568 |
++{ |
569 |
++ return currentPosition; |
570 |
++} |
571 |
++ |
572 |
+ QNonContiguousByteDeviceIoDeviceImpl::QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d) |
573 |
+ : QNonContiguousByteDevice(), |
574 |
+ currentReadBuffer(0), currentReadBufferSize(16*1024), |
575 |
+@@ -415,6 +426,14 @@ qint64 QNonContiguousByteDeviceIoDeviceImpl::size() |
576 |
+ return device->size() - initialPosition; |
577 |
+ } |
578 |
+ |
579 |
++qint64 QNonContiguousByteDeviceIoDeviceImpl::pos() |
580 |
++{ |
581 |
++ if (device->isSequential()) |
582 |
++ return -1; |
583 |
++ |
584 |
++ return device->pos(); |
585 |
++} |
586 |
++ |
587 |
+ QByteDeviceWrappingIoDevice::QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd) : QIODevice((QObject*)0) |
588 |
+ { |
589 |
+ byteDevice = bd; |
590 |
+diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h |
591 |
+index b6966eb..d1a99a1 100644 |
592 |
+--- a/src/corelib/io/qnoncontiguousbytedevice_p.h |
593 |
++++ b/src/corelib/io/qnoncontiguousbytedevice_p.h |
594 |
+@@ -69,6 +69,7 @@ public: |
595 |
+ virtual const char* readPointer(qint64 maximumLength, qint64 &len) = 0; |
596 |
+ virtual bool advanceReadPointer(qint64 amount) = 0; |
597 |
+ virtual bool atEnd() = 0; |
598 |
++ virtual qint64 pos() { return -1; } |
599 |
+ virtual bool reset() = 0; |
600 |
+ void disableReset(); |
601 |
+ bool isResetDisabled() { return resetDisabled; } |
602 |
+@@ -108,6 +109,7 @@ public: |
603 |
+ bool atEnd(); |
604 |
+ bool reset(); |
605 |
+ qint64 size(); |
606 |
++ qint64 pos(); |
607 |
+ protected: |
608 |
+ QByteArray* byteArray; |
609 |
+ qint64 currentPosition; |
610 |
+@@ -123,6 +125,7 @@ public: |
611 |
+ bool atEnd(); |
612 |
+ bool reset(); |
613 |
+ qint64 size(); |
614 |
++ qint64 pos(); |
615 |
+ protected: |
616 |
+ QSharedPointer<QRingBuffer> ringBuffer; |
617 |
+ qint64 currentPosition; |
618 |
+@@ -140,6 +143,7 @@ public: |
619 |
+ bool atEnd(); |
620 |
+ bool reset(); |
621 |
+ qint64 size(); |
622 |
++ qint64 pos(); |
623 |
+ protected: |
624 |
+ QIODevice* device; |
625 |
+ QByteArray* currentReadBuffer; |
626 |
+diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp |
627 |
+index 550e090..db2f712 100644 |
628 |
+--- a/src/network/access/qhttpnetworkconnectionchannel.cpp |
629 |
++++ b/src/network/access/qhttpnetworkconnectionchannel.cpp |
630 |
+@@ -107,15 +107,19 @@ void QHttpNetworkConnectionChannel::init() |
631 |
+ socket->setProxy(QNetworkProxy::NoProxy); |
632 |
+ #endif |
633 |
+ |
634 |
++ // We want all signals (except the interactive ones) be connected as QueuedConnection |
635 |
++ // because else we're falling into cases where we recurse back into the socket code |
636 |
++ // and mess up the state. Always going to the event loop (and expecting that when reading/writing) |
637 |
++ // is safer. |
638 |
+ QObject::connect(socket, SIGNAL(bytesWritten(qint64)), |
639 |
+ this, SLOT(_q_bytesWritten(qint64)), |
640 |
+- Qt::DirectConnection); |
641 |
++ Qt::QueuedConnection); |
642 |
+ QObject::connect(socket, SIGNAL(connected()), |
643 |
+ this, SLOT(_q_connected()), |
644 |
+- Qt::DirectConnection); |
645 |
++ Qt::QueuedConnection); |
646 |
+ QObject::connect(socket, SIGNAL(readyRead()), |
647 |
+ this, SLOT(_q_readyRead()), |
648 |
+- Qt::DirectConnection); |
649 |
++ Qt::QueuedConnection); |
650 |
+ |
651 |
+ // The disconnected() and error() signals may already come |
652 |
+ // while calling connectToHost(). |
653 |
+@@ -144,13 +148,13 @@ void QHttpNetworkConnectionChannel::init() |
654 |
+ // won't be a sslSocket if encrypt is false |
655 |
+ QObject::connect(sslSocket, SIGNAL(encrypted()), |
656 |
+ this, SLOT(_q_encrypted()), |
657 |
+- Qt::DirectConnection); |
658 |
++ Qt::QueuedConnection); |
659 |
+ QObject::connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)), |
660 |
+ this, SLOT(_q_sslErrors(QList<QSslError>)), |
661 |
+ Qt::DirectConnection); |
662 |
+ QObject::connect(sslSocket, SIGNAL(encryptedBytesWritten(qint64)), |
663 |
+ this, SLOT(_q_encryptedBytesWritten(qint64)), |
664 |
+- Qt::DirectConnection); |
665 |
++ Qt::QueuedConnection); |
666 |
+ } |
667 |
+ #endif |
668 |
+ } |
669 |
+@@ -163,7 +167,8 @@ void QHttpNetworkConnectionChannel::close() |
670 |
+ else |
671 |
+ state = QHttpNetworkConnectionChannel::ClosingState; |
672 |
+ |
673 |
+- socket->close(); |
674 |
++ if (socket) |
675 |
++ socket->close(); |
676 |
+ } |
677 |
+ |
678 |
+ |
679 |
+@@ -280,6 +285,14 @@ bool QHttpNetworkConnectionChannel::sendRequest() |
680 |
+ // nothing to read currently, break the loop |
681 |
+ break; |
682 |
+ } else { |
683 |
++ if (written != uploadByteDevice->pos()) { |
684 |
++ // Sanity check. This was useful in tracking down an upload corruption. |
685 |
++ qWarning() << "QHttpProtocolHandler: Internal error in sendRequest. Expected to write at position" << written << "but read device is at" << uploadByteDevice->pos(); |
686 |
++ Q_ASSERT(written == uploadByteDevice->pos()); |
687 |
++ connection->d_func()->emitReplyError(socket, reply, QNetworkReply::ProtocolFailure); |
688 |
++ return false; |
689 |
++ } |
690 |
++ |
691 |
+ qint64 currentWriteSize = socket->write(readPointer, currentReadSize); |
692 |
+ if (currentWriteSize == -1 || currentWriteSize != currentReadSize) { |
693 |
+ // socket broke down |
694 |
+@@ -639,6 +652,14 @@ bool QHttpNetworkConnectionChannel::ensureConnection() |
695 |
+ } |
696 |
+ return false; |
697 |
+ } |
698 |
++ |
699 |
++ // This code path for ConnectedState |
700 |
++ if (pendingEncrypt) { |
701 |
++ // Let's only be really connected when we have received the encrypted() signal. Else the state machine seems to mess up |
702 |
++ // and corrupt the things sent to the server. |
703 |
++ return false; |
704 |
++ } |
705 |
++ |
706 |
+ return true; |
707 |
+ } |
708 |
+ |
709 |
+@@ -980,6 +1001,13 @@ void QHttpNetworkConnectionChannel::_q_readyRead() |
710 |
+ void QHttpNetworkConnectionChannel::_q_bytesWritten(qint64 bytes) |
711 |
+ { |
712 |
+ Q_UNUSED(bytes); |
713 |
++ |
714 |
++ if (ssl) { |
715 |
++ // In the SSL case we want to send data from encryptedBytesWritten signal since that one |
716 |
++ // is the one going down to the actual network, not only into some SSL buffer. |
717 |
++ return; |
718 |
++ } |
719 |
++ |
720 |
+ // bytes have been written to the socket. write even more of them :) |
721 |
+ if (isSocketWriting()) |
722 |
+ sendRequest(); |
723 |
+@@ -1029,7 +1057,7 @@ void QHttpNetworkConnectionChannel::_q_connected() |
724 |
+ |
725 |
+ // ### FIXME: if the server closes the connection unexpectedly, we shouldn't send the same broken request again! |
726 |
+ //channels[i].reconnectAttempts = 2; |
727 |
+- if (!pendingEncrypt) { |
728 |
++ if (!pendingEncrypt && !ssl) { // FIXME: Didn't work properly with pendingEncrypt only, we should refactor this into an EncrypingState |
729 |
+ state = QHttpNetworkConnectionChannel::IdleState; |
730 |
+ if (!reply) |
731 |
+ connection->d_func()->dequeueRequest(socket); |
732 |
+@@ -1157,7 +1185,10 @@ void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetwor |
733 |
+ |
734 |
+ void QHttpNetworkConnectionChannel::_q_uploadDataReadyRead() |
735 |
+ { |
736 |
+- sendRequest(); |
737 |
++ if (reply && state == QHttpNetworkConnectionChannel::WritingState) { |
738 |
++ // There might be timing issues, make sure to only send upload data if really in that state |
739 |
++ sendRequest(); |
740 |
++ } |
741 |
+ } |
742 |
+ |
743 |
+ #ifndef QT_NO_OPENSSL |
744 |
+diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h |
745 |
+index 7648325..9dd0deb 100644 |
746 |
+--- a/src/network/access/qhttpthreaddelegate_p.h |
747 |
++++ b/src/network/access/qhttpthreaddelegate_p.h |
748 |
+@@ -190,6 +190,7 @@ protected: |
749 |
+ QByteArray m_dataArray; |
750 |
+ bool m_atEnd; |
751 |
+ qint64 m_size; |
752 |
++ qint64 m_pos; // to match calls of haveDataSlot with the expected position |
753 |
+ public: |
754 |
+ QNonContiguousByteDeviceThreadForwardImpl(bool aE, qint64 s) |
755 |
+ : QNonContiguousByteDevice(), |
756 |
+@@ -197,7 +198,8 @@ public: |
757 |
+ m_amount(0), |
758 |
+ m_data(0), |
759 |
+ m_atEnd(aE), |
760 |
+- m_size(s) |
761 |
++ m_size(s), |
762 |
++ m_pos(0) |
763 |
+ { |
764 |
+ } |
765 |
+ |
766 |
+@@ -205,6 +207,11 @@ public: |
767 |
+ { |
768 |
+ } |
769 |
+ |
770 |
++ qint64 pos() |
771 |
++ { |
772 |
++ return m_pos; |
773 |
++ } |
774 |
++ |
775 |
+ const char* readPointer(qint64 maximumLength, qint64 &len) |
776 |
+ { |
777 |
+ if (m_amount > 0) { |
778 |
+@@ -232,11 +239,10 @@ public: |
779 |
+ |
780 |
+ m_amount -= a; |
781 |
+ m_data += a; |
782 |
++ m_pos += a; |
783 |
+ |
784 |
+- // To main thread to inform about our state |
785 |
+- emit processedData(a); |
786 |
+- |
787 |
+- // FIXME possible optimization, already ask user thread for some data |
788 |
++ // To main thread to inform about our state. The m_pos will be sent as a sanity check. |
789 |
++ emit processedData(m_pos, a); |
790 |
+ |
791 |
+ return true; |
792 |
+ } |
793 |
+@@ -253,10 +259,21 @@ public: |
794 |
+ { |
795 |
+ m_amount = 0; |
796 |
+ m_data = 0; |
797 |
++ m_dataArray.clear(); |
798 |
++ |
799 |
++ if (wantDataPending) { |
800 |
++ // had requested the user thread to send some data (only 1 in-flight at any moment) |
801 |
++ wantDataPending = false; |
802 |
++ } |
803 |
+ |
804 |
+ // Communicate as BlockingQueuedConnection |
805 |
+ bool b = false; |
806 |
+ emit resetData(&b); |
807 |
++ if (b) { |
808 |
++ // the reset succeeded, we're at pos 0 again |
809 |
++ m_pos = 0; |
810 |
++ // the HTTP code will anyway abort the request if !b. |
811 |
++ } |
812 |
+ return b; |
813 |
+ } |
814 |
+ |
815 |
+@@ -267,8 +284,13 @@ public: |
816 |
+ |
817 |
+ public slots: |
818 |
+ // From user thread: |
819 |
+- void haveDataSlot(QByteArray dataArray, bool dataAtEnd, qint64 dataSize) |
820 |
++ void haveDataSlot(qint64 pos, QByteArray dataArray, bool dataAtEnd, qint64 dataSize) |
821 |
+ { |
822 |
++ if (pos != m_pos) { |
823 |
++ // Sometimes when re-sending a request in the qhttpnetwork* layer there is a pending haveData from the |
824 |
++ // user thread on the way to us. We need to ignore it since it is the data for the wrong(later) chunk. |
825 |
++ return; |
826 |
++ } |
827 |
+ wantDataPending = false; |
828 |
+ |
829 |
+ m_dataArray = dataArray; |
830 |
+@@ -288,7 +310,7 @@ signals: |
831 |
+ |
832 |
+ // to main thread: |
833 |
+ void wantData(qint64); |
834 |
+- void processedData(qint64); |
835 |
++ void processedData(qint64 pos, qint64 amount); |
836 |
+ void resetData(bool *b); |
837 |
+ }; |
838 |
+ |
839 |
+diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp |
840 |
+index cc67258..fe2f627 100644 |
841 |
+--- a/src/network/access/qnetworkaccesshttpbackend.cpp |
842 |
++++ b/src/network/access/qnetworkaccesshttpbackend.cpp |
843 |
+@@ -193,6 +193,7 @@ QNetworkAccessHttpBackendFactory::create(QNetworkAccessManager::Operation op, |
844 |
+ QNetworkAccessHttpBackend::QNetworkAccessHttpBackend() |
845 |
+ : QNetworkAccessBackend() |
846 |
+ , statusCode(0) |
847 |
++ , uploadByteDevicePosition(false) |
848 |
+ , pendingDownloadDataEmissions(new QAtomicInt()) |
849 |
+ , pendingDownloadProgressEmissions(new QAtomicInt()) |
850 |
+ , loadingFromCache(false) |
851 |
+@@ -610,9 +611,9 @@ void QNetworkAccessHttpBackend::postRequest() |
852 |
+ forwardUploadDevice->setParent(delegate); // needed to make sure it is moved on moveToThread() |
853 |
+ delegate->httpRequest.setUploadByteDevice(forwardUploadDevice); |
854 |
+ |
855 |
+- // From main thread to user thread: |
856 |
+- QObject::connect(this, SIGNAL(haveUploadData(QByteArray, bool, qint64)), |
857 |
+- forwardUploadDevice, SLOT(haveDataSlot(QByteArray, bool, qint64)), Qt::QueuedConnection); |
858 |
++ // From user thread to http thread: |
859 |
++ QObject::connect(this, SIGNAL(haveUploadData(qint64,QByteArray,bool,qint64)), |
860 |
++ forwardUploadDevice, SLOT(haveDataSlot(qint64,QByteArray,bool,qint64)), Qt::QueuedConnection); |
861 |
+ QObject::connect(uploadByteDevice.data(), SIGNAL(readyRead()), |
862 |
+ forwardUploadDevice, SIGNAL(readyRead()), |
863 |
+ Qt::QueuedConnection); |
864 |
+@@ -620,8 +621,8 @@ void QNetworkAccessHttpBackend::postRequest() |
865 |
+ // From http thread to user thread: |
866 |
+ QObject::connect(forwardUploadDevice, SIGNAL(wantData(qint64)), |
867 |
+ this, SLOT(wantUploadDataSlot(qint64))); |
868 |
+- QObject::connect(forwardUploadDevice, SIGNAL(processedData(qint64)), |
869 |
+- this, SLOT(sentUploadDataSlot(qint64))); |
870 |
++ QObject::connect(forwardUploadDevice,SIGNAL(processedData(qint64, qint64)), |
871 |
++ this, SLOT(sentUploadDataSlot(qint64,qint64))); |
872 |
+ connect(forwardUploadDevice, SIGNAL(resetData(bool*)), |
873 |
+ this, SLOT(resetUploadDataSlot(bool*)), |
874 |
+ Qt::BlockingQueuedConnection); // this is the only one with BlockingQueued! |
875 |
+@@ -915,12 +916,21 @@ void QNetworkAccessHttpBackend::replySslConfigurationChanged(const QSslConfigura |
876 |
+ void QNetworkAccessHttpBackend::resetUploadDataSlot(bool *r) |
877 |
+ { |
878 |
+ *r = uploadByteDevice->reset(); |
879 |
++ if (*r) { |
880 |
++ // reset our own position which is used for the inter-thread communication |
881 |
++ uploadByteDevicePosition = 0; |
882 |
++ } |
883 |
+ } |
884 |
+ |
885 |
+ // Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread |
886 |
+-void QNetworkAccessHttpBackend::sentUploadDataSlot(qint64 amount) |
887 |
++void QNetworkAccessHttpBackend::sentUploadDataSlot(qint64 pos, qint64 amount) |
888 |
+ { |
889 |
++ if (uploadByteDevicePosition + amount != pos) { |
890 |
++ // Sanity check, should not happen. |
891 |
++ error(QNetworkReply::UnknownNetworkError, ""); |
892 |
++ } |
893 |
+ uploadByteDevice->advanceReadPointer(amount); |
894 |
++ uploadByteDevicePosition += amount; |
895 |
+ } |
896 |
+ |
897 |
+ // Coming from QNonContiguousByteDeviceThreadForwardImpl in HTTP thread |
898 |
+@@ -933,7 +943,7 @@ void QNetworkAccessHttpBackend::wantUploadDataSlot(qint64 maxSize) |
899 |
+ QByteArray dataArray(data, currentUploadDataLength); |
900 |
+ |
901 |
+ // Communicate back to HTTP thread |
902 |
+- emit haveUploadData(dataArray, uploadByteDevice->atEnd(), uploadByteDevice->size()); |
903 |
++ emit haveUploadData(uploadByteDevicePosition, dataArray, uploadByteDevice->atEnd(), uploadByteDevice->size()); |
904 |
+ } |
905 |
+ |
906 |
+ /* |
907 |
+diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h |
908 |
+index 13519c6..b4ed67c 100644 |
909 |
+--- a/src/network/access/qnetworkaccesshttpbackend_p.h |
910 |
++++ b/src/network/access/qnetworkaccesshttpbackend_p.h |
911 |
+@@ -112,7 +112,7 @@ signals: |
912 |
+ |
913 |
+ void startHttpRequestSynchronously(); |
914 |
+ |
915 |
+- void haveUploadData(QByteArray dataArray, bool dataAtEnd, qint64 dataSize); |
916 |
++ void haveUploadData(const qint64 pos, QByteArray dataArray, bool dataAtEnd, qint64 dataSize); |
917 |
+ private slots: |
918 |
+ // From HTTP thread: |
919 |
+ void replyDownloadData(QByteArray); |
920 |
+@@ -129,13 +129,14 @@ private slots: |
921 |
+ // From QNonContiguousByteDeviceThreadForwardImpl in HTTP thread: |
922 |
+ void resetUploadDataSlot(bool *r); |
923 |
+ void wantUploadDataSlot(qint64); |
924 |
+- void sentUploadDataSlot(qint64); |
925 |
++ void sentUploadDataSlot(qint64, qint64); |
926 |
+ |
927 |
+ bool sendCacheContents(const QNetworkCacheMetaData &metaData); |
928 |
+ |
929 |
+ private: |
930 |
+ QHttpNetworkRequest httpRequest; // There is also a copy in the HTTP thread |
931 |
+ int statusCode; |
932 |
++ qint64 uploadByteDevicePosition; |
933 |
+ QString reasonPhrase; |
934 |
+ // Will be increased by HTTP thread: |
935 |
+ QSharedPointer<QAtomicInt> pendingDownloadDataEmissions; |
936 |
+ |
937 |
|
938 |
diff --git a/dev-qt/qtcore/files/qtcore-4.8.7-fix-socklent-for-musl.patch b/dev-qt/qtcore/files/qtcore-4.8.7-fix-socklent-for-musl.patch |
939 |
new file mode 100644 |
940 |
index 0000000..81b44c3 |
941 |
--- /dev/null |
942 |
+++ b/dev-qt/qtcore/files/qtcore-4.8.7-fix-socklent-for-musl.patch |
943 |
@@ -0,0 +1,119 @@ |
944 |
+diff -ru a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h |
945 |
+--- a/mkspecs/linux-cxx/qplatformdefs.h 2015-05-07 14:14:41.000000000 +0000 |
946 |
++++ b/mkspecs/linux-cxx/qplatformdefs.h 2015-07-04 21:44:04.370713742 +0000 |
947 |
+@@ -87,10 +87,10 @@ |
948 |
+ |
949 |
+ #undef QT_SOCKLEN_T |
950 |
+ |
951 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
952 |
+-#define QT_SOCKLEN_T socklen_t |
953 |
+-#else |
954 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
955 |
+ #define QT_SOCKLEN_T int |
956 |
++#else |
957 |
++#define QT_SOCKLEN_T socklen_t |
958 |
+ #endif |
959 |
+ |
960 |
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) |
961 |
+diff -ru a/mkspecs/linux-ecc-64/qplatformdefs.h b/mkspecs/linux-ecc-64/qplatformdefs.h |
962 |
+--- a/mkspecs/linux-ecc-64/qplatformdefs.h 2015-05-07 14:14:42.000000000 +0000 |
963 |
++++ b/mkspecs/linux-ecc-64/qplatformdefs.h 2015-07-04 21:44:41.610717930 +0000 |
964 |
+@@ -87,10 +87,10 @@ |
965 |
+ |
966 |
+ #undef QT_SOCKLEN_T |
967 |
+ |
968 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
969 |
+-#define QT_SOCKLEN_T socklen_t |
970 |
+-#else |
971 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
972 |
+ #define QT_SOCKLEN_T int |
973 |
++#else |
974 |
++#define QT_SOCKLEN_T socklen_t |
975 |
+ #endif |
976 |
+ |
977 |
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) |
978 |
+diff -ru a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h |
979 |
+--- a/mkspecs/linux-g++/qplatformdefs.h 2015-05-07 14:14:41.000000000 +0000 |
980 |
++++ b/mkspecs/linux-g++/qplatformdefs.h 2015-07-04 21:45:09.554721073 +0000 |
981 |
+@@ -86,10 +86,10 @@ |
982 |
+ |
983 |
+ #undef QT_SOCKLEN_T |
984 |
+ |
985 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
986 |
+-#define QT_SOCKLEN_T socklen_t |
987 |
+-#else |
988 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
989 |
+ #define QT_SOCKLEN_T int |
990 |
++#else |
991 |
++#define QT_SOCKLEN_T socklen_t |
992 |
+ #endif |
993 |
+ |
994 |
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) |
995 |
+diff -ru a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h |
996 |
+--- a/mkspecs/linux-kcc/qplatformdefs.h 2015-05-07 14:14:41.000000000 +0000 |
997 |
++++ b/mkspecs/linux-kcc/qplatformdefs.h 2015-07-04 21:46:42.865731566 +0000 |
998 |
+@@ -90,10 +90,10 @@ |
999 |
+ |
1000 |
+ #undef QT_SOCKLEN_T |
1001 |
+ |
1002 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
1003 |
+-#define QT_SOCKLEN_T socklen_t |
1004 |
+-#else |
1005 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
1006 |
+ #define QT_SOCKLEN_T int |
1007 |
++#else |
1008 |
++#define QT_SOCKLEN_T socklen_t |
1009 |
+ #endif |
1010 |
+ |
1011 |
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) |
1012 |
+diff -ru a/mkspecs/linux-llvm/qplatformdefs.h b/mkspecs/linux-llvm/qplatformdefs.h |
1013 |
+--- a/mkspecs/linux-llvm/qplatformdefs.h 2015-05-07 14:14:42.000000000 +0000 |
1014 |
++++ b/mkspecs/linux-llvm/qplatformdefs.h 2015-07-04 21:47:02.930733823 +0000 |
1015 |
+@@ -87,10 +87,10 @@ |
1016 |
+ |
1017 |
+ #undef QT_SOCKLEN_T |
1018 |
+ |
1019 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
1020 |
+-#define QT_SOCKLEN_T socklen_t |
1021 |
+-#else |
1022 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
1023 |
+ #define QT_SOCKLEN_T int |
1024 |
++#else |
1025 |
++#define QT_SOCKLEN_T socklen_t |
1026 |
+ #endif |
1027 |
+ |
1028 |
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) |
1029 |
+diff -ru a/mkspecs/linux-lsb-g++/qplatformdefs.h b/mkspecs/linux-lsb-g++/qplatformdefs.h |
1030 |
+--- a/mkspecs/linux-lsb-g++/qplatformdefs.h 2015-05-07 14:14:42.000000000 +0000 |
1031 |
++++ b/mkspecs/linux-lsb-g++/qplatformdefs.h 2015-07-04 21:47:25.465736357 +0000 |
1032 |
+@@ -94,10 +94,10 @@ |
1033 |
+ |
1034 |
+ #define QT_OPEN_LARGEFILE 0 |
1035 |
+ |
1036 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
1037 |
+-#define QT_SOCKLEN_T socklen_t |
1038 |
+-#else |
1039 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
1040 |
+ #define QT_SOCKLEN_T int |
1041 |
++#else |
1042 |
++#define QT_SOCKLEN_T socklen_t |
1043 |
+ #endif |
1044 |
+ |
1045 |
+ #ifndef SIOCGIFBRDADDR |
1046 |
+diff -ru a/mkspecs/linux-pgcc/qplatformdefs.h b/mkspecs/linux-pgcc/qplatformdefs.h |
1047 |
+--- a/mkspecs/linux-pgcc/qplatformdefs.h 2015-05-07 14:14:42.000000000 +0000 |
1048 |
++++ b/mkspecs/linux-pgcc/qplatformdefs.h 2015-07-04 21:47:53.505739511 +0000 |
1049 |
+@@ -87,10 +87,10 @@ |
1050 |
+ |
1051 |
+ #undef QT_SOCKLEN_T |
1052 |
+ |
1053 |
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2) |
1054 |
+-#define QT_SOCKLEN_T socklen_t |
1055 |
+-#else |
1056 |
++#if defined(__GLIBC__) && (__GLIBC__ < 2) |
1057 |
+ #define QT_SOCKLEN_T int |
1058 |
++#else |
1059 |
++#define QT_SOCKLEN_T socklen_t |
1060 |
+ #endif |
1061 |
+ |
1062 |
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) |
1063 |
|
1064 |
diff --git a/dev-qt/qtcore/metadata.xml b/dev-qt/qtcore/metadata.xml |
1065 |
new file mode 100644 |
1066 |
index 0000000..9b12987 |
1067 |
--- /dev/null |
1068 |
+++ b/dev-qt/qtcore/metadata.xml |
1069 |
@@ -0,0 +1,16 @@ |
1070 |
+<?xml version="1.0" encoding="UTF-8"?> |
1071 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
1072 |
+<pkgmetadata> |
1073 |
+ <herd>qt</herd> |
1074 |
+ <use> |
1075 |
+ <flag name="exceptions">Add support for exceptions - like catching them |
1076 |
+ inside the event loop (recommended by upstream)</flag> |
1077 |
+ <flag name="glib">Enable <pkg>dev-libs/glib</pkg> eventloop support</flag> |
1078 |
+ <flag name="qt3support">Enable the Qt3Support libraries for Qt4. Note that |
1079 |
+ this does not mean you can compile pure Qt3 programs with Qt4.</flag> |
1080 |
+ </use> |
1081 |
+ <upstream> |
1082 |
+ <bugs-to>https://bugreports.qt.io/</bugs-to> |
1083 |
+ <doc>http://doc.qt.io/</doc> |
1084 |
+ </upstream> |
1085 |
+</pkgmetadata> |
1086 |
|
1087 |
diff --git a/dev-qt/qtcore/qtcore-4.8.7-r99.ebuild b/dev-qt/qtcore/qtcore-4.8.7-r99.ebuild |
1088 |
new file mode 100644 |
1089 |
index 0000000..156a67d |
1090 |
--- /dev/null |
1091 |
+++ b/dev-qt/qtcore/qtcore-4.8.7-r99.ebuild |
1092 |
@@ -0,0 +1,90 @@ |
1093 |
+# Copyright 1999-2015 Gentoo Foundation |
1094 |
+# Distributed under the terms of the GNU General Public License v2 |
1095 |
+# $Header: /var/cvsroot/gentoo-x86/dev-qt/qtcore/qtcore-4.8.7.ebuild,v 1.1 2015/05/26 18:14:28 pesa Exp $ |
1096 |
+ |
1097 |
+EAPI=5 |
1098 |
+inherit qt4-build-multilib |
1099 |
+ |
1100 |
+DESCRIPTION="Cross-platform application development framework" |
1101 |
+ |
1102 |
+if [[ ${QT4_BUILD_TYPE} == release ]]; then |
1103 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
1104 |
+fi |
1105 |
+ |
1106 |
+IUSE="+glib iconv icu qt3support ssl" |
1107 |
+ |
1108 |
+DEPEND=" |
1109 |
+ >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] |
1110 |
+ glib? ( dev-libs/glib:2[${MULTILIB_USEDEP}] ) |
1111 |
+ iconv? ( >=virtual/libiconv-0-r2[${MULTILIB_USEDEP}] ) |
1112 |
+ icu? ( dev-libs/icu:=[${MULTILIB_USEDEP}] ) |
1113 |
+ ssl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] ) |
1114 |
+" |
1115 |
+RDEPEND="${DEPEND}" |
1116 |
+PDEPEND=" |
1117 |
+ ~dev-qt/qttranslations-${PV} |
1118 |
+ qt3support? ( ~dev-qt/qtgui-${PV}[aqua=,debug=,glib=,qt3support,${MULTILIB_USEDEP}] ) |
1119 |
+" |
1120 |
+ |
1121 |
+MULTILIB_WRAPPED_HEADERS=( |
1122 |
+ /usr/include/qt4/Qt/qconfig.h |
1123 |
+ /usr/include/qt4/QtCore/qconfig.h |
1124 |
+) |
1125 |
+ |
1126 |
+PATCHES=( |
1127 |
+ "${FILESDIR}/${PN}-4.8.5-moc-boost-lexical-cast.patch" |
1128 |
+ "${FILESDIR}/${PN}-4.8.5-honor-ExcludeSocketNotifiers-in-glib-event-loop.patch" # bug 514968 |
1129 |
+ "${FILESDIR}/${PN}-4.8.5-qeventdispatcher-recursive.patch" # bug 514968 |
1130 |
+ "${FILESDIR}/${PN}-4.8.7-fix-socklent-for-musl.patch" |
1131 |
+) |
1132 |
+ |
1133 |
+QT4_TARGET_DIRECTORIES=" |
1134 |
+ src/tools/bootstrap |
1135 |
+ src/tools/moc |
1136 |
+ src/tools/rcc |
1137 |
+ src/tools/uic |
1138 |
+ src/corelib |
1139 |
+ src/network |
1140 |
+ src/xml |
1141 |
+ src/plugins/codecs/cn |
1142 |
+ src/plugins/codecs/jp |
1143 |
+ src/plugins/codecs/kr |
1144 |
+ src/plugins/codecs/tw |
1145 |
+ tools/linguist/lconvert |
1146 |
+ tools/linguist/lrelease |
1147 |
+ tools/linguist/lupdate" |
1148 |
+ |
1149 |
+QCONFIG_DEFINE="QT_ZLIB" |
1150 |
+ |
1151 |
+src_prepare() { |
1152 |
+ qt4-build-multilib_src_prepare |
1153 |
+ |
1154 |
+ # bug 172219 |
1155 |
+ sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CXXFLAGS} :" \ |
1156 |
+ -e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" \ |
1157 |
+ qmake/Makefile.unix || die "sed qmake/Makefile.unix failed" |
1158 |
+ |
1159 |
+ # bug 427782 |
1160 |
+ sed -i -e '/^CPPFLAGS\s*=/ s/-g //' \ |
1161 |
+ qmake/Makefile.unix || die "sed CPPFLAGS in qmake/Makefile.unix failed" |
1162 |
+ sed -i -e 's/setBootstrapVariable QMAKE_CFLAGS_RELEASE/QMakeVar set QMAKE_CFLAGS_RELEASE/' \ |
1163 |
+ -e 's/setBootstrapVariable QMAKE_CXXFLAGS_RELEASE/QMakeVar set QMAKE_CXXFLAGS_RELEASE/' \ |
1164 |
+ configure || die "sed configure setBootstrapVariable failed" |
1165 |
+} |
1166 |
+ |
1167 |
+multilib_src_configure() { |
1168 |
+ local myconf=( |
1169 |
+ -no-accessibility -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon |
1170 |
+ -no-phonon-backend -no-svg -no-webkit -no-script -no-scripttools -no-declarative |
1171 |
+ -system-zlib -no-gif -no-libtiff -no-libpng -no-libmng -no-libjpeg |
1172 |
+ -no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl -no-openvg |
1173 |
+ -no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor -no-xfixes |
1174 |
+ -no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype -no-xinput -no-xkb |
1175 |
+ $(qt_use glib) |
1176 |
+ $(qt_use iconv) |
1177 |
+ $(qt_use icu) |
1178 |
+ $(use ssl && echo -openssl-linked || echo -no-openssl) |
1179 |
+ $(qt_use qt3support) |
1180 |
+ ) |
1181 |
+ qt4_multilib_src_configure |
1182 |
+} |