-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
245 lines (218 loc) · 5.67 KB
/
Makefile
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
ROOT_DIR=${CURDIR}
PLATFORMS_SUPPORTED=win linux macos
ARCH:=x86_64
ifeq (${OS},Windows_NT)
PLATFORM:=win
else
UNAME_S=${shell uname -s}
ifeq (${UNAME_S},Linux)
PLATFORM:=linux
endif
ifeq (${UNAME_S},Darwin)
PLATFORM:=macos
ARCH:=${shell uname -m}
endif
endif
ifeq ($(filter ${PLATFORM},${PLATFORMS_SUPPORTED}),)
${error Platform not detected or unsupported.}
endif
#BASE_URL=https://qt-mirror.dannhauer.de
#BASE_URL=https://ftp.fau.de/qtproject
#BASE_URL=http://www.mirrorservice.org/sites/download.qt-project.org
BASE_URL=https://download.qt.io
QT_VER_FULL=6.7.2
QT_VER_SHORT=6.7
ifeq (${PLATFORM},win)
QT_SRC_FILE=qt-everywhere-src-${QT_VER_FULL}.zip
QT_SRC_MD5=69c87bb306ab78b988fb69819c32f3de
QT_SRC_URL=${BASE_URL}/official_releases/qt/${QT_VER_SHORT}/${QT_VER_FULL}/single/${QT_SRC_FILE}
else
QT_SRC_FILE=qt-everywhere-src-${QT_VER_FULL}.tar.xz
QT_SRC_MD5=06d35b47349c7c0a45710daad359e07b
QT_SRC_URL=${BASE_URL}/official_releases/qt/${QT_VER_SHORT}/${QT_VER_FULL}/single/${QT_SRC_FILE}
endif
QT_SRC_DIR=qt-everywhere-src-${QT_VER_FULL}
QT_BUILD_DIR=${QT_SRC_DIR}/build
QT_PREFIX=${ROOT_DIR}/qt
ifeq (${PLATFORM},linux)
PLATFORM_QT_CONFIGURE=configure
#-ccache
PLATFORM_QT_OPTIONS=-xcb -gtk -linker gold
# -linker gold https://bugreports.qt.io/browse/QTBUG-76196
endif
ifeq (${PLATFORM},macos)
PLATFORM_QT_CONFIGURE=configure
PLATFORM_QT_OPTIONS=-dbus-runtime -device-option QMAKE_APPLE_DEVICE_ARCHS=${ARCH}
endif
ifeq (${PLATFORM},win)
PLATFORM_QT_CONFIGURE=configure.bat
PLATFORM_QT_OPTIONS=-skip qtwayland -skip qtmacextras -skip qtx11extras
endif
BUILD_THREADS:=4
PACKAGE_FILE=cutter-deps-qt-${PLATFORM}-${ARCH}.tar.gz
all: qt pkg
ifeq (${PLATFORM},macos)
define check_md5
if [ "`md5 -r \"$1\"`" != "$2 $1" ]; then \
echo "MD5 mismatch for file $1"; \
exit 1; \
else \
echo "$1 OK"; \
fi
endef
else
define check_md5
echo "$2 $1" | md5sum -c -
endef
endif
ifeq (${PLATFORM},win)
define extract
7z x "$1" -bsp1 \
-x'!'${QT_SRC_DIR}/qtwebengine \
-x'!'${QT_SRC_DIR}/qt3d \
-x'!'${QT_SRC_DIR}/qtcanvas3d \
-x'!'${QT_SRC_DIR}/qtcharts \
-x'!'${QT_SRC_DIR}/qtconnectivity \
-x'!'${QT_SRC_DIR}/qtdeclarative \
-x'!'${QT_SRC_DIR}/qtdoc \
-x'!'${QT_SRC_DIR}/qtscript \
-x'!'${QT_SRC_DIR}/qtdatavis3d \
-x'!'${QT_SRC_DIR}/qtgamepad \
-x'!'${QT_SRC_DIR}/qtlocation \
-x'!'${QT_SRC_DIR}/qtgraphicaleffects \
-x'!'${QT_SRC_DIR}/qtmultimedia \
-x'!'${QT_SRC_DIR}/qtpurchasing \
-x'!'${QT_SRC_DIR}/qtscxml \
-x'!'${QT_SRC_DIR}/qtsensors \
-x'!'${QT_SRC_DIR}/qtserialbus \
-x'!'${QT_SRC_DIR}/qtserialport \
-x'!'${QT_SRC_DIR}/qtspeech \
-x'!'${QT_SRC_DIR}/qttranslations \
-x'!'${QT_SRC_DIR}/qtvirtualkeyboard \
-x'!'${QT_SRC_DIR}/qtwebglplugin \
-x'!'${QT_SRC_DIR}/qtwebsockets \
-x'!'${QT_SRC_DIR}/qtwebview \
-x'!'${QT_SRC_DIR}/qtmacextras \
-x'!'${QT_SRC_DIR}/qtwayland \
-x'!'${QT_SRC_DIR}/qtquickcontrols \
-x'!'${QT_SRC_DIR}/qtquickcontrols2 \
-x'!'${QT_SRC_DIR}/qtx11extras \
-x'!'${QT_SRC_DIR}/qtandroidextras \
-x'!'${QT_SRC_DIR}/qtwebchannel
endef
else
define extract
tar -xf "$1"
endef
endif
define download_extract
curl -L "$1" -o "$2"
${call check_md5,$2,$3}
$(call extract,$2)
endef
PLATFORM_QT_DEPS=
PLATFORM_CLEAN_DEPS=
.PHONY: clean
clean: clean-qt ${PLATFORM_CLEAN_DEPS}
.PHONY: distclean
distclean: distclean-qt ${PLATFORM_CLEAN_DEPS}
${QT_SRC_DIR}:
@echo ""
@echo "#########################"
@echo "# Downloading Qt Source #"
@echo "#########################"
@echo ""
$(call download_extract,${QT_SRC_URL},${QT_SRC_FILE},${QT_SRC_MD5})
# Add patches here if required
.PHONY: src
src: ${QT_SRC_DIR}
qt: ${QT_SRC_DIR} ${PLATFORM_QT_DEPS}
@echo ""
@echo "#########################"
@echo "# Building Qt #"
@echo "#########################"
@echo ""
# -nomake tools
mkdir -p "${QT_BUILD_DIR}"
cd "${QT_BUILD_DIR}" && \
../${PLATFORM_QT_CONFIGURE} \
-prefix "${QT_PREFIX}" \
-opensource -confirm-license \
-release \
-qt-libpng \
-qt-libjpeg \
-no-feature-cups \
-no-feature-icu \
-no-sql-db2 \
-no-sql-ibase \
-no-sql-mysql \
-no-sql-oci \
-no-sql-odbc \
-no-sql-psql \
-no-sql-sqlite \
-no-feature-assistant \
-no-feature-designer \
-nomake tests \
-nomake examples \
-skip qt3d \
-skip qtactiveqt \
-skip qtcharts \
-skip qtcoap \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdeclarative \
-skip qtdoc \
-skip qtgraphs \
-skip qtgrpc \
-skip qthttpserver \
-skip qtlanguageserver \
-skip qtlocation \
-skip qtlottie \
-skip qtmqtt \
-skip qtmultimedia \
-skip qtnetworkauth \
-skip qtopcua \
-skip qtpositioning \
-skip qtquick3d \
-skip qtquick3dphysics \
-skip qtquickeffectmaker \
-skip qtquicktimeline \
-skip qtremoteobjects \
-skip qtscxml \
-skip qtsensors \
-skip qtserialbus \
-skip qtserialport \
-skip qtshadertools \
-skip qtspeech \
-skip qttranslations \
-skip qtvirtualkeyboard \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebsockets \
-skip qtwebview \
-DCMAKE_WrapClang_FOUND=false \
${PLATFORM_QT_OPTIONS}
cmake --build "${QT_BUILD_DIR}" -j ${BUILD_THREADS}
cmake --install "${QT_BUILD_DIR}"
ifeq (${PLATFORM},macos)
cd "${QT_PREFIX}/include" && \
for header_dir in ../lib/*.framework/Headers; do \
module="$${header_dir%.framework/Headers}"; \
module="$${module#../lib/}"; \
ln -s "$$header_dir" "$$module"; \
done
endif
.PHONY: clean-qt
clean-qt:
rm -f "${QT_SRC_FILE}"
rm -rf "${QT_SRC_DIR}"
.PHONY: distclean-qt
distclean-qt: clean-qt
rm -rf "${QT_PREFIX}"
${PACKAGE_FILE}: qt
tar -czf "${PACKAGE_FILE}" qt
.PHONY: pkg
pkg: ${PACKAGE_FILE}
.PHONY: distclean-pkg
distclean-pkg:
rm -f "${PACKAGE_FILE}"