Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Utilities/Release/macos/qt-5.9.9-macosx10.10-x86_64-arm64.bash
3153 views
1
#!/usr/bin/env bash
2
3
# Run this script on a macOS x86_64 host to generate Qt universal binaries.
4
#
5
# This script requires the 'makeuniversal' tool from:
6
#
7
# https://github.com/fizzyade/makeuniversal
8
#
9
# Build it with an existing local Qt installation first.
10
#
11
# Set the PATH environment variable to contain the location of 'makeuniversal'.
12
13
set -e
14
set -x
15
16
umask 022
17
18
# Verify that 'makeuniversal' is available in the PATH.
19
type -p makeuniversal >/dev/null
20
21
# Download, verify, and extract sources.
22
curl -OL https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz
23
shasum -a 256 qt-everywhere-opensource-src-5.9.9.tar.xz | grep -q 5ce285209290a157d7f42ec8eb22bf3f1d76f2e03a95fc0b99b553391be01642
24
tar xjf qt-everywhere-opensource-src-5.9.9.tar.xz
25
patch -p0 < "${BASH_SOURCE%/*}/qt-5.9.9.patch"
26
27
# Build the x86_64 variant.
28
mkdir qt-5.9.9-x86_64
29
cd qt-5.9.9-x86_64
30
../qt-everywhere-opensource-src-5.9.9/configure \
31
--prefix=/ \
32
-platform macx-clang \
33
-device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \
34
-device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 \
35
-release \
36
-opensource -confirm-license \
37
-gui \
38
-widgets \
39
-no-gif \
40
-no-icu \
41
-no-pch \
42
-no-angle \
43
-no-opengl \
44
-no-dbus \
45
-no-harfbuzz \
46
-skip declarative \
47
-skip multimedia \
48
-skip qtcanvas3d \
49
-skip qtcharts \
50
-skip qtconnectivity \
51
-skip qtdeclarative \
52
-skip qtgamepad \
53
-skip qtlocation \
54
-skip qtmultimedia \
55
-skip qtnetworkauth \
56
-skip qtpurchasing \
57
-skip qtremoteobjects \
58
-skip qtscript \
59
-skip qtsensors \
60
-skip qtserialbus \
61
-skip qtserialport \
62
-skip qtsvg \
63
-skip qtwebchannel \
64
-skip qtwebengine \
65
-skip qtwebsockets \
66
-skip qtxmlpatterns \
67
-nomake examples \
68
-nomake tests \
69
-nomake tools
70
make -j 8
71
cd ..
72
73
# Build the arm64 variant.
74
mkdir qt-5.9.9-arm64
75
cd qt-5.9.9-arm64
76
../qt-everywhere-opensource-src-5.9.9/configure \
77
--prefix=/ \
78
-platform macx-clang \
79
-device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \
80
-device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 \
81
-release \
82
-opensource -confirm-license \
83
-gui \
84
-widgets \
85
-no-gif \
86
-no-icu \
87
-no-pch \
88
-no-angle \
89
-no-opengl \
90
-no-dbus \
91
-no-harfbuzz \
92
-skip declarative \
93
-skip multimedia \
94
-skip qtcanvas3d \
95
-skip qtcharts \
96
-skip qtconnectivity \
97
-skip qtdeclarative \
98
-skip qtgamepad \
99
-skip qtlocation \
100
-skip qtmultimedia \
101
-skip qtnetworkauth \
102
-skip qtpurchasing \
103
-skip qtremoteobjects \
104
-skip qtscript \
105
-skip qtsensors \
106
-skip qtserialbus \
107
-skip qtserialport \
108
-skip qtsvg \
109
-skip qtwebchannel \
110
-skip qtwebengine \
111
-skip qtwebsockets \
112
-skip qtxmlpatterns \
113
-nomake examples \
114
-nomake tests \
115
-nomake tools
116
# Some executables fail to link due to architecture mismatch.
117
# Build what we can first.
118
make -j 8 -k || true
119
# Provide needed executables using the x86_64 variants.
120
cp ../qt-5.9.9-x86_64/qtbase/bin/uic qtbase/bin/uic
121
install_name_tool -add_rpath @executable_path/../../../qt-5.9.9-x86_64/qtbase/lib qtbase/bin/uic
122
cp ../qt-5.9.9-x86_64/qtbase/bin/qlalr qtbase/bin/qlalr
123
install_name_tool -add_rpath @executable_path/../../../qt-5.9.9-x86_64/qtbase/lib qtbase/bin/qlalr
124
# Some parts still fail to build, but the parts we need can finish.
125
make -j 8 -k || true
126
cd ..
127
128
# Combine the two builds into universal binaries.
129
makeuniversal qt-5.9.9-univ qt-5.9.9-x86_64 qt-5.9.9-arm64
130
cd qt-5.9.9-univ
131
make install -j 8 INSTALL_ROOT=/tmp/qt-5.9.9-macosx10.10-x86_64-arm64
132
cd ..
133
134
# Create the final tarball containing universal binaries.
135
tar cjf qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz -C /tmp qt-5.9.9-macosx10.10-x86_64-arm64
136
137