提交 b369a7e7 编写于 作者: S storypku 提交者: Liu Jiaming

Docker::Installers: qt5 installer for arm64

Qt version 5.12.9
上级 a334f902
......@@ -19,8 +19,8 @@
# Fail on first error.
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
. ./installer_base.sh
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
. ${CURR_DIR}/installer_base.sh
TARGET_ARCH="$(uname -m)"
......@@ -36,8 +36,8 @@ apt-get -y update && \
# Note(storypku)
# The last two was required by `ldd /usr/local/qt5/plugins/platforms/libqxcb.so`
if [[ "${TARGET_ARCH}" != "x86_64" ]]; then
warning "Qt installer for ${TARGET_ARCH} not ready."
if [ "${TARGET_ARCH}" = "aarch64" ]; then
bash ${CURR_DIR}/install_qt5base.sh
exit 0
fi
......
#!/usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Fail on first error.
set -e
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
. ${CURR_DIR}/installer_base.sh
# References:
# 1) http://www.linuxfromscratch.org/blfs/view/svn/x/qt5.html
# 2) https://src.fedoraproject.org/rpms/qt5-qtbase/tree/master
# 3) https://launchpad.net/ubuntu/+source/qtbase-opensource-src/5.12.8+dfsg-0ubuntu1
apt_get_update_and_install \
libdbus-1-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libharfbuzz-dev \
libjpeg-dev \
libpcre3-dev \
libpng-dev \
libsqlite3-dev \
libssl-dev \
libvulkan-dev \
libxcb1-dev \
libexpat1-dev \
zlib1g-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-shm0-dev \
libxcb-util1 \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev
VERSION="5.12.9"
MAJOR_VERSION="${VERSION%.*}"
PKG_NAME="qtbase-everywhere-src-${VERSION}.tar.xz"
CHECKSUM="331dafdd0f3e8623b51bd0da2266e7e7c53aa8e9dc28a8eb6f0b22609c5d337e"
DOWNLOAD_LINK="https://download.qt.io/official_releases/qt/${MAJOR_VERSION}/${VERSION}/submodules/${PKG_NAME}"
download_if_not_cached "${PKG_NAME}" "${CHECKSUM}" "${DOWNLOAD_LINK}"
tar xJf ${PKG_NAME}
QT5_PREFIX="/usr/local/qt5"
mkdir -p "/usr/local/Qt-${VERSION}"
ln -sfnv "Qt-${VERSION}" "${QT5_PREFIX}"
pushd qtbase-everywhere-src-${VERSION} >/dev/null
find . -name "*.pr[io]" | xargs sed -i 's/python/&3/'
pushd src/3rdparty
[ -d UNUSED ] || mkdir UNUSED
mv freetype libjpeg libpng zlib sqlite UNUSED/ || true
popd
./configure \
-verbose \
-prefix $QT5_PREFIX \
-sysconfdir /etc/xdg \
-platform linux-g++ \
-release \
-optimized-qmake \
-shared \
-strip \
-confirm-license \
-opensource \
-fontconfig \
-dbus-linked \
-openssl-linked \
-system-harfbuzz \
-system-freetype \
-system-sqlite \
-system-libjpeg \
-system-libpng \
-system-zlib \
-nomake examples \
-no-pch \
-no-rpath \
-skip qtwebengine
make -j$(nproc)
make install
# PostInstall
find $QT5_PREFIX/ -name \*.prl \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
find ${QT5_PREFIX}/lib -name "*.la" \
-exec rm -f {} \;
popd >/dev/null
echo "${QT5_PREFIX}/lib" > /etc/ld.so.conf.d/qt.conf
ldconfig
__mytext="""
export QT5_PATH=\"${QT5_PREFIX}\"
export QT_QPA_PLATFORM_PLUGIN_PATH=\"\${QT5_PATH}/plugins\"
add_to_path \"\${QT5_PATH}/bin\"
"""
echo "${__mytext}" | tee -a "${APOLLO_PROFILE}"
ok "Successfully installed Qt5 qtbase-${VERSION} from src for $(uname -m) ."
rm -rf qtbase-everywhere-src-${VERSION} ${PKG_NAME}
# Clean up cache to reduce layer size.
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册