|
| 1 | +# RHEL devtoolset, which provides new version of GCC targetting old libgcc_s and libstdc++, is the key to compatibility. |
| 2 | +# EL 7 is modern enough for apps and libs. |
| 3 | +# CentOS 7 aarch64 container image is a mess. Use Oracle instead. |
| 4 | +FROM docker.io/arm64v8/oraclelinux:7 |
| 5 | + |
| 6 | +# System |
| 7 | +RUN yum-config-manager --enable ol7_optional_latest && \ |
| 8 | + yum install -y oracle-softwarecollection-release-el7 oracle-epel-release-el7 && \ |
| 9 | + yum upgrade -y && \ |
| 10 | + yum install -y \ |
| 11 | + # general devtools |
| 12 | + devtoolset-7-gcc devtoolset-7-gcc-c++ make \ |
| 13 | + # squashfs-tools libs |
| 14 | + libzstd-devel \ |
| 15 | + # Qt build tools |
| 16 | + file which \ |
| 17 | + # Qt libs |
| 18 | + 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 && \ |
| 19 | + yum clean all |
| 20 | + |
| 21 | +ARG DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-7/root |
| 22 | +ENV PATH=${DEVTOOLSET_ROOTPATH}/usr/bin:${PATH} |
| 23 | +ENV LD_LIBRARY_PATH=${DEVTOOLSET_ROOTPATH}/usr/lib64 |
| 24 | + |
| 25 | +ARG SQUASHFS_TOOLS_VERSION=4.4 |
| 26 | +ARG QT_MAJOR_MINOR=5.12 |
| 27 | +ARG QT_PATCH=12 |
| 28 | +ARG QT_VERSION=${QT_MAJOR_MINOR}.${QT_PATCH} |
| 29 | +ARG FCITX5_QT_VERSION=5.0.17 |
| 30 | +ARG ALACRITTY_VERSION=0.12.2 |
| 31 | + |
| 32 | +# AppImage runtime |
| 33 | +RUN curl -L -o /opt/appimage-runtime 'https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-aarch64' |
| 34 | + |
| 35 | +# squashfs-tools |
| 36 | +RUN mkdir -p /build/squashfs-tools && \ |
| 37 | + cd /build/squashfs-tools && \ |
| 38 | + curl -L -o squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz "https://github.com/plougher/squashfs-tools/archive/refs/tags/${SQUASHFS_TOOLS_VERSION}.tar.gz" && \ |
| 39 | + tar xf squashfs-tools-${SQUASHFS_TOOLS_VERSION}.tar.gz && \ |
| 40 | + cd squashfs-tools-${SQUASHFS_TOOLS_VERSION}/squashfs-tools && \ |
| 41 | + make ZSTD_SUPPORT=1 -j$(nproc) && \ |
| 42 | + make install && \ |
| 43 | + # cleanup |
| 44 | + cd / && \ |
| 45 | + rm -r /build/squashfs-tools |
| 46 | + |
| 47 | +# Qt 5 |
| 48 | +RUN mkdir -p /build/qt5 && \ |
| 49 | + cd /build/qt5 && \ |
| 50 | + 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" && \ |
| 51 | + tar xf qtbase-everywhere-src-${QT_VERSION}.tar.xz && \ |
| 52 | + cd qtbase-everywhere-src-${QT_VERSION} && \ |
| 53 | + ./configure \ |
| 54 | + -prefix /usr/local \ |
| 55 | + -opensource -confirm-license \ |
| 56 | + -optimize-size -no-shared -static -platform linux-g++ -no-use-gold-linker \ |
| 57 | + -qt-zlib -qt-doubleconversion -iconv -no-icu -qt-pcre -no-openssl -system-freetype -fontconfig -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-xcb -qt-sqlite \ |
| 58 | + -nomake examples -nomake tests -nomake tools && \ |
| 59 | + make -j$(nproc) && \ |
| 60 | + make install && \ |
| 61 | + # svg package |
| 62 | + cd /build/qt5 && \ |
| 63 | + tar xf qtsvg-everywhere-src-${QT_VERSION}.tar.xz && \ |
| 64 | + cd qtsvg-everywhere-src-${QT_VERSION} && \ |
| 65 | + qmake . && \ |
| 66 | + make -j$(nproc) && \ |
| 67 | + make install && \ |
| 68 | + # tools package |
| 69 | + cd /build/qt5 && \ |
| 70 | + tar xf qttools-everywhere-src-${QT_VERSION}.tar.xz && \ |
| 71 | + cd qttools-everywhere-src-${QT_VERSION} && \ |
| 72 | + qmake . && \ |
| 73 | + make -j$(nproc) && \ |
| 74 | + make install && \ |
| 75 | + # wayland package |
| 76 | + cd /build/qt5 && \ |
| 77 | + tar xf qtwayland-everywhere-src-${QT_VERSION}.tar.xz && \ |
| 78 | + cd qtwayland-everywhere-src-${QT_VERSION} && \ |
| 79 | + qmake . && \ |
| 80 | + make -j$(nproc) && \ |
| 81 | + make install && \ |
| 82 | + # cleanup |
| 83 | + cd / && \ |
| 84 | + rm -r /build/qt5 |
| 85 | + |
| 86 | +# fcitx5-qt |
| 87 | +RUN yum install -y \ |
| 88 | + cmake3 extra-cmake-modules && \ |
| 89 | + mkdir -p /build/qt5 && \ |
| 90 | + cd /build/qt5 && \ |
| 91 | + curl -L -o fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz "https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${FCITX5_QT_VERSION}.tar.gz" && \ |
| 92 | + tar xf fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz && \ |
| 93 | + cd fcitx5-qt-${FCITX5_QT_VERSION} && \ |
| 94 | + 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 && \ |
| 95 | + cmake3 --build build --parallel && \ |
| 96 | + # cmake 3.14 is too old to `--install` |
| 97 | + cmake3 --build build -- install && \ |
| 98 | + # cleanup |
| 99 | + yum autoremove -y \ |
| 100 | + cmake3 extra-cmake-modules && \ |
| 101 | + yum clean all && \ |
| 102 | + cd / && \ |
| 103 | + rm -r /build/qt5 |
0 commit comments