Last active
December 30, 2018 07:59
-
-
Save Jokymon/7133dbc943e917f645fc to your computer and use it in GitHub Desktop.
Protocol from Cross compiling Qt5 for Raspberry Pi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
PREFIX=~/opt/qt5pi | |
ROOTFS_MOUNT=/mnt/rasp-pi-rootfs | |
# On Ubuntu 14.04 do the following first to get the ia32-lib | |
if [ `lsb_release -ds` -eq "Ubuntu 14.04 LTS" ] | |
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 | |
fi | |
### Get the RaspberryPi cross compilation tools | |
git clone https://github.com/raspberrypi/tools.git | |
mv tools rpi-tools | |
### Create the environment for building our cross compiled Qt | |
mkdir qt-on-raspberry | |
cd qt-on-raspberry | |
### Get the root file system and mount it | |
# Get the latest Raspbian image | |
wget http://downloads.raspberrypi.org/raspbian_latest | |
mv raspbian_latest raspbian_latest.zip | |
unzip raspbian_latest.zip | |
sudo mkdir $ROOTFS_MOUNT | |
# The offset is probably always the same due to the requirements for RaspberryPi SD Cards | |
sudo mount -o loop,offset=62914560 2014-09-09-wheezy-raspbian.img $ROOTFS_MOUNT | |
### Get the Qt sources and cross compilation scripts | |
git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git | |
git clone git://gitorious.org/qt/qt5.git | |
cd qt5 | |
./init-repository | |
cd .. | |
### Fix symlinks and lib paths in the mounted rootfs | |
cd cross-compile-tools | |
sudo ./fixQualifiedLibraryPaths $ROOTFS_MOUNT ~/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc | |
cd .. | |
### Compiling qtbase | |
cd qt5/qtbase | |
./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot $(ROOTFS_MOUNT) -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix $(PREFIX) | |
make -j4 | |
sudo make install | |
cd .. | |
### Compile other packages | |
for MODULE in qtimageformats qtsvg qtscript qtxmlpatterns qtdeclarative qtsensors qtgraphicaleffects qtlocation qtserialport qttools qtquick1 qtquickcontrols | |
do | |
cd $MODULE | |
$PREFIX/bin/qmake . | |
make -j4 | |
sudo make install | |
cd .. | |
done | |
### Finish the modified Raspbian image | |
cd .. | |
sync | |
sudo umount $ROOTFS_MOUNT |
Okay, you can do
git clone https://gitorious.org/cross-compile-tools/cross-compile-tools.git
instead
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When getting to
git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git
you now get :
Where has cross-compile-tools gone, now that gitorious has been acquired by gitlab ?