summaryrefslogtreecommitdiffstats
path: root/src/qtbase-1.cherrypicks.patch
blob: 28f87515ff0f949cc3ddca0ad69ea94580aec786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
This file is part of MXE.
See index.html for further information.

From 34475e6e4d05051ba80197846d932acb9492663b Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Mon, 24 Sep 2012 19:53:55 +0200
Subject: [PATCH 1/6] use pkg-config for freetype

Change-Id: Id0b048b44bcebf066c21efeb89f9c1781023a593

diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 7f73465..1de1d74 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -169,6 +169,10 @@ contains(QT_CONFIG, freetype) {
                qwindowsfontdatabase_ft.h
     SOURCES += \
                qwindowsfontdatabase_ft.cpp
+    static {
+        CONFIG += link_pkgconfig
+        PKGCONFIG += freetype2
+    }
 }
 
 OTHER_FILES += windows.json
-- 
1.7.10.4


From 6338d13b9ed413f68af28d112ca6d5c59e9df45d Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
Date: Fri, 14 Dec 2012 11:51:28 +0200
Subject: [PATCH 2/6] Fix installation of plugin module .pris in static Qt
 builds

When building Qt static, plugins get module .pri file, but those files
do not get installed in Windows. This is because both .pri generation
and install target statements are scoped with !build_pass, which means
Makefile.Debug and Makefile.Release do not get install_pritarget
target.

Fixed by doing only the .pri generation in !build_pass scope.

Task-number: QTBUG-28606
Change-Id: If3f49b578af1d9171a8bce67793ecb3f902a6da8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
(cherry picked from commit 4c5584f0a3c003106d07d0cf8b512108b9ff541a)

diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index f547e2d..6e5f27b 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -20,16 +20,18 @@ contains(QT_CONFIG, c++11):CONFIG += c++11
 contains(QT_CONFIG, static):CONFIG += static
 else:CONFIG += shared
 
-!build_pass:static {
+static {
     isEmpty(MODULE): MODULE = $$basename(TARGET)
 
     MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_plugin_$${MODULE}.pri
 
-    MODULE_PRI_CONT = \
-        "QT_PLUGIN.$${MODULE}.TYPE = $$PLUGIN_TYPE" \
-        "QT_PLUGIN.$${MODULE}.CLASS_NAME = $$PLUGIN_CLASS_NAME"
+    !build_pass {
+        MODULE_PRI_CONT = \
+            "QT_PLUGIN.$${MODULE}.TYPE = $$PLUGIN_TYPE" \
+            "QT_PLUGIN.$${MODULE}.CLASS_NAME = $$PLUGIN_CLASS_NAME"
 
-    write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
+        write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
+    }
 
     pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
     pritarget.files = $$MODULE_PRI
-- 
1.7.10.4


From f804729c85813fa0df696ccb3be8714e453c32f2 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Wed, 19 Dec 2012 23:44:05 +0100
Subject: [PATCH 3/6] fix QMAKE_MAKE for x-mingw

Change-Id: I694c74046a307c2887af1c30cca36f95e242adc1

diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index ff52c6b..39144e7 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -1,11 +1,15 @@
-equals(MAKEFILE_GENERATOR, UNIX): \
+equals(MAKEFILE_GENERATOR, UNIX) {
     QMAKE_MAKE = make
-else:equals(MAKEFILE_GENERATOR, MINGW): \
-    QMAKE_MAKE = mingw32-make
-else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)): \
+} else:equals(MAKEFILE_GENERATOR, MINGW) {
+    !equals(QMAKE_HOST.os, Windows): \
+        QMAKE_MAKE = make
+    else: \
+        QMAKE_MAKE = mingw32-make
+} else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) {
     QMAKE_MAKE = nmake
-else: \
+} else {
     error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.")
+}
 
 # Ensure that a cache is present. If none was found on startup, this will create
 # one in the build directory of the project which loads this feature.
-- 
1.7.10.4


From 413f3df786a1d12e0a7cb07cf8c0fd135f06e57f Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Sat, 22 Dec 2012 17:45:34 +0100
Subject: [PATCH 4/6] WIP: qmake writeFile(): work around concurrent
 QDir::mkpath() failure

This actually happened when building qtimageformats with make -j4.
Failure in mkspecs/features/qt_plugin.prf:
    write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") with make -j4.

Change-Id: Ibc685f613d721e178e6aff408905d77b0ce1740a

diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index bafa867..d8b03f7 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -310,9 +310,17 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
 {
     QFileInfo qfi(fn);
     if (!QDir::current().mkpath(qfi.path())) {
-        evalError(fL1S("Cannot create %1directory %2.")
-                  .arg(ctx, QDir::toNativeSeparators(qfi.path())));
-        return ReturnFalse;
+        // could have failed due to concurrent mkpath attempt
+#ifdef Q_OS_WIN
+       Sleep(1000);
+#else
+       sleep(1);
+#endif
+        if (!qfi.dir().exists()) {
+            evalError(fL1S("Cannot create %1directory %2.")
+                      .arg(ctx, QDir::toNativeSeparators(qfi.path())));
+            return ReturnFalse;
+        }
     }
     QString errStr;
     if (!doWriteFile(qfi.filePath(), mode, contents, &errStr)) {
-- 
1.7.10.4


From 240ea06f01981baa243684d183b7b7d2cd3ffe0a Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Fri, 11 Jan 2013 00:30:41 +0100
Subject: [PATCH 5/6] consolidate generation of metafile install targets

Metafiles such as .prl and .pc files contain paths that have to be
adjusted during installation. The same code is used for unix and
windows so move it into the base class.

Change-Id: I82db89ec83820a4fa0214ba15e7cd63438f6dc91

diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 0456d6b..c323625 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3285,4 +3285,25 @@ MakefileGenerator::writePkgConfigFile()
     t << endl;
 }
 
+QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const ProString &src, const QString &dst)
+{
+    QString ret;
+    if (project->isEmpty(replace_rule)
+        || project->isActiveConfig("no_sed_meta_install")
+        || project->isEmpty("QMAKE_STREAM_EDITOR")) {
+        ret += "-$(INSTALL_FILE) \"" + src + "\" \"" + dst + "\"";
+    } else {
+        ret += "-$(SED)";
+        const ProStringList &replace_rules = project->values(replace_rule);
+        for (int r = 0; r < replace_rules.size(); ++r) {
+            const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
+                        replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
+            if (!match.isEmpty() /*&& match != replace*/)
+                ret += " -e \"s," + match + "," + replace + ",g\"";
+        }
+        ret += " \"" + src + "\" >\"" + dst + "\"";
+    }
+    return ret;
+}
+
 QT_END_NAMESPACE
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 0b471d0..5bae827 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -248,6 +248,8 @@ protected:
     inline QStringList fileFixify(const QStringList& files, FileFixifyType fix, bool canon=true) const
     { return fileFixify(files, QString(), QString(), fix, canon); }
 
+    QString installMetaFile(const ProKey &replace_rule, const ProString &src, const QString &dst);
+
 public:
     MakefileGenerator();
     virtual ~MakefileGenerator();
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 8a1a29c..77995eb 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -868,32 +868,15 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
                 if(!uninst.isEmpty())
                     uninst.append("\n\t");
                 uninst.append("-$(DEL_FILE) \"" + dst_meta + "\"");
-                const ProKey replace_rule("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE");
                 const QString dst_meta_dir = fileInfo(dst_meta).path();
                 if(!dst_meta_dir.isEmpty()) {
                     if(!ret.isEmpty())
                         ret += "\n\t";
                     ret += mkdir_p_asstring(dst_meta_dir, true);
                 }
-                QString install_meta = "$(INSTALL_FILE) \"" + src_meta + "\" \"" + dst_meta + "\"";
-                if(project->isEmpty(replace_rule) || project->isActiveConfig("no_sed_meta_install")) {
-                    if(!ret.isEmpty())
-                        ret += "\n\t";
-                    ret += "-" + install_meta;
-                } else {
-                    if(!ret.isEmpty())
-                        ret += "\n\t";
-                    ret += "-$(SED)";
-                    const ProStringList &replace_rules = project->values(replace_rule);
-                    for(int r = 0; r < replace_rules.size(); ++r) {
-                        const ProString &match = project->first(ProKey(replace_rules.at(r) + ".match")),
-                                    &replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
-                        if(!match.isEmpty() /*&& match != replace*/)
-                            ret += " -e \"s," + match + "," + replace + ",g\"";
-                    }
-                    ret += " \"" + src_meta + "\" >\"" + dst_meta + "\"";
-                    //ret += " || " + install_meta;
-                }
+                if (!ret.isEmpty())
+                    ret += "\n\t";
+                ret += installMetaFile(ProKey("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE"), ProString(src_meta), dst_meta);
             }
         }
     }
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index fc98c3d..a614bf9 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -846,22 +846,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
                 }
                 if(!ret.isEmpty())
                     ret += "\n\t";
-                const ProKey replace_rule("QMAKE_PKGCONFIG_INSTALL_REPLACE");
-                if (project->isEmpty(replace_rule)
-                    || project->isActiveConfig("no_sed_meta_install")
-                    || project->isEmpty("QMAKE_STREAM_EDITOR")) {
-                    ret += "-$(INSTALL_FILE) \"" + pkgConfigFileName(true) + "\" \"" + dst_pc + "\"";
-                } else {
-                    ret += "-$(SED)";
-                    const ProStringList &replace_rules = project->values(replace_rule);
-                    for (int r = 0; r < replace_rules.size(); ++r) {
-                        const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
-                                    replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
-                        if (!match.isEmpty() /*&& match != replace*/)
-                            ret += " -e \"s," + match + "," + replace + ",g\"";
-                    }
-                    ret += " \"" + pkgConfigFileName(true) + "\" >\"" + dst_pc + "\"";
-                }
+                ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), ProString(pkgConfigFileName(true)), dst_pc);
                 if(!uninst.isEmpty())
                     uninst.append("\n\t");
                 uninst.append("-$(DEL_FILE) \"" + dst_pc + "\"");
-- 
1.7.10.4


From 97b4255f44a5e07b2c0bef4819e4c286d989a6be Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Fri, 11 Jan 2013 00:30:25 +0100
Subject: [PATCH 6/6] adjust paths in installed prl files for windows

Task-number: QTBUG-28902
Change-Id: Ice9983a69813690c0d4b96ca11589440182569a0

diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 22cec4d..a436a8c 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -173,6 +173,7 @@ load(qt_installs)
 
 unix|win32-g++* {
    CONFIG += create_pc
+   QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
    QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
    QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
    QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
@@ -190,7 +191,6 @@ unix|win32-g++* {
 
 unix {
    CONFIG += create_libtool explicitlib
-   QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
    QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
    QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
 }
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 6e5f27b..9851e1e 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -47,3 +47,15 @@ load(qt_targets)
 
 wince*:LIBS += $$QMAKE_LIBS_GUI
 QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+
+unix|win32-g++* {
+   QMAKE_PRL_INSTALL_REPLACE += lib_replace
+   !isEmpty(_QMAKE_SUPER_CACHE_): \
+      rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
+   else:!isEmpty(MODULE_QMAKE_OUTDIR): \
+      rplbase = $$MODULE_QMAKE_OUTDIR
+   else: \
+      rplbase = $$[QT_INSTALL_PREFIX/get]
+   lib_replace.match = $$rplbase/lib
+   lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+}
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index a614bf9..bc692e5 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -829,7 +829,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
             if(slsh != -1)
                 dst_prl = dst_prl.right(dst_prl.length() - slsh - 1);
             dst_prl = filePrefixRoot(root, targetdir + dst_prl);
-            ret += "-$(INSTALL_FILE) \"" + project->first("QMAKE_INTERNAL_PRL_FILE") + "\" \"" + dst_prl + "\"";
+            ret += installMetaFile(ProKey("QMAKE_PRL_INSTALL_REPLACE"), project->first("QMAKE_INTERNAL_PRL_FILE"), dst_prl);
             if(!uninst.isEmpty())
                 uninst.append("\n\t");
             uninst.append("-$(DEL_FILE) \"" + dst_prl + "\"");
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index e5da5bd..7b1c4ee 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -25,3 +25,13 @@ TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end
 load(qt_targets)
 
 wince*:QMAKE_POST_LINK =
+
+unix|win32-g++* {
+   QMAKE_PRL_INSTALL_REPLACE += lib_replace
+   !isEmpty(_QMAKE_SUPER_CACHE_): \
+      rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
+   else: \
+      rplbase = $$[QT_INSTALL_PREFIX/get]
+   lib_replace.match = $$rplbase/lib
+   lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+}
-- 
1.7.10.4