Build sanity checks
[novacoin.git] / mingw64_deps / qt / build.sh
1 #!/bin/bash
2
3 CROSS=$1
4 ROOT=$(pwd)
5
6 if [[ ! "${CROSS}" =~ ^(aarch64|x86_64) ]]; then
7 echo "Platform ${CROSS} is not supported"
8 echo "Expected either aarch64 or x86_64."
9 exit 1
10 fi
11
12 if [[ ! $(which ${CROSS}-w64-mingw32-clang) ]]; then
13 echo "llvm-mingw is not installed, please download it from https://github.com/mstorsjo/llvm-mingw/releases"
14 echo "Untar downloaded archive and add its /bin directory to your PATH"
15 exit 1
16 fi
17
18 if [[ ! $(which cmake) ]]; then
19 echo "cmake is not installed, please install CMake >= 3.20 (e.g. pip3 install cmake)"
20 exit 1
21 fi
22
23 if [[ ! $(which make) ]]; then
24 echo "make is not installed, please install buld-essential package"
25 exit 1
26 fi
27
28 # Make build directories
29 mkdir ${ROOT}/${CROSS}-w64-mingw32-build
30 mkdir ${ROOT}/${CROSS}-w64-mingw32-build-qttools
31 mkdir ${ROOT}/${CROSS}-w64-mingw32-build-qttranslations
32 mkdir ${ROOT}/${CROSS}-w64-mingw32-build-qtdeclarative
33
34 # Stage directory
35 mkdir ${ROOT}/${CROSS}-w64-mingw32
36
37 # Compile Qt
38
39 cd ${ROOT}/${CROSS}-w64-mingw32-build
40 ${ROOT}/qtbase/configure -xplatform win32-clang-g++ --hostprefix=${ROOT}/${CROSS}-w64-mingw32 --prefix=${ROOT}/${CROSS}-w64-mingw32 -device-option CROSS_COMPILE=${CROSS}-w64-mingw32- -release -confirm-license -no-compile-examples -no-cups -no-egl -no-eglfs -no-evdev -no-icu -no-iconv -no-libproxy -no-openssl -no-reduce-relocations -no-schannel -no-sctp -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite  -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -no-zstd -nomake examples -nomake tests -nomake tools -opensource -qt-libpng -qt-pcre -qt-zlib -static -no-feature-bearermanagement -no-feature-colordialog -no-feature-concurrent -no-feature-dial -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5 -no-feature-sql -no-feature-sqlmodel -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-xml -no-dbus -no-opengl -no-freetype
41 make -j 4
42 make install
43 cd ${ROOT}
44 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build
45
46 # Compile Qt tools
47
48 cd ${ROOT}/${CROSS}-w64-mingw32-build-qttools
49 ${ROOT}/${CROSS}-w64-mingw32/bin/qmake ${ROOT}/qttools
50 make -j 4
51 make DESTDIR=${ROOT}/${CROSS}-w64-mingw32 install
52 cd ${ROOT}
53 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build-qttools
54
55 # Compile translations
56
57 cd ${ROOT}/${CROSS}-w64-mingw32-build-qttranslations
58 ${ROOT}/${CROSS}-w64-mingw32/bin/qmake ${ROOT}/qttranslations
59 make -j 4
60 make DESTDIR=${ROOT}/${CROSS}-w64-mingw32 install
61 cd ${ROOT}
62 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build-qttranslations
63
64 # Compile qtdeclarative
65
66 cd ${ROOT}/${CROSS}-w64-mingw32-build-qtdeclarative
67 ${ROOT}/${CROSS}-w64-mingw32/bin/qmake ${ROOT}/qtdeclarative
68 make -j 4
69 make DESTDIR=${ROOT}/${CROSS}-w64-mingw32 install
70 cd ${ROOT}
71 rm -rf ${ROOT}/${CROSS}-w64-mingw32-build-qtdeclarative