├── README.md ├── build-qt.sh ├── build-qtcreator.sh └── qt-creator-arm.patch /README.md: -------------------------------------------------------------------------------- 1 | # raspberry-pi-qt-builds 2 | 3 | Qt builds for the Raspberry Pi platform 4 | 5 | # Overview 6 | 7 | This project contains scripts for building Qt natively on the Raspberry Pi platform. It includes the Qt libraries and tools (e.g. qmake) for developing Qt-based applications on the Raspberry Pi. Also included are binaries (in the form of tar archives) for various versions of Qt that will run under the Raspbian Linux distribution. As building Qt natively is very time consuming, these are provided for the convenience of developers who want to use a recent version of Qt on the Raspberry Pi platform running Raspbian. 8 | 9 | Note that if you want to do significant Qt development for the Raspberry Pi, it is generally recommended to set up a cross-compiled development environment running on a faster desktop computer. While more complex to initially set up, this will usually pay off in reduced build times. 10 | 11 | Also note that Raspberry Pi OS includes packages for Qt 5.11.3. If this version is new enough for you, you may want to use the official Raspberry Pi OS Qt packages rather than the ones provided here. 12 | 13 | # Features 14 | 15 | These builds support the latest Qt "recommended" and "long term support" releases. The downloads include both a "full" version as well as a "minimal" version which does not include the Qt documentation or example applications. The builds are provided in the form of tar archives which can be extracted on a Raspberry Pi system running Raspbian. The table below lists the current binary builds. 16 | 17 | | Qt Version | Platform | Type | Options | Size | Comments | 18 | | ---------- | -------------- | -------| ------- | ------ | ------------------- | 19 | | 5.9.7 | Raspberry Pi 3 | Native | Full | 586MB | | 20 | | 5.9.7 | Raspberry Pi 3 | Native | Minimal | 51MB | No examples or docs | 21 | | 5.11.3 | Raspberry Pi 3 | Native | Full | 422MB | | 22 | | 5.11.3 | Raspberry Pi 3 | Native | Minimal | 61MB | No examples or docs | 23 | | 5.12.0 | Raspberry Pi 3 | Native | Full | 419MB | | 24 | | 5.12.0 | Raspberry Pi 3 | Native | Minimal | 58MB | No examples or docs | 25 | | 5.12.4 | Raspberry Pi 3 | Native | Full | 419MB | | 26 | | 5.12.4 | Raspberry Pi 3 | Native | Minimal | 58MB | No examples or docs | 27 | | 5.13.0 | Raspberry Pi 3 | Native | Full | 504MB | | 28 | | 5.13.0 | Raspberry Pi 3 | Native | Minimal | 58MB | No examples or docs | 29 | | 5.14.1 | Raspberry Pi 3 | Native | Minimal | 71MB | No examples or docs | 30 | | 5.15.2 | Raspberry Pi 4 | Native | Minimal | 67MB | No examples or docs | 31 | | 5.15.2 | Raspberry Pi 4 | Native | Full | 625MB | | 32 | | 6.1.0 | Raspberry Pi 4 | Native | Minimal | 64MB | No examples or docs | 33 | 34 | 35 | | Qt Creator Version | Platform | Type | Options | Size | Comments | 36 | | ------------------ | -------------- | -------| ------- | ------ | ----------------------- | 37 | | 4.6.2 | Raspberry Pi 3 | Native | Full | 41MB | Built against Qt 5.9.6 | 38 | | 4.6.2 | Raspberry Pi 3 | Native | Full | 41MB | Built against Qt 5.11.1 | 39 | | 4.7.2 | Raspberry Pi 3 | Native | Full | 25MB | Built against Qt 5.11.2 | 40 | | 4.8.0 | Raspberry Pi 3 | Native | Full | 25MB | Built against Qt 5.12.0 | 41 | 42 | The builds include most Qt modules (see below under "Known Issues and Limitations"). The following rendering back ends are included: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb. 43 | 44 | # Building 45 | 46 | If you want to build these images yourself, you can run the provided script (qtbuild.sh) on a Raspberry Pi system. It is recommended that you configure the system (using raspi-config) to boot into a text console and not run the graphical desktop. I have had issues with the Raspberry Pi rebooting during the build. If so, you can manually restart it. 47 | 48 | There are a number of packages which need to be installed in order to built Qt. Here is a list which may not be entirely complete or accurate (you can install them with sudo apt-get ): 49 | 50 | ``` 51 | autotools-dev bison build-essential default-libmysqlclient-dev 52 | dpkg-dev firebird-dev flex freetds-dev gstreamer1.0-alsa 53 | gstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-omx-rpi 54 | gstreamer1.0-omx-rpi-config gstreamer1.0-plugins-bad 55 | gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x 56 | icu-devtools libasound2-dev libatk1.0-dev libatk-bridge2.0-dev libassimp-dev 57 | libatspi2.0-dev libaudit-dev libavcodec-dev libavformat-dev 58 | libbison-dev libbsd-dev libc6-dev libcairo2-dev libcap-ng-dev libbluetooth-dev 59 | libc-dev-bin libcups2-dev libcupsimage2-dev libclang-dev libdbus-1-dev 60 | libdevmapper-dev libdmx-dev libdouble-conversion-dev libdrm-dev 61 | libegl1-mesa-dev libepoxy-dev libexpat1-dev libfontconfig1-dev 62 | libfontenc-dev libfreetype6-dev libgbm-dev libgcc-6-dev 63 | libgcrypt20-dev libgdk-pixbuf2.0-dev libgl1-mesa-dev libgles2-mesa-dev 64 | libglib2.0-dev libglu1-mesa-dev libgmp-dev libgpg-error-dev 65 | libgraphite2-dev libgstreamer1.0 libgstreamer1.0-0 libgstreamer1.0-dev 66 | libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0 67 | libgstreamer-plugins-base1.0-dev libgtk-3-dev libharfbuzz-dev 68 | libhunspell-dev libice-dev libicu-dev libinput-dev libjbig-dev 69 | libjpeg62-turbo-dev libjpeg-dev libltdl-dev liblzma-dev 70 | libmariadbclient-dev libmariadbclient-dev-compat libmnl-dev 71 | libmtdev-dev libpango1.0-dev libpciaccess-dev libpcre3-dev 72 | libpipeline-dev libpixman-1-dev libpng-dev libpq-dev libproxy-dev 73 | libpthread-stubs0-dev libpulse-dev libpython2.7-dev libpython3.5-dev 74 | libpython3-dev libpython-all-dev libpython-dev libqt5opengl5-dev 75 | libqt5webkit5-dev libraspberrypi-dev librtimulib-dev libselinux1-dev 76 | libsepol1-dev libsgutils2-dev libsm-dev libsqlite3-dev libssl-dev 77 | libstdc++-6-dev libswscale-dev libsystemd-dev libtiff5-dev libudev-dev 78 | libwayland-dev libx11-dev libx11-xcb1 libx11-xcb-dev libxau-dev 79 | libxaw7-dev libxcb1 libxcb1-dev libxcb-dri2-0-dev libxcb-dri3-dev 80 | libxcb-glx0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-image0 81 | libxcb-image0-dev libxcb-keysyms1 libxcb-keysyms1-dev 82 | libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev 83 | libxcb-render-util0 libxcb-render-util0-dev libxcb-shape0-dev 84 | libxcb-shm0 libxcb-shm0-dev libxcb-sync0-dev libxcb-sync1 85 | libxcb-sync-dev libxcb-util0-dev libxcb-xf86dri0-dev 86 | libxcb-xfixes0-dev libxcb-xinerama0 libxcb-xinerama0-dev 87 | libxcb-xkb-dev libxcb-xv0-dev libxcomposite-dev libxcursor-dev 88 | libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxfont-dev 89 | libxft-dev libxi-dev libxinerama-dev libxkbcommon-dev 90 | libxkbcommon-x11-dev libxkbfile-dev libxml2-dev libxmu-dev libxmuu-dev 91 | libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxshmfence-dev 92 | libxt-dev libxtst-dev libxv-dev libxxf86vm-dev linux-libc-dev 93 | manpages-dev mesa-common-dev nettle-dev python2.7-dev python3.5-dev 94 | python3-dev python3-smbus python-all-dev python-dev python-smbus 95 | qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qtdeclarative5-dev 96 | qtdeclarative5-private-dev qttools5-dev-tools ruby unixodbc-dev 97 | x11proto-bigreqs-dev x11proto-composite-dev x11proto-core-dev 98 | x11proto-damage-dev x11proto-dmx-dev x11proto-dri2-dev 99 | x11proto-dri3-dev x11proto-fixes-dev x11proto-fonts-dev 100 | x11proto-gl-dev x11proto-input-dev x11proto-kb-dev 101 | x11proto-present-dev x11proto-randr-dev x11proto-record-dev 102 | x11proto-render-dev x11proto-resource-dev x11proto-scrnsaver-dev 103 | x11proto-video-dev x11proto-xcmisc-dev x11proto-xext-dev 104 | x11proto-xf86bigfont-dev x11proto-xf86dga-dev x11proto-xf86dri-dev 105 | x11proto-xf86vidmode-dev x11proto-xinerama-dev xtrans-dev xutils-dev 106 | zlib1g-dev 107 | ``` 108 | 109 | Expect the build to take many hours on a Raspberry Pi 3 (on the order of eight hours for the minimal build, 24 hours for a full build). 110 | 111 | # Installing 112 | 113 | Download the desired binary archive, e.g. Qt5.10.1-RaspberryPi3-bin-full.tgz, and then install it using commands like this: 114 | 115 | ``` 116 | cd / 117 | sudo tar xf /home/pi/Qt5.10.1-RaspberryPi3-bin-full.tgz 118 | ``` 119 | 120 | Qt Creator can be installed in a similar way, e.g. 121 | ``` 122 | cd / 123 | sudo tar xf /home/pi/QtCreator4.6.2-Qt5.9.6-RaspberryPi3-bin.tgz 124 | ``` 125 | 126 | You can then run qmake specifying the full path, e.g. /usr/local/Qt-5.10.1/bin/qmake. You may want to add the Qt binary directory (e.g. /usr/local/Qt-5.10.1/bin) to your path. 127 | 128 | Qt Creator can be run as "qtcreator" (it gets installed in /usr/local/bin/qtcreator). 129 | 130 | # Known Issues and Limitations 131 | 132 | The binaries have only had minimal testing. Both the xcb and eglfs rendering back ends should work and there is support for both widgets and QML. 133 | 134 | The binaries support Raspbian Linux and the Raspberry Pi 3 only. 135 | 136 | The QtWebengine and QtLocation modules are not included as they require more memory to build than is available on a Raspberry Pi 3 (you might be able to compile them if you add swap space). 137 | 138 | Qt 5.11.0 and later requires a newer version of libclang to build the documentation than is currently available in Raspbian. The Qt documentation is currently not available in these builds. 139 | 140 | The Qt Creator binary is built against a specific version of Qt. That version needs to be installed in order to run it. You can install multiple versions of Qt if desired, provided that you have enough disk space. 141 | 142 | The software was built on a Raspian system based on the "stretch" release. It won't run on the older "jessie" release. 143 | 144 | It is not using hardware (GPU) OpenGL, so OpenGL performance will be poor. 145 | 146 | # Future Plans 147 | 148 | The following are some features that are being considered for the future: 149 | 150 | - Offer Debian format packages 151 | - Provide cross-compilation packages 152 | - Add builds for other Raspberry Pi models 153 | 154 | # References 155 | 156 | 1. https://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi 157 | 2. https://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi 158 | 159 | # Legal Disclaimer 160 | 161 | This software is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. in no event shall ICS or its contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. 162 | -------------------------------------------------------------------------------- /build-qt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Download and build Qt for desktop 4 | # 5 | # Usage: build-qt.sh [-h] [-n] -[] 6 | # Options: 7 | # 8 | # -h Help 9 | # -n No-execute, just show commands 10 | # - Perform build step , where is: 11 | # 12 | # 0 - download 13 | # 1 - extract source 14 | # 2 - configure 15 | # 3 - build 16 | # 4 - install 17 | # 5 - build docs 18 | # 6 - install docs 19 | # 7 - remove source 20 | # 8 - make tar file of build 21 | # 9 - remove install 22 | 23 | # Qt version to build 24 | VERSION_MAJOR=5 25 | VERSION_MINOR=15 26 | VERSION_PATCH=2 27 | 28 | # Set if needed for a beta or RC version, e.g. "-beta4" 29 | # Leave empty for release. 30 | VERSION_SUFFIX= 31 | 32 | # Build type, "full" or "minimal" 33 | #BUILD_TYPE="full" 34 | BUILD_TYPE="minimal" 35 | 36 | # Number of parallel jobs to run 37 | PAR=1 38 | 39 | # Stop on error 40 | set -e 41 | 42 | # Build directory 43 | BUILD_DIR=${HOME}/qtbuild 44 | 45 | # Parse command line options 46 | while getopts "hn0123456789" opt; do 47 | case $opt in 48 | h) 49 | echo "usage: $0 [-h] [-n] -[]" 50 | echo "" 51 | echo "Options:" 52 | echo " -h Help" 53 | echo " -n No-execute, just show commands" 54 | echo " - Perform only build step , where is:" 55 | echo " 0 - download" 56 | echo " 1 - extract source" 57 | echo " 2 - configure" 58 | echo " 3 - build" 59 | echo " 4 - install" 60 | echo " 5 - build docs" 61 | echo " 6 - install docs" 62 | echo " 7 - remove source" 63 | echo " 8 - make tar file of build" 64 | echo " 9 - remove install" 65 | exit 66 | ;; 67 | n) 68 | no_exec=1 69 | ;; 70 | 0) 71 | step_0=1 72 | ;; 73 | 1) 74 | step_1=1 75 | ;; 76 | 2) 77 | step_2=1 78 | ;; 79 | 3) 80 | step_3=1 81 | ;; 82 | 4) 83 | step_4=1 84 | ;; 85 | 5) 86 | step_5=1 87 | ;; 88 | 6) 89 | step_6=1 90 | ;; 91 | 7) 92 | step_7=1 93 | ;; 94 | 8) 95 | step_8=1 96 | ;; 97 | 9) 98 | step_9=1 99 | ;; 100 | \?) 101 | exit 102 | ;; 103 | esac 104 | done 105 | 106 | # If no build steps were specified, enable them all. 107 | if [ -z "$step_0$step_1$step_2$step_3$step_4$step_5$step_6$step_7$step_8$step_9" ] 108 | then 109 | step_0=1 110 | step_1=1 111 | step_2=1 112 | step_3=1 113 | step_4=1 114 | step_5=1 115 | step_6=1 116 | step_7=1 117 | step_8=1 118 | step_9=1 119 | fi 120 | 121 | # Generate name of archive file 122 | VER2="${VERSION_MAJOR}.${VERSION_MINOR}" 123 | VER3="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" 124 | SOURCE="qt-everywhere-src-${VER3}${VERSION_SUFFIX}.tar.xz" 125 | # Releases prior to Qt 5.10.0 use this format: 126 | #SOURCE="qt-everywhere-opensource-src-${VER3}${VERSION_SUFFIX}.tar.xz" 127 | 128 | # Name of source directory 129 | DIR=${BUILD_DIR}/`basename ${SOURCE} .tar.xz` 130 | 131 | # Name of created build archive file 132 | if [ ${BUILD_TYPE} = "full" ] 133 | then 134 | BUILD="Qt${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-RaspberryPi4-bin-full.tgz" 135 | elif [ ${BUILD_TYPE} = "minimal" ] 136 | then 137 | BUILD="Qt${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-RaspberryPi4-bin-minimal.tgz" 138 | else 139 | echo "Unknown build type: ${BUILD_TYPE}" 140 | exit 1 141 | fi 142 | 143 | echo "*** Building Qt ${VER3}${VERSION_SUFFIX} (${BUILD_TYPE})" 144 | if [ ! -d "${BUILD_DIR}" ] 145 | then 146 | if [ -n "$no_exec" ] 147 | then 148 | echo mkdir -p "${BUILD_DIR}" 149 | else 150 | mkdir -p "${BUILD_DIR}" 151 | fi 152 | fi 153 | 154 | if [ -n "$no_exec" ] 155 | then 156 | echo cd ${BUILD_DIR} 157 | else 158 | cd ${BUILD_DIR} 159 | fi 160 | 161 | # Download source if needed. 162 | if [ -n "$step_0" ] 163 | then 164 | if [ -f "${SOURCE}" ] 165 | then 166 | echo "*** Source found, not downloading it" 167 | else 168 | echo "*** Downloading source" 169 | if [ -n "$no_exec" ] 170 | then 171 | echo wget http://download.qt.io/official_releases/qt/${VER2}/${VER3}/single/${SOURCE} 172 | else 173 | wget http://download.qt.io/official_releases/qt/${VER2}/${VER3}/single/${SOURCE} 174 | fi 175 | fi 176 | fi 177 | 178 | # Check that a build was not already extracted 179 | if [ -n "$step_1" ] 180 | then 181 | if [ -d ${DIR} ] 182 | then 183 | echo "A build already exists in ${DIR}" 184 | echo "Remove it before doing a build." 185 | if [ -z "$no_exec" ] 186 | then 187 | exit 1 188 | fi 189 | fi 190 | 191 | # Extract source 192 | echo "*** Extracting source" 193 | if [ -n "$no_exec" ] 194 | then 195 | echo tar xJf ${SOURCE} 196 | echo cd ${DIR} 197 | else 198 | tar xJf ${SOURCE} 199 | cd ${DIR} 200 | fi 201 | 202 | fi 203 | 204 | # Configure 205 | if [ -n "$step_2" ] 206 | then 207 | echo "*** Configuring" 208 | if [ ${BUILD_TYPE} = "minimal" ] 209 | then 210 | if [ -n "$no_exec" ] 211 | then 212 | echo cd ${DIR} 213 | echo ./configure -opensource -confirm-license -skip qtwebengine -skip qtlocation -nomake examples -nomake tests -no-assimp 214 | else 215 | cd ${DIR} 216 | ./configure -opensource -confirm-license -skip qtwebengine -skip qtlocation -nomake examples -nomake tests -no-assimp 217 | fi 218 | else 219 | if [ -n "$no_exec" ] 220 | then 221 | echo cd ${DIR} 222 | echo ./configure -opensource -confirm-license -skip qtwebengine -skip qtlocation -no-assimp 223 | else 224 | cd ${DIR} 225 | ./configure -opensource -confirm-license -no-assimp 226 | fi 227 | fi 228 | fi 229 | 230 | # Build 231 | if [ -n "$step_3" ] 232 | then 233 | echo "*** Building" 234 | if [ -n "$no_exec" ] 235 | then 236 | echo cd ${DIR} 237 | echo make -s -j${PAR} 238 | else 239 | cd ${DIR} 240 | make -s -j${PAR} 241 | fi 242 | fi 243 | 244 | # Install 245 | if [ -n "$step_4" ] 246 | then 247 | echo "*** Installing" 248 | if [ -n "$no_exec" ] 249 | then 250 | echo cd ${DIR} 251 | echo sudo make -s install 252 | else 253 | cd ${DIR} 254 | sudo make -s install 255 | fi 256 | fi 257 | 258 | # Build docs 259 | if [ -n "$step_5" ] 260 | then 261 | if [ ${BUILD_TYPE} = "full" ] 262 | then 263 | echo "*** Building docs" 264 | if [ -n "$no_exec" ] 265 | then 266 | echo cd ${DIR} 267 | echo make -s -j${PAR} docs 268 | else 269 | cd ${DIR} 270 | make -s -j${PAR} docs 271 | fi 272 | fi 273 | fi 274 | 275 | # Install docs 276 | if [ -n "$step_6" ] 277 | then 278 | if [ ${BUILD_TYPE} = "full" ] 279 | then 280 | echo "*** Installing docs" 281 | if [ -n "$no_exec" ] 282 | then 283 | echo cd ${DIR} 284 | echo sudo make -s install_docs 285 | else 286 | cd ${DIR} 287 | sudo make -s install_docs 288 | fi 289 | fi 290 | fi 291 | 292 | # Remove source 293 | if [ -n "$step_7" ] 294 | then 295 | echo "*** Removing source" 296 | if [ -n "$no_exec" ] 297 | then 298 | echo rm -rf ${DIR} 299 | else 300 | rm -rf ${DIR} 301 | fi 302 | fi 303 | 304 | # Make tar file of build 305 | if [ -n "$step_8" ] 306 | then 307 | echo "*** Making tar file of build" 308 | if [ -n "$no_exec" ] 309 | then 310 | echo cd ${DIR}/.. 311 | echo tar czf ${BUILD} /usr/local/Qt-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} 312 | else 313 | cd ${DIR}/.. 314 | tar czf ${BUILD} /usr/local/Qt-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} 315 | fi 316 | fi 317 | 318 | # Remove install 319 | if [ -n "$step_9" ] 320 | then 321 | echo "*** Removing install" 322 | if [ -n "$no_exec" ] 323 | then 324 | echo sudo rm -rf /usr/local/Qt-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} 325 | else 326 | sudo rm -rf /usr/local/Qt-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} 327 | fi 328 | fi 329 | 330 | # Done. 331 | echo "*** Done, build is in ${BUILD}" 332 | -------------------------------------------------------------------------------- /build-qtcreator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Download and build Qt Creator for desktop 4 | # 5 | # Usage: build-qtcreator.sh [-h] [-n] 6 | # Options: 7 | # 8 | # -h Help 9 | # -n No-execute, just show commands 10 | 11 | # Qt Creator version to build 12 | VERSION_MAJOR=4 13 | VERSION_MINOR=7 14 | VERSION_PATCH=1 15 | 16 | # Qt version to build against 17 | QT_VERSION_MAJOR=5 18 | QT_VERSION_MINOR=11 19 | QT_VERSION_PATCH=2 20 | 21 | # Set if needed for a beta or RC version, e.g. "-beta4" 22 | # Leave empty for release. 23 | VERSION_SUFFIX= 24 | 25 | # Number of parallel jobs to run 26 | PAR=1 27 | 28 | # Stop on error 29 | set -e 30 | 31 | # Build directory 32 | BUILD_DIR=${HOME}/qtbuild 33 | 34 | # Parse command line options 35 | while getopts "hn" opt; do 36 | case $opt in 37 | h) 38 | echo "usage: $0 [-h] [-n] -[]" 39 | echo "" 40 | echo "Options:" 41 | echo " -h Help" 42 | echo " -n No-execute, just show commands" 43 | exit 44 | ;; 45 | n) 46 | no_exec=1 47 | ;; 48 | \?) 49 | exit 50 | ;; 51 | esac 52 | done 53 | 54 | # Generate name of archive file 55 | VER2="${VERSION_MAJOR}.${VERSION_MINOR}" 56 | VER3="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" 57 | VER4="${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}" 58 | SOURCE="qt-creator-opensource-src-${VER3}${VERSION_SUFFIX}.tar.xz" 59 | 60 | # Name of source directory 61 | DIR=`basename ${SOURCE} .tar.xz` 62 | 63 | # Name of created build archive file 64 | BUILD="QtCreator${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-Qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}-RaspberryPi3-bin.tgz" 65 | 66 | # Make sure qmake is found in search path. 67 | if which qmake >/dev/null 68 | then 69 | echo "Using qmake in `which qmake`" 70 | else 71 | echo "A qmake was not found." 72 | echo "Make sure it is installed and in the search path." 73 | exit 1 74 | fi 75 | 76 | echo "*** Building Qt Creator ${VER3}${VERSION_SUFFIX}" 77 | if [ ! -d "${BUILD_DIR}" ] 78 | then 79 | if [ -n "$no_exec" ] 80 | then 81 | echo mkdir -p "${BUILD_DIR}" 82 | else 83 | mkdir -p "${BUILD_DIR}" 84 | fi 85 | fi 86 | 87 | if [ -n "$no_exec" ] 88 | then 89 | echo cp qt-creator-arm.patch ${BUILD_DIR} 90 | echo cd ${BUILD_DIR} 91 | else 92 | cp qt-creator-arm.patch ${BUILD_DIR} 93 | cd ${BUILD_DIR} 94 | fi 95 | 96 | # Download source if needed. 97 | if [ -f "${SOURCE}" ] 98 | then 99 | echo "*** Source found, not downloading it" 100 | else 101 | echo "*** Downloading source" 102 | if [ -n "$no_exec" ] 103 | then 104 | echo wget http://download.qt.io/official_releases/qtcreator/${VER2}/${VER3}/${SOURCE} 105 | else 106 | wget http://download.qt.io/official_releases/qtcreator/${VER2}/${VER3}/${SOURCE} 107 | fi 108 | fi 109 | 110 | # Check that a build was not already extracted 111 | if [ -d ${DIR} ] 112 | then 113 | echo "A build already exists in ${DIR}" 114 | echo "Remove it before doing a build." 115 | exit 1 116 | fi 117 | 118 | # Extract source 119 | echo "*** Extracting source" 120 | if [ -n "$no_exec" ] 121 | then 122 | echo tar xJf ${SOURCE} 123 | echo cd ${DIR} 124 | else 125 | tar xJf ${SOURCE} 126 | cd ${DIR} 127 | fi 128 | 129 | # Currently need to apply a patch to get a third party library to 130 | # build on ARM. 131 | #echo "*** Applying patch" 132 | #if [ -n "$no_exec" ] 133 | #then 134 | # echo "patch -p1 <../qt-creator-arm.patch" 135 | #else 136 | # patch -p1 <../qt-creator-arm.patch 137 | #fi 138 | 139 | # Run qmake (needs to be in path) 140 | echo "*** Running qmake" 141 | if [ -n "$no_exec" ] 142 | then 143 | echo qmake 144 | else 145 | qmake 146 | fi 147 | 148 | # Build 149 | echo "*** Building" 150 | if [ -n "$no_exec" ] 151 | then 152 | echo make -s -j${PAR} 153 | else 154 | make -s -j${PAR} 155 | fi 156 | 157 | # Build docs - disable for recent releases of Qt. 158 | #echo "*** Building docs" 159 | #if [ -n "$no_exec" ] 160 | #then 161 | # echo make -s -j${PAR} docs 162 | #else 163 | # make -s -j${PAR} docs 164 | #fi 165 | 166 | # Install 167 | echo "*** Installing" 168 | if [ -n "$no_exec" ] 169 | then 170 | echo sudo make install INSTALL_ROOT=/usr/local/ 171 | else 172 | sudo make install INSTALL_ROOT=/usr/local/ 173 | fi 174 | 175 | # Make tar file of build 176 | echo "*** Making tar file" 177 | if [ -n "$no_exec" ] 178 | then 179 | echo cd .. 180 | echo tar czf ${BUILD} /usr/local/bin/q* /usr/local/share/icons /usr/local/share/qtcreator /usr/local/share/metainfo /usr/local/share/applications /usr/local/lib/qtcreator /usr/local/libexec/qtcreator 181 | else 182 | cd .. 183 | tar czf ${BUILD} /usr/local/bin/q* /usr/local/share/icons /usr/local/share/qtcreator /usr/local/share/metainfo /usr/local/share/applications /usr/local/lib/qtcreator /usr/local/libexec/qtcreator 184 | fi 185 | 186 | # Remove install 187 | echo "*** Removing install" 188 | if [ -n "$no_exec" ] 189 | then 190 | echo cd ${DIR} 191 | echo sudo make uninstall INSTALL_ROOT=/usr/local/ 192 | else 193 | cd ${DIR} 194 | sudo make uninstall INSTALL_ROOT=/usr/local/ 195 | fi 196 | 197 | # Remove source 198 | echo "*** Removing source" 199 | if [ -n "$no_exec" ] 200 | then 201 | echo cd .. 202 | echo rm -rf ${DIR} 203 | else 204 | cd .. 205 | rm -rf ${DIR} 206 | fi 207 | 208 | # Done. 209 | echo "*** Done, build is in ${BUILD}" 210 | -------------------------------------------------------------------------------- /qt-creator-arm.patch: -------------------------------------------------------------------------------- 1 | From 60cc910e3f2f2ac1df8aade9e203dcf3a94d8d1e Mon Sep 17 00:00:00 2001 2 | From: Greg Nietsky 3 | Date: Mon, 3 Mar 2014 15:30:51 +0200 4 | Subject: [PATCH] Fix: Allow qt-creator to build on arm aarch32 and aarch64 5 | 6 | Botan is imported hardwired for x86 this small patch allows it 7 | too operate on arm other platforms could be added. 8 | 9 | Task-number: QTCREATORBUG-8107 10 | Change-Id: Iddea28f21c9fa1afd2fdd5d16a44e6c96a516a7a 11 | --- 12 | src/libs/3rdparty/botan/botan.cpp | 16 +++++++++++++++- 13 | src/libs/3rdparty/botan/botan.h | 2 ++ 14 | 2 files changed, 17 insertions(+), 1 deletion(-) 15 | 16 | diff --git a/src/libs/3rdparty/botan/botan.cpp b/src/libs/3rdparty/botan/botan.cpp 17 | index 917c385..4364a2e 100644 18 | --- a/src/libs/3rdparty/botan/botan.cpp 19 | +++ b/src/libs/3rdparty/botan/botan.cpp 20 | @@ -1101,6 +1101,8 @@ class Montgomery_Exponentiator : public Modular_Exponentiator 21 | 22 | #if (BOTAN_MP_WORD_BITS != 32) 23 | #error The mp_x86_32 module requires that BOTAN_MP_WORD_BITS == 32 24 | +#elif !defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) 25 | +typedef Botan::u64bit dword; 26 | #endif 27 | 28 | #ifdef Q_OS_UNIX 29 | @@ -1118,6 +1120,7 @@ extern "C" { 30 | */ 31 | inline word word_madd2(word a, word b, word* c) 32 | { 33 | +#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) 34 | asm( 35 | ASM("mull %[b]") 36 | ASM("addl %[c],%[a]") 37 | @@ -1127,6 +1130,11 @@ inline word word_madd2(word a, word b, word* c) 38 | : "0"(a), "1"(b), [c]"g"(*c) : "cc"); 39 | 40 | return a; 41 | +#else 42 | + dword z = (dword)a * b + *c; 43 | + *c = (word)(z >> BOTAN_MP_WORD_BITS); 44 | + return (word)z; 45 | +#endif 46 | } 47 | 48 | /* 49 | @@ -1134,6 +1142,7 @@ inline word word_madd2(word a, word b, word* c) 50 | */ 51 | inline word word_madd3(word a, word b, word c, word* d) 52 | { 53 | +#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) 54 | asm( 55 | ASM("mull %[b]") 56 | 57 | @@ -1147,6 +1156,11 @@ inline word word_madd3(word a, word b, word c, word* d) 58 | : "0"(a), "1"(b), [c]"g"(c), [d]"g"(*d) : "cc"); 59 | 60 | return a; 61 | +#else 62 | + dword z = (dword)a * b + c + *d; 63 | + *d = (word)(z >> BOTAN_MP_WORD_BITS); 64 | + return (word)z; 65 | +#endif 66 | } 67 | 68 | } 69 | @@ -2315,7 +2329,7 @@ namespace Botan { 70 | 71 | extern "C" { 72 | 73 | -#ifdef Q_OS_UNIX 74 | +#if defined(Q_OS_UNIX) && defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) 75 | /* 76 | * Helper Macros for x86 Assembly 77 | */ 78 | diff --git a/src/libs/3rdparty/botan/botan.h b/src/libs/3rdparty/botan/botan.h 79 | index 6a9cbe0..3bfdbc2 100644 80 | --- a/src/libs/3rdparty/botan/botan.h 81 | +++ b/src/libs/3rdparty/botan/botan.h 82 | @@ -81,7 +81,9 @@ 83 | #endif 84 | 85 | #define BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN 86 | +#if !defined(__arm__) && !defined(__aarch64__) 87 | #define BOTAN_TARGET_CPU_IS_X86_FAMILY 88 | +#endif 89 | #define BOTAN_TARGET_UNALIGNED_MEMORY_ACCESS_OK 1 90 | 91 | #if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN) || \ 92 | -- 93 | 2.7.4 94 | --------------------------------------------------------------------------------