Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137004

xcb-image is missing dependency on xcb-aux

    XMLWordPrintable

Details

    • Linux/X11
    • 3d9bbd532 (dev), 7c25b916d (dev)

    Description

      Building Qt statically with the following Dockerfile:

      FROM rockylinux:8 AS builder
      ENV LANG=C.UTF-8
      ENV PATH=/opt/rh/gcc-toolset-12/root/usr/bin:$PATH
      ENV LIBRARY_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/usr/local/lib64:/usr/local/lib:/lib64:/lib:/usr/lib64:/usr/lib
      ENV LD_LIBRARY_PATH=$LIBRARY_PATH
      ENV PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:/opt/rh/gcc-toolset-12/root/usr/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig
      
      RUN dnf -y install epel-release \
      	&& dnf config-manager --set-enabled powertools \
      	&& dnf -y install autoconf automake bison cmake git gperf libtool \
      		make pkgconf gcc-toolset-12-binutils gcc-toolset-12-gcc-c++ \
      		python3-pip perl-IPC-Cmd fontconfig-devel freetype-devel \
      		zlib-devel xorg-x11-util-macros libX11-devel wayland-devel \
      		mesa-libGL-devel mesa-libEGL-devel vulkan-devel \
      		libselinux-devel libmount-devel systemd-devel glib2-devel \
      		at-spi2-core-devel gtk3-devel \
      	&& dnf clean all
      
      RUN python3 -m pip install meson ninja
      
      RUN cat <<EOF > /usr/local/bin/pkg-config && chmod +x /usr/local/bin/pkg-config
      #!/bin/sh
      for i in "\$@"; do
      	[ "\$i" = "--version" ] && exec /usr/bin/pkg-config "\$i"
      done
      exec /usr/bin/pkg-config --static "\$@"
      EOF
      
      WORKDIR /usr/src
      ENV CFLAGS=-O3 -fPIC
      ENV CXXFLAGS=$CFLAGS
      
      FROM builder AS xcb-proto
      RUN git clone -b xcb-proto-1.16.0 --depth=1 https://gitlab.freedesktop.org/xorg/proto/xcbproto.git \
      	&& cd xcbproto \
      	&& ./autogen.sh \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-proto-cache" install \
      	&& cd .. \
      	&& rm -rf xcbproto
      
      FROM builder AS xcb
      COPY --from=xcb-proto /usr/src/xcb-proto-cache /
      
      RUN git clone -b libxcb-1.16 --depth=1 https://gitlab.freedesktop.org/xorg/lib/libxcb.git \
      	&& cd libxcb \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-cache" install \
      	&& rm /usr/src/xcb-cache/usr/local/lib/{libxcb.{,l}a,pkgconfig/xcb.pc} \
      	&& cd .. \
      	&& rm -rf libxcb
      
      FROM builder AS xcb-wm
      RUN git clone -b xcb-util-wm-0.4.2 --depth=1 --recursive --shallow-submodules https://gitlab.freedesktop.org/xorg/lib/libxcb-wm.git \
      	&& cd libxcb-wm \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-wm-cache" install \
      	&& cd .. \
      	&& rm -rf libxcb-wm
      
      FROM builder AS xcb-util
      RUN git clone -b xcb-util-0.4.1 --depth=1 --recursive --shallow-submodules https://gitlab.freedesktop.org/xorg/lib/libxcb-util.git \
      	&& cd libxcb-util \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-util-cache" install \
      	&& cd .. \
      	&& rm -rf libxcb-util
      
      FROM builder AS xcb-image
      COPY --from=xcb-util /usr/src/xcb-util-cache /
      
      RUN git clone -b xcb-util-image-0.4.1 --depth=1 --recursive --shallow-submodules https://gitlab.freedesktop.org/xorg/lib/libxcb-image.git \
      	&& cd libxcb-image \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-image-cache" install \
      	&& cd .. \
      	&& rm -rf libxcb-image
      
      FROM builder AS xcb-keysyms
      RUN git clone -b xcb-util-keysyms-0.4.1 --depth=1 --recursive --shallow-submodules https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms.git \
      	&& cd libxcb-keysyms \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-keysyms-cache" install \
      	&& cd .. \
      	&& rm -rf libxcb-keysyms
      
      FROM builder AS xcb-render-util
      RUN git clone -b xcb-util-renderutil-0.3.10 --depth=1 --recursive --shallow-submodules https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util.git \
      	&& cd libxcb-render-util \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-render-util-cache" install \
      	&& cd .. \
      	&& rm -rf libxcb-render-util
      
      FROM builder AS xcb-cursor
      COPY --from=xcb-util /usr/src/xcb-util-cache /
      COPY --from=xcb-image /usr/src/xcb-image-cache /
      COPY --from=xcb-render-util /usr/src/xcb-render-util-cache /
      
      RUN git clone -b xcb-util-cursor-0.1.4 --depth=1 --recursive --shallow-submodules https://gitlab.freedesktop.org/xorg/lib/libxcb-cursor.git \
      	&& cd libxcb-cursor \
      	&& ./autogen.sh --enable-static --disable-shared \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/xcb-cursor-cache" install \
      	&& cd .. \
      	&& rm -rf libxcb-cursor
      
      FROM builder AS xkbcommon
      COPY --from=xcb /usr/src/xcb-cache /
      
      RUN git clone -b xkbcommon-1.6.0 --depth=1 https://github.com/xkbcommon/libxkbcommon.git \
      	&& cd libxkbcommon \
      	&& meson build \
      		--buildtype=release \
      		--default-library=static \
      		-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 \
      	&& meson compile -C build \
      	&& DESTDIR="/usr/src/xkbcommon-cache" meson install -C build \
      	&& cd .. \
      	&& rm -rf libxkbcommon
      
      FROM builder AS openssl
      RUN git clone -b openssl-3.2.1 --depth=1 https://github.com/openssl/openssl.git \
      	&& cd openssl \
      	&& ./config \
      		--openssldir=/etc/ssl \
      		no-tests \
      		no-dso \
      	&& make -j$(nproc) \
      	&& make DESTDIR="/usr/src/openssl-cache" install_sw \
      	&& cd .. \
      	&& rm -rf openssl
      
      FROM builder
      COPY --from=xcb /usr/src/xcb-cache /
      COPY --from=xcb-wm /usr/src/xcb-wm-cache /
      COPY --from=xcb-util /usr/src/xcb-util-cache /
      COPY --from=xcb-image /usr/src/xcb-image-cache /
      COPY --from=xcb-keysyms /usr/src/xcb-keysyms-cache /
      COPY --from=xcb-render-util /usr/src/xcb-render-util-cache /
      COPY --from=xcb-cursor /usr/src/xcb-cursor-cache /
      COPY --from=xkbcommon /usr/src/xkbcommon-cache /
      COPY --from=openssl /usr/src/openssl-cache /
      
      RUN git clone -b v6.9.0 --depth=1 https://github.com/qt/qt5.git \
      	&& cd qt5 \
      	&& git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtshadertools \
      	&& cmake -GNinja -B build . \
      		-DCMAKE_BUILD_TYPE=Release \
      		-DBUILD_SHARED_LIBS=OFF \
      		-DQT_GENERATE_SBOM=OFF \
      		-DINPUT_libpng=qt \
      		-DINPUT_harfbuzz=qt \
      		-DINPUT_pcre=qt \
      		-DINPUT_webp=qt \
      		-DFEATURE_icu=OFF \
      		-DFEATURE_xcb_sm=OFF \
      		-DINPUT_dbus=runtime \
      		-DINPUT_openssl=linked \
      	&& cmake --build build --parallel \
      	&& DESTDIR="/usr/src/qt-cache" cmake --install build \
      	&& cd .. \
      	&& rm -rf qt5
      

      Results in the following error:

      508.0 /opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: /usr/local/lib/libxcb-image.a(xcb_image.o): in function `xcb_create_pixmap_from_bitmap_data':
      508.0 xcb_image.c:(.text+0x14aa): undefined reference to `xcb_aux_create_gc'
      508.0 collect2: error: ld returned 1 exit status
      

      If I patch FindXCB.cmake like that:

      diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake
      index 26b9bf89633..0c546d09a8b 100644
      --- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake
      +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake
      @@ -145,7 +145,7 @@ endforeach()
       set(XCB_XCB_component_deps)
       set(XCB_COMPOSITE_component_deps XCB XFIXES)
       set(XCB_DAMAGE_component_deps XCB XFIXES)
      -set(XCB_IMAGE_component_deps XCB SHM)
      +set(XCB_IMAGE_component_deps XCB SHM AUX)
       set(XCB_RENDERUTIL_component_deps XCB RENDER)
       set(XCB_XFIXES_component_deps XCB RENDER SHAPE)
       set(XCB_XVMC_component_deps XCB XV)
      

      The build succeeds

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtbuildsystem Qt Build System Team
              ilya-fedin Ilya Fedin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change