Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / qt-5 / 5.15 / qtbase.patch.d / 0014-aarch64-darwin.patch
blobf0809f8f9a3f386718ec7d38c1c010225ff27e9d
1 From abc52460201bc5c7603505bb187138b0c59291aa Mon Sep 17 00:00:00 2001
2 From: Mushroom <mushroom@watchingyour.tv>
3 Date: Sun, 20 Dec 2020 00:11:41 +0000
4 Subject: [PATCH] [QtBase] Split macOS platforms by architecture
6 Currently macOS only has one platform, which forces the default arch to
7 x86_64. This patch splits the platforms by architecture, and defaults to
8 the same as the host.
10 This stops M1-based macs from compiling x64 binaries by default,
11 instead making them compile native binaries.
13 [ChangeLog][QtBase][Platform Specific Changes][OS X] Split macOS
14 platforms so it doesn't default to the x64 architecture every time
16 Change-Id: I34891b107bb24f68371df1c8f087eb0ad5b5dd95
17 ---
18 configure | 9 +++-
19 .../clang-macx-desktop.conf} | 8 ++--
20 mkspecs/common/macx.conf | 1 -
21 .../Info.plist.app | 0
22 .../Info.plist.dSYM.in | 0
23 .../Info.plist.disable_highdpi | 0
24 .../Info.plist.lib | 0
25 mkspecs/macx-clang-arm64/qmake.conf | 7 ++++
26 .../qplatformdefs.h | 0
27 mkspecs/macx-clang-x64/Info.plist.app | 24 +++++++++++
28 mkspecs/macx-clang-x64/Info.plist.dSYM.in | 18 ++++++++
29 .../macx-clang-x64/Info.plist.disable_highdpi | 8 ++++
30 mkspecs/macx-clang-x64/Info.plist.lib | 20 +++++++++
31 mkspecs/macx-clang-x64/qmake.conf | 7 ++++
32 mkspecs/macx-clang-x64/qplatformdefs.h | 41 +++++++++++++++++++
33 15 files changed, 137 insertions(+), 6 deletions(-)
34 rename mkspecs/{macx-clang/qmake.conf => common/clang-macx-desktop.conf} (83%)
35 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.app (100%)
36 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.dSYM.in (100%)
37 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.disable_highdpi (100%)
38 rename mkspecs/{macx-clang => macx-clang-arm64}/Info.plist.lib (100%)
39 create mode 100644 mkspecs/macx-clang-arm64/qmake.conf
40 rename mkspecs/{macx-clang => macx-clang-arm64}/qplatformdefs.h (100%)
41 create mode 100644 mkspecs/macx-clang-x64/Info.plist.app
42 create mode 100644 mkspecs/macx-clang-x64/Info.plist.dSYM.in
43 create mode 100644 mkspecs/macx-clang-x64/Info.plist.disable_highdpi
44 create mode 100644 mkspecs/macx-clang-x64/Info.plist.lib
45 create mode 100644 mkspecs/macx-clang-x64/qmake.conf
46 create mode 100644 mkspecs/macx-clang-x64/qplatformdefs.h
48 diff --git a/configure b/configure
49 index b6c9b462f24..a86f2ceaa5b 100755
50 --- a/configure
51 +++ b/configure
52 @@ -556,7 +556,14 @@ PLATFORM_NOTES=
53 if [ -z "$PLATFORM" ]; then
54 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
55 Darwin:*)
56 - PLATFORM=macx-clang
57 + case "$UNAME_MACHINE" in
58 + arm64)
59 + PLATFORM=macx-clang-arm64
60 + ;;
61 + *)
62 + PLATFORM=macx-clang-x64
63 + ;;
64 + esac
66 AIX:*)
67 #PLATFORM=aix-g++
68 diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/common/clang-macx-desktop.conf
69 similarity index 83%
70 rename from mkspecs/macx-clang/qmake.conf
71 rename to mkspecs/common/clang-macx-desktop.conf
72 index 0cf1f31b60d..042319a2aa3 100644
73 --- a/mkspecs/macx-clang/qmake.conf
74 +++ b/mkspecs/common/clang-macx-desktop.conf
75 @@ -24,9 +24,9 @@ QMAKE_LIBS_X11 = -lX11 -lXext -lm
76 QMAKE_LIBDIR_X11 = /opt/X11/lib
77 QMAKE_INCDIR_X11 = /opt/X11/include
79 -include(../common/macx.conf)
80 -include(../common/gcc-base-mac.conf)
81 -include(../common/clang.conf)
82 -include(../common/clang-mac.conf)
83 +include(macx.conf)
84 +include(gcc-base-mac.conf)
85 +include(clang.conf)
86 +include(clang-mac.conf)
88 load(qt_config)
89 diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang-arm64/Info.plist.app
90 similarity index 100%
91 rename from mkspecs/macx-clang/Info.plist.app
92 rename to mkspecs/macx-clang-arm64/Info.plist.app
93 diff --git a/mkspecs/macx-clang/Info.plist.dSYM.in b/mkspecs/macx-clang-arm64/Info.plist.dSYM.in
94 similarity index 100%
95 rename from mkspecs/macx-clang/Info.plist.dSYM.in
96 rename to mkspecs/macx-clang-arm64/Info.plist.dSYM.in
97 diff --git a/mkspecs/macx-clang/Info.plist.disable_highdpi b/mkspecs/macx-clang-arm64/Info.plist.disable_highdpi
98 similarity index 100%
99 rename from mkspecs/macx-clang/Info.plist.disable_highdpi
100 rename to mkspecs/macx-clang-arm64/Info.plist.disable_highdpi
101 diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang-arm64/Info.plist.lib
102 similarity index 100%
103 rename from mkspecs/macx-clang/Info.plist.lib
104 rename to mkspecs/macx-clang-arm64/Info.plist.lib
105 diff --git a/mkspecs/macx-clang-arm64/qmake.conf b/mkspecs/macx-clang-arm64/qmake.conf
106 new file mode 100644
107 index 00000000000..0cc2361e696
108 --- /dev/null
109 +++ b/mkspecs/macx-clang-arm64/qmake.conf
110 @@ -0,0 +1,7 @@
112 +# qmake configuration for Clang on OS X (arm64)
115 +QMAKE_APPLE_DEVICE_ARCHS=arm64
117 +include(../common/clang-macx-desktop.conf)
118 diff --git a/mkspecs/macx-clang/qplatformdefs.h b/mkspecs/macx-clang-arm64/qplatformdefs.h
119 similarity index 100%
120 rename from mkspecs/macx-clang/qplatformdefs.h
121 rename to mkspecs/macx-clang-arm64/qplatformdefs.h
122 diff --git a/mkspecs/macx-clang-x64/Info.plist.app b/mkspecs/macx-clang-x64/Info.plist.app
123 new file mode 100644
124 index 00000000000..fa592af0897
125 --- /dev/null
126 +++ b/mkspecs/macx-clang-x64/Info.plist.app
127 @@ -0,0 +1,24 @@
128 +<?xml version="1.0" encoding="UTF-8"?>
129 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
130 +<plist version="1.0">
131 +<dict>
132 + <key>CFBundleExecutable</key>
133 + <string>${EXECUTABLE_NAME}</string>
134 + <key>CFBundleIconFile</key>
135 + <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
136 + <key>CFBundleIdentifier</key>
137 + <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
138 + <key>CFBundlePackageType</key>
139 + <string>APPL</string>
140 + <key>CFBundleSignature</key>
141 + <string>${QMAKE_PKGINFO_TYPEINFO}</string>
142 + <key>LSMinimumSystemVersion</key>
143 + <string>${MACOSX_DEPLOYMENT_TARGET}</string>
144 + <key>NOTE</key>
145 + <string>This file was generated by Qt/QMake.</string>
146 + <key>NSPrincipalClass</key>
147 + <string>NSApplication</string>
148 + <key>NSSupportsAutomaticGraphicsSwitching</key>
149 + <true/>
150 +</dict>
151 +</plist>
152 diff --git a/mkspecs/macx-clang-x64/Info.plist.dSYM.in b/mkspecs/macx-clang-x64/Info.plist.dSYM.in
153 new file mode 100644
154 index 00000000000..a8c8d0d4fb5
155 --- /dev/null
156 +++ b/mkspecs/macx-clang-x64/Info.plist.dSYM.in
157 @@ -0,0 +1,18 @@
158 +<?xml version=\"1.0\" encoding=\"UTF-8\"?>
159 +<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
160 +<plist version=\"1.0\">
161 + <dict>
162 + <key>CFBundleIdentifier</key>
163 + <string>com.apple.xcode.dsym.$${BUNDLEIDENTIFIER}</string>
164 + <key>CFBundlePackageType</key>
165 + <string>dSYM</string>
166 + <key>CFBundleSignature</key>
167 + <string>????</string>
168 +!!IF !isEmpty(VERSION)
169 + <key>CFBundleShortVersionString</key>
170 + <string>$${VER_MAJ}.$${VER_MIN}</string>
171 + <key>CFBundleVersion</key>
172 + <string>$${VER_MAJ}.$${VER_MIN}.$${VER_PAT}</string>
173 +!!ENDIF
174 + </dict>
175 +</plist>
176 diff --git a/mkspecs/macx-clang-x64/Info.plist.disable_highdpi b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi
177 new file mode 100644
178 index 00000000000..a9b89888ad4
179 --- /dev/null
180 +++ b/mkspecs/macx-clang-x64/Info.plist.disable_highdpi
181 @@ -0,0 +1,8 @@
182 +<?xml version="1.0" encoding="UTF-8"?>
183 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
184 +<plist version="1.0">
185 +<dict>
186 + <key>NSHighResolutionCapable</key>
187 + <string>NO</string>
188 +</dict>
189 +</plist>
190 diff --git a/mkspecs/macx-clang-x64/Info.plist.lib b/mkspecs/macx-clang-x64/Info.plist.lib
191 new file mode 100644
192 index 00000000000..34752ec40d9
193 --- /dev/null
194 +++ b/mkspecs/macx-clang-x64/Info.plist.lib
195 @@ -0,0 +1,20 @@
196 +<?xml version="1.0" encoding="UTF-8"?>
197 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
198 +<plist version="1.0">
199 +<dict>
200 + <key>CFBundleExecutable</key>
201 + <string>${EXECUTABLE_NAME}</string>
202 + <key>CFBundleIdentifier</key>
203 + <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
204 + <key>CFBundlePackageType</key>
205 + <string>FMWK</string>
206 + <key>CFBundleShortVersionString</key>
207 + <string>${QMAKE_SHORT_VERSION}</string>
208 + <key>CFBundleSignature</key>
209 + <string>${QMAKE_PKGINFO_TYPEINFO}</string>
210 + <key>CFBundleVersion</key>
211 + <string>${QMAKE_FULL_VERSION}</string>
212 + <key>NOTE</key>
213 + <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
214 +</dict>
215 +</plist>
216 diff --git a/mkspecs/macx-clang-x64/qmake.conf b/mkspecs/macx-clang-x64/qmake.conf
217 new file mode 100644
218 index 00000000000..1ac373b53b4
219 --- /dev/null
220 +++ b/mkspecs/macx-clang-x64/qmake.conf
221 @@ -0,0 +1,7 @@
223 +# qmake configuration for Clang on OS X (arm64)
226 +QMAKE_APPLE_DEVICE_ARCHS=x86_64
228 +include(../common/clang-macx-desktop.conf)
229 diff --git a/mkspecs/macx-clang-x64/qplatformdefs.h b/mkspecs/macx-clang-x64/qplatformdefs.h
230 new file mode 100644
231 index 00000000000..063491dd900
232 --- /dev/null
233 +++ b/mkspecs/macx-clang-x64/qplatformdefs.h
234 @@ -0,0 +1,41 @@
235 +/****************************************************************************
237 +** Copyright (C) 2016 The Qt Company Ltd.
238 +** Contact: https://www.qt.io/licensing/
240 +** This file is part of the qmake spec of the Qt Toolkit.
242 +** $QT_BEGIN_LICENSE:LGPL$
243 +** Commercial License Usage
244 +** Licensees holding valid commercial Qt licenses may use this file in
245 +** accordance with the commercial license agreement provided with the
246 +** Software or, alternatively, in accordance with the terms contained in
247 +** a written agreement between you and The Qt Company. For licensing terms
248 +** and conditions see https://www.qt.io/terms-conditions. For further
249 +** information use the contact form at https://www.qt.io/contact-us.
251 +** GNU Lesser General Public License Usage
252 +** Alternatively, this file may be used under the terms of the GNU Lesser
253 +** General Public License version 3 as published by the Free Software
254 +** Foundation and appearing in the file LICENSE.LGPL3 included in the
255 +** packaging of this file. Please review the following information to
256 +** ensure the GNU Lesser General Public License version 3 requirements
257 +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
259 +** GNU General Public License Usage
260 +** Alternatively, this file may be used under the terms of the GNU
261 +** General Public License version 2.0 or (at your option) the GNU General
262 +** Public license version 3 or any later version approved by the KDE Free
263 +** Qt Foundation. The licenses are as published by the Free Software
264 +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
265 +** included in the packaging of this file. Please review the following
266 +** information to ensure the GNU General Public License requirements will
267 +** be met: https://www.gnu.org/licenses/gpl-2.0.html and
268 +** https://www.gnu.org/licenses/gpl-3.0.html.
270 +** $QT_END_LICENSE$
272 +****************************************************************************/
274 +#include "../common/mac/qplatformdefs.h"