2023-03-04 18:44:39 +08:00
|
|
|
# RHEL devtoolset, which provides new version of GCC targetting old libgcc_s and libstdc++, is the key to compatibility.
|
2023-08-13 20:56:46 +08:00
|
|
|
# EL 7 is modern enough for apps and libs.
|
2023-03-04 18:44:39 +08:00
|
|
|
FROM docker.io/amd64/centos: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 install -y centos-release-scl-rh epel-release && \
|
2023-03-04 18:44:39 +08:00
|
|
|
yum upgrade -y && \
|
2023-08-13 20:56:46 +08:00
|
|
|
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-03-04 18:44:39 +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 xcb-util-devel \
|
2023-08-13 20:56:46 +08:00
|
|
|
# fcitx5-qt build tools
|
|
|
|
cmake3 extra-cmake-modules && \
|
|
|
|
yum clean all
|
2023-03-04 18:44:39 +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
|
|
|
|
|
2023-08-13 20:56:46 +08:00
|
|
|
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-x86_64'
|
|
|
|
|
|
|
|
# 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-08-13 20:56:46 +08:00
|
|
|
curl -O "https://download.qt.io/archive/qt/${QT_MAJOR_MINOR}/${QT_VERSION}/submodules/qt{base,svg,tools}-everywhere-src-${QT_VERSION}.tar.xz" && \
|
|
|
|
curl -L -o fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz "https://github.com/fcitx/fcitx5-qt/archive/refs/tags/${FCITX5_QT_VERSION}.tar.gz" && \
|
|
|
|
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-07-03 14:06:10 +08:00
|
|
|
# fcitx5 package
|
|
|
|
cd /build/qt5 && \
|
2023-08-13 20:56:46 +08:00
|
|
|
tar xf fcitx5-qt-${FCITX5_QT_VERSION}.tar.gz && \
|
|
|
|
cd fcitx5-qt-${FCITX5_QT_VERSION} && \
|
2023-07-03 14:06:10 +08:00
|
|
|
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 && \
|
|
|
|
cmake3 --install build && \
|
2023-03-04 18:44:39 +08:00
|
|
|
# cleanup
|
2023-01-03 12:18:02 +08:00
|
|
|
cd / && \
|
|
|
|
rm -r /build/qt5
|