FROM centos:7 AS builder ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig ENV CMAKE_VER 3.21.3 ENV CMAKE_FILE cmake-$CMAKE_VER-Linux-x86_64.sh RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm RUN yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm RUN yum -y install centos-release-scl RUN yum -y install git meson ninja-build autoconf automake libtool \ fontconfig-devel freetype-devel libX11-devel at-spi2-core-devel \ mesa-libGL-devel mesa-libEGL-devel libudev-devel \ pkgconfig bison yasm file which xorg-x11-util-macros \ devtoolset-9-make devtoolset-9-gcc devtoolset-9-gcc-c++ SHELL [ "bash", "-c", ". /opt/rh/devtoolset-9/enable; exec bash -c \"$@\"", "-s"] ENV LibrariesPath /usr/src/Libraries WORKDIR $LibrariesPath RUN mkdir /opt/cmake RUN curl -sSLo $CMAKE_FILE https://github.com/Kitware/CMake/releases/download/v$CMAKE_VER/$CMAKE_FILE RUN sh $CMAKE_FILE --prefix=/opt/cmake --skip-license RUN ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake RUN rm $CMAKE_FILE FROM builder AS libffi RUN git clone -b v3.3 --depth=1 https://github.com/libffi/libffi.git WORKDIR libffi RUN ./autogen.sh RUN ./configure --enable-static --disable-docs RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/libffi-cache" install WORKDIR .. RUN rm -rf libffi FROM builder AS zlib RUN git clone -b v1.2.11 --depth=1 https://github.com/madler/zlib.git WORKDIR zlib RUN ./configure --static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/zlib-cache" install WORKDIR .. RUN rm -rf zlib FROM builder AS xz RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git WORKDIR xz RUN cmake -B build . -DCMAKE_BUILD_TYPE=Release RUN cmake --build build -j$(nproc) RUN DESTDIR="$LibrariesPath/xz-cache" cmake --install build WORKDIR .. RUN rm -rf xz FROM builder AS mozjpeg RUN git clone -b v4.0.3 --depth=1 https://github.com/mozilla/mozjpeg.git WORKDIR mozjpeg RUN cmake -B build . \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DWITH_JPEG8=ON \ -DPNG_SUPPORTED=OFF RUN cmake --build build -j$(nproc) RUN DESTDIR="$LibrariesPath/mozjpeg-cache" cmake --install build WORKDIR .. RUN rm -rf mozjpeg FROM builder AS xcb-proto RUN git clone -b xcb-proto-1.14 --depth=1 https://gitlab.freedesktop.org/xorg/proto/xcbproto.git WORKDIR xcbproto RUN ./autogen.sh RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-proto-cache" install WORKDIR .. RUN rm -rf xcbproto FROM builder AS xcb COPY --from=xcb-proto ${LibrariesPath}/xcb-proto-cache / RUN git clone -b libxcb-1.14 --depth=1 https://gitlab.freedesktop.org/xorg/lib/libxcb.git WORKDIR libxcb RUN ./autogen.sh --enable-static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-cache" install WORKDIR .. RUN rm -rf libxcb FROM builder AS xcb-wm RUN git clone -b 0.4.1 --depth=1 --recursive https://gitlab.freedesktop.org/xorg/lib/libxcb-wm.git WORKDIR libxcb-wm RUN ./autogen.sh --enable-static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-wm-cache" install FROM builder AS xcb-util RUN git clone -b 0.4.0 --depth=1 --recursive https://gitlab.freedesktop.org/xorg/lib/libxcb-util.git WORKDIR libxcb-util RUN ./autogen.sh --enable-static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-util-cache" install FROM builder AS xcb-image COPY --from=xcb-util ${LibrariesPath}/xcb-util-cache / RUN git clone -b 0.4.0 --depth=1 --recursive https://gitlab.freedesktop.org/xorg/lib/libxcb-image.git WORKDIR libxcb-image RUN ./autogen.sh --enable-static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-image-cache" install FROM builder AS xcb-keysyms RUN git clone -b 0.4.0 --depth=1 --recursive https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms.git WORKDIR libxcb-keysyms RUN ./autogen.sh --enable-static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-keysyms-cache" install FROM builder AS xcb-render-util RUN git clone -b 0.3.9 --depth=1 --recursive https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util.git WORKDIR libxcb-render-util RUN ./autogen.sh --enable-static RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/xcb-render-util-cache" install FROM builder AS wayland COPY --from=libffi ${LibrariesPath}/libffi-cache / RUN git clone -b 1.19.0 --depth=1 https://gitlab.freedesktop.org/wayland/wayland.git WORKDIR wayland RUN ./autogen.sh \ --enable-static \ --disable-documentation \ --disable-dtd-validation RUN make -j$(nproc) RUN make DESTDIR="$LibrariesPath/wayland-cache" install WORKDIR .. RUN rm -rf wayland FROM builder AS xkbcommon COPY --from=xcb ${LibrariesPath}/xcb-cache / RUN git clone -b xkbcommon-1.0.3 --depth=1 https://github.com/xkbcommon/libxkbcommon.git WORKDIR libxkbcommon RUN meson build \ --buildtype=release \ --default-library=both \ -Denable-docs=false \ -Denable-wayland=false \ -Denable-xkbregistry=false \ -Dxkb-config-root=/usr/share/X11/xkb \ -Dxkb-config-extra-path=/etc/xkb \ -Dx-locale-root=/usr/share/X11/locale RUN meson compile -C build -j$(nproc) RUN DESTDIR="$LibrariesPath/xkbcommon-cache" meson install -C build WORKDIR .. RUN rm -rf libxkbcommon FROM builder AS qt COPY --from=libffi ${LibrariesPath}/libffi-cache / COPY --from=zlib ${LibrariesPath}/zlib-cache / COPY --from=mozjpeg ${LibrariesPath}/mozjpeg-cache / COPY --from=xcb ${LibrariesPath}/xcb-cache / COPY --from=xcb-wm ${LibrariesPath}/xcb-wm-cache / COPY --from=xcb-util ${LibrariesPath}/xcb-util-cache / COPY --from=xcb-image ${LibrariesPath}/xcb-image-cache / COPY --from=xcb-keysyms ${LibrariesPath}/xcb-keysyms-cache / COPY --from=xcb-render-util ${LibrariesPath}/xcb-render-util-cache / COPY --from=wayland ${LibrariesPath}/wayland-cache / COPY --from=xkbcommon ${LibrariesPath}/xkbcommon-cache / RUN git clone -b 6.2 --depth=1 git://code.qt.io/qt/qt5.git WORKDIR qt5 RUN perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg RUN ./configure \ -release \ -force-debug-info \ -opensource \ -confirm-license \ -qt-libpng \ -qt-harfbuzz \ -qt-pcre \ -no-icu \ -static \ -dbus-runtime \ -nomake examples \ -nomake tests RUN cmake --build . -j$(nproc) RUN cmake --install .