2023-08-13 20:56:46 +08:00
|
|
|
# RHEL devtoolset, which provides new version of GCC targetting old libgcc_s and libstdc++, is the key to compatibility.
|
|
|
|
# EL 7 is modern enough for apps and libs.
|
|
|
|
# CentOS 7 aarch64 container image is a mess. Use Oracle instead.
|
|
|
|
FROM docker.io/arm64v8/oraclelinux:7
|
2023-01-03 12:18:02 +08:00
|
|
|
|
2023-03-04 18:44:39 +08:00
|
|
|
# System
|
2023-08-13 20:56:46 +08:00
|
|
|
RUN yum-config-manager --enable ol7_optional_latest && \
|
|
|
|
yum install -y oracle-softwarecollection-release-el7 oracle-epel-release-el7 && \
|
|
|
|
yum upgrade -y && \
|
|
|
|
yum install -y \
|
|
|
|
# general devtools
|
|
|
|
devtoolset-7-gcc devtoolset-7-gcc-c++ make \
|
|
|
|
# squashfs-tools libs
|
|
|
|
libzstd-devel \
|
|
|
|
# Qt build tools
|
|
|
|
file which \
|
|
|
|
# Qt libs
|
2023-11-26 11:05:48 +08:00
|
|
|
at-spi2-core-devel dbus-devel fontconfig-devel freetype-devel glib2-devel libXrender-devel libxcb-devel libxkbcommon-devel libxkbcommon-x11-devel mesa-libGL-devel wayland-devel xcb-util-devel && \
|
2023-08-13 20:56:46 +08:00
|
|
|
yum clean all
|
2023-03-04 18:44:39 +08:00
|
|
|
|
2023-08-13 20:56:46 +08:00
|
|
|
ARG DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-7/root
|
|
|
|
ENV PATH=${DEVTOOLSET_ROOTPATH}/usr/bin:${PATH}
|
|
|
|
ENV LD_LIBRARY_PATH=${DEVTOOLSET_ROOTPATH}/usr/lib64
|
|
|
|
|
|
|
|
ARG SQUASHFS_TOOLS_VERSION=4.4
|
|
|
|
ARG QT_MAJOR_MINOR=5.12
|
|
|
|
ARG QT_PATCH=12
|
|
|
|
ARG QT_VERSION=${QT_MAJOR_MINOR}.${QT_PATCH}
|
|
|
|
ARG FCITX5_QT_VERSION=5.0.17
|
|
|
|
ARG ALACRITTY_VERSION=0.12.2
|
|
|
|
|
|
|
|
# AppImage runtime
|
|
|
|
RUN curl -L -o /opt/appimage-runtime 'https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-aarch64'
|
|
|
|
|
|
|
|
# squashfs-tools
|
|
|
|
RUN mkdir -p /build/squashfs-tools && \
|
|
|
|
cd /build/squashfs-tools && \
|
|
|
|
curl -L -o squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz "https://github.com/plougher/squashfs-tools/archive/refs/tags/${SQUASHFS_TOOLS_VERSION}.tar.gz" && \
|
|
|
|
tar xf squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz && \
|
|
|
|
cd squashfs-tools-${SQUASHFS_TOOLS_VERSION}/squashfs-tools && \
|
|
|
|
make ZSTD_SUPPORT=1 -j$(nproc) && \
|
|
|
|
make install && \
|
|
|
|
# cleanup
|
|
|
|
cd / && \
|
|
|
|
rm -r /build/squashfs-tools
|
2023-03-04 18:44:39 +08:00
|
|
|
|
|
|
|
# Qt 5
|
2023-01-03 12:18:02 +08:00
|
|
|
RUN mkdir -p /build/qt5 && \
|
|
|
|
cd /build/qt5 && \
|
2023-11-26 11:05:48 +08:00
|
|
|
curl -O "https://download.qt.io/archive/qt/${QT_MAJOR_MINOR}/${QT_VERSION}/submodules/qt{base,svg,tools,wayland}-everywhere-src-${QT_VERSION}.tar.xz" && \
|
2023-08-13 20:56:46 +08:00
|
|
|
tar xf qtbase-everywhere-src-${QT_VERSION}.tar.xz && \
|
|
|
|
cd qtbase-everywhere-src-${QT_VERSION} && \
|
2023-01-03 12:18:02 +08:00
|
|
|
./configure \
|
2023-03-04 18:44:39 +08:00
|
|
|
-prefix /usr/local \
|
2023-01-03 12:18:02 +08:00
|
|
|
-opensource -confirm-license \
|
|
|
|
-optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \
|
2023-03-04 18:44:39 +08:00
|
|
|
-qt-zlib -qt-doubleconversion -iconv -no-icu -qt-pcre -no-openssl -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-xcb -qt-sqlite \
|
2023-01-03 12:18:02 +08:00
|
|
|
-nomake examples -nomake tests -nomake tools && \
|
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
2023-03-04 18:44:39 +08:00
|
|
|
# svg package
|
2023-01-03 12:18:02 +08:00
|
|
|
cd /build/qt5 && \
|
2023-08-13 20:56:46 +08:00
|
|
|
tar xf qtsvg-everywhere-src-${QT_VERSION}.tar.xz && \
|
|
|
|
cd qtsvg-everywhere-src-${QT_VERSION} && \
|
2023-03-04 18:44:39 +08:00
|
|
|
qmake . && \
|
2023-01-03 12:18:02 +08:00
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
2023-03-04 18:44:39 +08:00
|
|
|
# tools package
|
2023-01-03 12:18:02 +08:00
|
|
|
cd /build/qt5 && \
|
2023-08-13 20:56:46 +08:00
|
|
|
tar xf qttools-everywhere-src-${QT_VERSION}.tar.xz && \
|
|
|
|
cd qttools-everywhere-src-${QT_VERSION} && \
|
2023-03-04 18:44:39 +08:00
|
|
|
qmake . && \
|
2023-01-03 12:18:02 +08:00
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
2023-11-26 11:05:48 +08:00
|
|
|
# wayland package
|
2023-07-03 14:06:10 +08:00
|
|
|
cd /build/qt5 && \
|
2023-11-26 11:05:48 +08:00
|
|
|
tar xf qtwayland-everywhere-src-${QT_VERSION}.tar.xz && \
|
|
|
|
cd qtwayland-everywhere-src-${QT_VERSION} && \
|
|
|
|
qmake . && \
|
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
|
|
|
# cleanup
|
|
|
|
cd / && \
|
|
|
|
rm -r /build/qt5
|
|
|
|
|
|
|
|
# fcitx5-qt
|
|
|
|
RUN yum install -y \
|
|
|
|
cmake3 extra-cmake-modules && \
|
|
|
|
mkdir -p /build/qt5 && \
|
|
|
|
cd /build/qt5 && \
|
|
|
|
curl -L -o fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz "https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${FCITX5_QT_VERSION}.tar.gz" && \
|
2023-08-13 20:56:46 +08:00
|
|
|
tar xf fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz && \
|
|
|
|
cd fcitx5-qt-${FCITX5_QT_VERSION} && \
|
|
|
|
cmake3 . -Bbuild -DCMAKE_MODULE_PATH=/usr/local/lib/cmake -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_BUILD_TYPE=Release -DENABLE_QT4=Off -DENABLE_QT5=On -DENABLE_QT6=Off -DBUILD_ONLY_PLUGIN=On -DBUILD_STATIC_PLUGIN=On && \
|
|
|
|
cmake3 --build build --parallel && \
|
|
|
|
# cmake 3.14 is too old to `--install`
|
|
|
|
cmake3 --build build -- install && \
|
2023-03-04 18:44:39 +08:00
|
|
|
# cleanup
|
2023-11-26 11:05:48 +08:00
|
|
|
yum autoremove -y \
|
|
|
|
cmake3 extra-cmake-modules && \
|
|
|
|
yum clean all && \
|
2023-01-03 12:18:02 +08:00
|
|
|
cd / && \
|
|
|
|
rm -r /build/qt5
|