├── .gitignore ├── Dockerfile ├── README.md └── files └── pip.conf /.gitignore: -------------------------------------------------------------------------------- 1 | /files/qtsdk-friendlyelec 2 | /files/android-ndk-r21e-linux-x86_64.zip 3 | /files/commandlinetools-linux-6609375_latest.zip 4 | /files/git-v2.30.2.tar.gz 5 | /files/java-8-openjdk-amd64.tgz 6 | /files/jdk1.6.0_45.tgz 7 | /files/qt-opensource-linux-x64-5.12.11.run 8 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER Lawrence-Tang 3 | 4 | RUN set -x; \ 5 | mkdir -p ~/.pip 6 | COPY ./files/pip.conf ~/.pip/pip.conf 7 | 8 | RUN apt-get update; \ 9 | apt-get -y install libc6-dev-i386; \ 10 | apt-get -y install gcc-multilib g++-multilib debootstrap qemu-user-static device-tree-compiler g++-5-multilib 11 | 12 | RUN apt-get -y install sudo bc whiptail curl aria2 wget make lsb-release openssh-client vim tree exfat-fuse exfat-utils u-boot-tools mediainfo \ 13 | libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libxcb-xinerama0 libxcb-xinerama0-dev \ 14 | libopenal-dev libalut-dev libpulse-dev libuv1-dev libmicrohttpd-dev bridge-utils ifplugd \ 15 | libbluetooth3-dev libjpeg8 libjpeg8-dev libjpeg-turbo8 libjpeg-turbo8-dev libvpx-dev \ 16 | libgtk2.0-dev libnss3 libgconf-2-4 gconf2 gconf2-common libx11-dev libxext-dev libxtst-dev \ 17 | libxrender-dev libxmu-dev libxmuu-dev libxfixes-dev libxfixes3 libpangocairo-1.0-0 \ 18 | libpangoft2-1.0-0 libdbus-1-dev libdbus-1-3 libusb-0.1-4 libusb-dev \ 19 | bison gperf flex ruby python libasound2-dev libbz2-dev libcap-dev \ 20 | libcups2-dev libdrm-dev libegl1-mesa-dev libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev \ 21 | libxtst-dev gyp ninja-build \ 22 | libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ 23 | libfontconfig1-dev libxss-dev libsrtp0-dev libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev \ 24 | libavutil-dev libavformat-dev libavcodec-dev libevent-dev libcups2-dev libpapi-dev 25 | 26 | RUN apt-get -y install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 libx32z1 libzadc1 lib32z1 27 | RUN apt-get -y install libx11-xcb-dev libglu1-mesa-dev libfontconfig1 libxkbcommon-x11-0 28 | RUN apt-get -y install build-essential dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev 29 | RUN apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf 30 | RUN apt-get -y install firefox 31 | RUN ln -s /usr/include/asm-generic/ /usr/include/asm 32 | 33 | # install qt-sdk 34 | COPY ./files/qtsdk-friendlyelec/s5p4418 /qtsdk-friendlyelec/s5p4418 35 | RUN echo "> install QtSDK for s5p4418"; \ 36 | cd /qtsdk-friendlyelec/s5p4418/; chmod 755 install.sh; ./install.sh 37 | 38 | COPY ./files/qtsdk-friendlyelec/s5p6818 /qtsdk-friendlyelec/s5p6818 39 | RUN echo "> install QtSDK for s5p6818"; \ 40 | cd /qtsdk-friendlyelec/s5p6818/; chmod 755 install.sh; ./install.sh 41 | 42 | COPY ./files/qtsdk-friendlyelec/s905 /qtsdk-friendlyelec/s905 43 | RUN echo "> install QtSDK for s905"; \ 44 | cd /qtsdk-friendlyelec/s905/; chmod 755 install.sh; ./install.sh 45 | 46 | COPY ./files/qtsdk-friendlyelec/h3 /qtsdk-friendlyelec/h3 47 | RUN echo "> install QtSDK for allwinne h3/h5"; \ 48 | cd /qtsdk-friendlyelec/h3/; chmod 755 install.sh; ./install.sh 49 | 50 | COPY ./files/qtsdk-friendlyelec/rk3399-lubuntu /qtsdk-friendlyelec/rk3399-lubuntu 51 | RUN echo "> install QtSDK for rk3399-lubuntu"; \ 52 | cd /qtsdk-friendlyelec/rk3399-lubuntu/; chmod 755 install.sh; ./install.sh 53 | RUN rm -rf /qtsdk-friendlyelec 54 | 55 | # build git from source 56 | COPY ./files/git-v2.30.2.tar.gz / 57 | RUN tar xzf /git-v2.30.2.tar.gz 58 | RUN cd /git-2.30.2/; \ 59 | make configure; \ 60 | ./configure --prefix=/usr; \ 61 | make all; \ 62 | make install 63 | RUN rm -rf /git-2.30.2 /git-v2.30.2.tar.gz 64 | 65 | # install jdk 66 | COPY ./files/java-8-openjdk-amd64.tgz / 67 | COPY ./files/jdk1.6.0_45.tgz / 68 | RUN mkdir -p /usr/lib/jvm/ 69 | RUN tar xzf /java-8-openjdk-amd64.tgz -C /usr/lib/jvm/ 70 | RUN tar xzf /jdk1.6.0_45.tgz -C /usr/lib/jvm/ 71 | RUN rm -f /java-8-openjdk-amd64.tgz /jdk1.6.0_45.tgz 72 | 73 | # install android-sdk 74 | RUN apt-get -y install android-sdk 75 | COPY ./files/commandlinetools-linux-6609375_latest.zip / 76 | RUN unzip /commandlinetools-linux-6609375_latest.zip -d cmdline-tools; \ 77 | rm -rf /usr/lib/android-sdk/cmdline-tools; \ 78 | mv cmdline-tools /usr/lib/android-sdk; \ 79 | /usr/lib/android-sdk/cmdline-tools/tools/bin/sdkmanager "build-tools;28.0.3"; \ 80 | rm -f /commandlinetools-linux-6609375_latest.zip 81 | 82 | # install android-ndk 83 | COPY ./files/android-ndk-r21e-linux-x86_64.zip / 84 | RUN cd /usr/lib/; unzip /android-ndk-r21e-linux-x86_64.zip 85 | RUN rm -f /android-ndk-r21e-linux-x86_64.zip 86 | 87 | # install qt-5.12.11 88 | COPY ./files/qt-opensource-linux-x64-5.12.11.run / 89 | RUN chmod +x /qt-opensource-linux-x64-5.12.11.run 90 | 91 | # clean 92 | RUN apt-get -y autoremove 93 | 94 | # user 95 | RUN echo "root:fa" | chpasswd 96 | RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ubuntu 97 | RUN echo "ubuntu:fa" | chpasswd 98 | 99 | USER ubuntu 100 | ENV HOME /home/ubuntu 101 | 102 | RUN echo "all done." 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## **FriendlyELEC-Ubuntu16-Docker** 2 | 3 | This docker image is used to cross-compile Qt application for FriendlyELEC's boards, support for the following qt versions: 4 | * Qt5.10.0 on FriendlyCore Xenial(for S5P4418/S5P6818/S905) 5 | * Qt5.10.0 on Lubuntu Xenial(for RK3399 Lubuntu OS) 6 | * Qt4.8.6 (for Allwinner H3/H5) 7 | 8 | Build docker image with qt-sdk and toolchain added 9 | ------------ 10 | 11 | Download the qt-sdk package from the following url: 12 | http://dl.friendlyarm.com/qt-sdk-friendlyelec 13 | 14 | Once you've done that then: 15 | ``` 16 | $ git clone https://github.com/friendlyarm/friendlyelec-ubuntu16-docker.git 17 | $ tar xvzf qtsdk-friendlyelec.tgz -C friendlyelec-ubuntu16-docker/files/ 18 | $ docker build -t "fa-ubuntu16" friendlyelec-ubuntu16-docker 19 | ``` 20 | 21 | Run 22 | ------------ 23 | 24 | Enter docker shell: 25 | ``` 26 | $ mkdir -p ~/work 27 | $ docker run -it -v ~/work:/work fa-ubuntu16 /bin/bash 28 | ``` 29 | 30 | This will mount the local ~/work directory to the container's /work directory. 31 | 32 | Cross compile qt application 33 | ------------ 34 | 35 | We took QtE-Demo as an example to show how to cross compile qt application: 36 | 37 | * Qt5.10.0 (for S5P4418 platform) 38 | ``` 39 | $ cd /work 40 | $ git clone https://github.com/friendlyarm/QtE-Demo 41 | $ mkdir build && cd build 42 | $ /usr/local/Trolltech/Qt-5.10.0-nexell32-sdk/bin/qmake ../QtE-Demo/QtE-Demo.pro 43 | $ make 44 | ``` 45 | * Qt5.10.0 (for S5P6818 platform) 46 | ``` 47 | $ cd /work 48 | $ git clone https://github.com/friendlyarm/QtE-Demo 49 | $ mkdir build && cd build 50 | $ /usr/local/Trolltech/Qt-5.10.0-nexell64-sdk/bin/qmake ../QtE-Demo/QtE-Demo.pro 51 | $ make 52 | ``` 53 | * Qt4.8.6 (for Allwinner H3/H5 platform) 54 | ``` 55 | $ cd /work/ 56 | $ export PATH=/opt/FriendlyARM/toolchain/4.9.3/bin/:$PATH 57 | $ git clone https://github.com/friendlyarm/QtE-Demo 58 | $ mkdir build && cd build 59 | $ /usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake ../QtE-Demo/QtE-Demo-Qt4.pro 60 | $ make 61 | ``` 62 | * Qt5.9.1 (for S905 platform) 63 | ``` 64 | $ cd /work/ 65 | $ export PATH=/opt/FriendlyARM/toolchain/6.4-aarch64/bin/:$PATH 66 | $ git clone https://github.com/friendlyarm/QtE-Demo 67 | $ mkdir build && cd build 68 | $ /usr/local/Trolltech/QtEmbedded-5.9.1-arch64/bin/qmake ../QtE-Demo/QtE-Demo.pro 69 | $ make 70 | ``` 71 | * Qt5.10.0 armhf X11 (for RK3399 Lubuntu OS) 72 | ``` 73 | $ cd /work/ 74 | $ git clone https://github.com/friendlyarm/QtE-Demo 75 | $ mkdir build && cd build 76 | $ /usr/local/Trolltech/Qt-5.10.0-rk32xcb-sdk/bin/qmake ../QtE-Demo/QtE-Demo.pro 77 | $ make 78 | ``` 79 | 80 | You can see the qt binary files in the ~/work directory of the host system. 81 | Refer to the following guidelines to know how to run Qt application on the development board: 82 | http://wiki.friendlyarm.com/wiki/index.php/How_to_Build_and_Install_Qt_Application_for_FriendlyELEC_Boards 83 | 84 | Currently supported boards 85 | ------------ 86 | * Allwinner H3/H5 87 | NanoPi Neo 88 | NanoPi Neo Air 89 | NanoPi Duo 90 | NanoPi NEO2 91 | NanoPi NEO Plus2 92 | NanoPi M1 93 | NanoPi M1 Plus 94 | NanoPi NEO Core 95 | NanoPi NEO Core2 96 | NanoPi K1 Plus 97 | 98 | * S5P4418 99 | NanoPi Fire2A 100 | NanoPi M2A 101 | NanoPi S2 102 | NanoPC T2 103 | Smart4418 104 | 105 | * S5P6818 106 | NanoPi Fire3 107 | NanoPi M3 108 | NanoPC T3 109 | NanoPC T3 Plus 110 | 111 | * S905 112 | NanoPi K2 113 | 114 | * RK3399 115 | NanoPC T4 116 | NanoPi M4 117 | NanoPi NEO4 118 | 119 | Resources 120 | ------------ 121 | * How to Install and Use Docker on Ubuntu 18.04 122 | https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 123 | * How to Build and Install Qt Application for FriendlyELEC Boards 124 | http://wiki.friendlyarm.com/wiki/index.php/How_to_Build_and_Install_Qt_Application_for_FriendlyELEC_Boards 125 | 126 | 127 | ## License 128 | 129 | The MIT License (MIT) 130 | Copyright (C) 2018 FriendlyELEC 131 | 132 | Permission is hereby granted, free of charge, to any person obtaining a copy 133 | of this software and associated documentation files (the "Software"), to deal 134 | in the Software without restriction, including without limitation the rights 135 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 136 | copies of the Software, and to permit persons to whom the Software is 137 | furnished to do so, subject to the following conditions: 138 | 139 | The above copyright notice and this permission notice shall be included in 140 | all copies or substantial portions of the Software. 141 | 142 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 143 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 144 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 145 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 146 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 147 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 148 | THE SOFTWARE. 149 | -------------------------------------------------------------------------------- /files/pip.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | trusted-host = mirrors.aliyun.com 3 | index-url = http://mirrors.aliyun.com/pypi/simple 4 | --------------------------------------------------------------------------------