From 1ec30b8fbe4a162d6e2e6a9711d83f1bafd9b645 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 17 Jul 2019 15:22:32 -0400 Subject: [PATCH 1/8] depends: xproto is only directly needed by libXau --- depends/packages/libxcb.mk | 2 +- depends/packages/qt.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/libxcb.mk b/depends/packages/libxcb.mk index 9402951826d..c497c5ac20f 100644 --- a/depends/packages/libxcb.mk +++ b/depends/packages/libxcb.mk @@ -3,7 +3,7 @@ $(package)_version=1.10 $(package)_download_path=https://xcb.freedesktop.org/dist $(package)_file_name=$(package)-$($(package)_version).tar.bz2 $(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5 -$(package)_dependencies=xcb_proto libXau xproto +$(package)_dependencies=xcb_proto libXau define $(package)_set_vars $(package)_config_opts=--disable-static diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 7c7081eaba3..7b70087544d 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -5,7 +5,7 @@ $(package)_suffix=opensource-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=36dd9574f006eaa1e5af780e4b33d11fe39d09fd7c12f3b9d83294174bd28f00 $(package)_dependencies=openssl zlib -$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext +$(package)_linux_dependencies=freetype fontconfig libxcb libX11 libXext $(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch From 9a01ab04e1125b37618266d7fd1c3a6e3bb7e3f8 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 17 Jul 2019 16:21:30 -0400 Subject: [PATCH 2/8] depends: qt: Explicitly stop using Xlib/libX11 Previously, in 683b7d7a3fc1b9240333faf3d04497aa61583016 and 0e752637a26cf75187864a466db9a92540a2d3c8, we accidentally broke QT's ability to pick up Xlib thru the config.gui.tests.xlib configuration test, which also means that config.gui.libraries.xcb_xlib wasn't run. This resulted in a QT build that was implicitly -no-xcb-lib and -no-feature-xlib. This is actually a desired behaviour, as it means less required shared objects for our final bitcoin-qt binary. Specifically, it eliminated the libX11-xcb.so.1 and libX11.so.6 requirements. In this commit, we explicitly build without Xlib. We should continue to track upstream ticket https://bugreports.qt.io/browse/QTBUG-61452 which talks about adding a -no-xlib (non-hidden) flag instead of the -no-feature-xlib (hidden) flag. --- depends/packages/qt.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 7b70087544d..d0beb8888cc 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -98,6 +98,8 @@ endif $(package)_config_opts_linux = -qt-xkbcommon-x11 $(package)_config_opts_linux += -qt-xcb +$(package)_config_opts_linux += -no-xcb-xlib +$(package)_config_opts_linux += -no-feature-xlib $(package)_config_opts_linux += -system-freetype $(package)_config_opts_linux += -no-feature-sessionmanager $(package)_config_opts_linux += -fontconfig From aa53cb7a2f04a59a4722c662e67b7a6ec04e32b5 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 17 Jul 2019 16:21:50 -0400 Subject: [PATCH 3/8] depends: libX11: Make package headers-only We're no longer building QT with libX11/XLib, however, libX11/XLib headers are still required for parts of QT. In this commit we add a minimal configure.ac for libX11/XLib that is headers-only. This change allows us to remove all of libX11/XLib's dependencies. --- depends/packages/libX11.mk | 22 +++++----------------- depends/packages/packages.mk | 2 +- depends/packages/xextproto.mk | 25 ------------------------- depends/packages/xtrans.mk | 26 -------------------------- depends/patches/libX11/configure.ac | 6 ++++++ 5 files changed, 12 insertions(+), 69 deletions(-) delete mode 100644 depends/packages/xextproto.mk delete mode 100644 depends/packages/xtrans.mk create mode 100644 depends/patches/libX11/configure.ac diff --git a/depends/packages/libX11.mk b/depends/packages/libX11.mk index f46bd9219e9..abf21963e7c 100644 --- a/depends/packages/libX11.mk +++ b/depends/packages/libX11.mk @@ -3,30 +3,18 @@ $(package)_version=1.6.2 $(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ $(package)_file_name=$(package)-$($(package)_version).tar.bz2 $(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16 -$(package)_dependencies=libxcb xtrans xextproto xproto - -define $(package)_set_vars - # See libXext for --disable-malloc0returnsnull rationale. - $(package)_config_opts=--disable-xkb --disable-static --disable-malloc0returnsnull - $(package)_config_opts_linux=--with-pic -endef +$(package)_patches=configure.ac define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . && \ + cp -f $($(package)_patch_dir)/configure.ac . endef define $(package)_config_cmds + autoreconf --install --force --verbose && \ $($(package)_autoconf) endef -define $(package)_build_cmds - $(MAKE) -endef - define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef - -define $(package)_postprocess_cmds - rm lib/*.la + $(MAKE) -C include DESTDIR=$($(package)_staging_dir) install-x11includeHEADERS endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 93f0918fe95..7e39e205ef2 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -3,7 +3,7 @@ packages:=boost openssl libevent qt_native_packages = native_protobuf qt_packages = qrencode protobuf zlib -qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans +qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libX11 libXext rapidcheck_packages = rapidcheck diff --git a/depends/packages/xextproto.mk b/depends/packages/xextproto.mk deleted file mode 100644 index 157b76edf6f..00000000000 --- a/depends/packages/xextproto.mk +++ /dev/null @@ -1,25 +0,0 @@ -package=xextproto -$(package)_version=7.3.0 -$(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0 - -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . -endef - -define $(package)_set_vars -$(package)_config_opts=--disable-shared -endef - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/depends/packages/xtrans.mk b/depends/packages/xtrans.mk deleted file mode 100644 index 6201d1d2707..00000000000 --- a/depends/packages/xtrans.mk +++ /dev/null @@ -1,26 +0,0 @@ -package=xtrans -$(package)_version=1.3.4 -$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc33544f583a -$(package)_dependencies= - -define $(package)_set_vars - $(package)_config_opts_linux=--disable-docs --without-xmlto --without-fop --without-xsltproc -endef - -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . -endef - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/depends/patches/libX11/configure.ac b/depends/patches/libX11/configure.ac new file mode 100644 index 00000000000..1c3bd41b3f6 --- /dev/null +++ b/depends/patches/libX11/configure.ac @@ -0,0 +1,6 @@ +AC_PREREQ([2.60]) +AC_INIT([libX11], [1.6.2], + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11]) +AM_INIT_AUTOMAKE([foreign]) +AC_CONFIG_FILES([include/Makefile]) +AC_OUTPUT From 689d3b4a030675b6de87a55463a8e155843293fb Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 16 Jul 2019 19:58:34 -0400 Subject: [PATCH 4/8] build-aux: Remove check for x11-xcb We're no longer building QT with libX11/XLib, so it doesn't make sense to check for the x11-xcb package. --- build-aux/m4/bitcoin_qt.m4 | 1 - 1 file changed, 1 deletion(-) diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index 1a7c5d5f7d3..8ccbb19300b 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -355,7 +355,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[ PKG_CHECK_MODULES([QTFB], [Qt5FbSupport], [QT_LIBS="-lQt5FbSupport $QT_LIBS"]) fi if test "x$TARGET_OS" = xlinux; then - PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"]) elif test "x$TARGET_OS" = xdarwin; then PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport], [QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"]) From 924569914e6079763fd1692bed372ded2c63d685 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 17 Jul 2019 15:43:25 -0400 Subject: [PATCH 5/8] depends: libXext isn't needed by anyone libXext was only needed (as a library) by QT when it was using XLib/libX11 (as a library), now that we're building QT without XLib/libX11, we can safely remove libXext. --- depends/packages/libXext.mk | 53 ------------------------------------ depends/packages/packages.mk | 2 +- depends/packages/qt.mk | 2 +- 3 files changed, 2 insertions(+), 55 deletions(-) delete mode 100644 depends/packages/libXext.mk diff --git a/depends/packages/libXext.mk b/depends/packages/libXext.mk deleted file mode 100644 index 77f32a340ee..00000000000 --- a/depends/packages/libXext.mk +++ /dev/null @@ -1,53 +0,0 @@ -package=libXext -$(package)_version=1.3.3 -$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=b518d4d332231f313371fdefac59e3776f4f0823bcb23cf7c7305bfb57b16e35 -$(package)_dependencies=xproto xextproto libX11 libXau - -define $(package)_set_vars - # A number of steps in the autoconfig process implicitly assume that the build - # system and the host system are the same. For example, library components - # want to build and run test programs to determine the behavior of certain - # host system elements. This is clearly impossible when crosscompiling. To - # work around these issues, the --enable-malloc0returnsnull (or - # --disable-malloc0returnsnull, depending on the host system) must be passed - # to configure. - # -- https://www.x.org/wiki/CrossCompilingXorg/ - # - # Concretely, between the releases of libXext 1.3.2 and 1.3.3, - # XORG_CHECK_MALLOC_ZERO from xorg-macros was changed to use the autoconf - # cache, expecting cross-compilation environments to seed this cache as there - # is no single correct value when cross compiling (think uclibc, musl, etc.). - # You can see the actual change in commit 72fdc868b56fe2b7bdc9a69872651baeca72 - # in the freedesktop/xorg-macros repo. - # - # As a result of this change, if we don't seed the cache and we don't use - # either --{en,dis}able-malloc0returnsnull, the AC_RUN_IFELSE block has no - # optional action-if-cross-compiling argument and configure prints an error - # message and exits as documented in the autoconf manual. Prior to this - # commit, the AC_RUN_IFELSE block had an action-if-cross-compiling argument - # which set the more pessimistic default value MALLOC_ZERO_RETURNS_NULL=yes. - # This is why the flag was not required prior to libXext 1.3.3. - $(package)_config_opts=--disable-static --disable-malloc0returnsnull -endef - -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . -endef - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef - -define $(package)_postprocess_cmds - rm lib/*.la -endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 7e39e205ef2..09f9e68677e 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -3,7 +3,7 @@ packages:=boost openssl libevent qt_native_packages = native_protobuf qt_packages = qrencode protobuf zlib -qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libX11 libXext +qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libX11 rapidcheck_packages = rapidcheck diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index d0beb8888cc..902a42b9625 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -5,7 +5,7 @@ $(package)_suffix=opensource-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=36dd9574f006eaa1e5af780e4b33d11fe39d09fd7c12f3b9d83294174bd28f00 $(package)_dependencies=openssl zlib -$(package)_linux_dependencies=freetype fontconfig libxcb libX11 libXext +$(package)_linux_dependencies=freetype fontconfig libxcb libX11 $(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch From 65f8da08df601ac98bad6f638392343fd564c0b9 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 17 Jul 2019 17:09:48 -0400 Subject: [PATCH 6/8] symbol-check: Disallow libX11-*.so.* shared libraries They should no longer be needed as we build QT without libX11/XLib libraries now. --- contrib/devtools/symbol-check.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 7729dd7257d..dd35d862c92 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -67,8 +67,6 @@ 'ld-linux-armhf.so.3', # 32-bit ARM dynamic linker 'ld-linux-riscv64-lp64d.so.1', # 64-bit RISC-V dynamic linker # bitcoin-qt only -'libX11-xcb.so.1', # part of X11 -'libX11.so.6', # part of X11 'libxcb.so.1', # part of X11 'libfontconfig.so.1', # font support 'libfreetype.so.6', # font parsing From 222e6cc52075cf6f866ce4a2e5900f0d6358f903 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Thu, 18 Jul 2019 17:41:50 -0400 Subject: [PATCH 7/8] gitignore: Actually pay attention to depends patches There was a previous attempt to achieve this, and it was bad. This works. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 394c76b51ae..5cef80f92fd 100644 --- a/.gitignore +++ b/.gitignore @@ -77,7 +77,7 @@ src/qt/bitcoin-qt.includes # Only ignore unexpected patches *.patch -!depends/patches/*.patch +!depends/patches/**/*.patch #libtool object files *.lo From 0c55d8b58186ba69fffc147cd02b174450dac578 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Thu, 18 Jul 2019 17:43:06 -0400 Subject: [PATCH 8/8] depends: qt: Patch to remove dep on libX11 We can actually patch QT to remove its dependency on libX11's headers. It turns it this wasn't that hard. --- depends/packages/libX11.mk | 20 --------- depends/packages/packages.mk | 2 +- depends/packages/qt.mk | 5 ++- depends/patches/libX11/configure.ac | 6 --- depends/patches/qt/no-xlib.patch | 69 +++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 29 deletions(-) delete mode 100644 depends/packages/libX11.mk delete mode 100644 depends/patches/libX11/configure.ac create mode 100644 depends/patches/qt/no-xlib.patch diff --git a/depends/packages/libX11.mk b/depends/packages/libX11.mk deleted file mode 100644 index abf21963e7c..00000000000 --- a/depends/packages/libX11.mk +++ /dev/null @@ -1,20 +0,0 @@ -package=libX11 -$(package)_version=1.6.2 -$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16 -$(package)_patches=configure.ac - -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . && \ - cp -f $($(package)_patch_dir)/configure.ac . -endef - -define $(package)_config_cmds - autoreconf --install --force --verbose && \ - $($(package)_autoconf) -endef - -define $(package)_stage_cmds - $(MAKE) -C include DESTDIR=$($(package)_staging_dir) install-x11includeHEADERS -endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 09f9e68677e..9edcd1eb38e 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -3,7 +3,7 @@ packages:=boost openssl libevent qt_native_packages = native_protobuf qt_packages = qrencode protobuf zlib -qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libX11 +qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig rapidcheck_packages = rapidcheck diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 902a42b9625..6f369e2c524 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -5,10 +5,10 @@ $(package)_suffix=opensource-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=36dd9574f006eaa1e5af780e4b33d11fe39d09fd7c12f3b9d83294174bd28f00 $(package)_dependencies=openssl zlib -$(package)_linux_dependencies=freetype fontconfig libxcb libX11 +$(package)_linux_dependencies=freetype fontconfig libxcb $(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib -$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch +$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=b36da7d93c3ab6fca56b32053bb73bc619c8b192bb89b74e3bcde2705f1c2a14 @@ -158,6 +158,7 @@ define $(package)_preprocess_cmds echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ patch -p1 -i $($(package)_patch_dir)/fix_riscv64_arch.patch &&\ + patch -p1 -i $($(package)_patch_dir)/no-xlib.patch &&\ echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ sed -i.old "s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ diff --git a/depends/patches/libX11/configure.ac b/depends/patches/libX11/configure.ac deleted file mode 100644 index 1c3bd41b3f6..00000000000 --- a/depends/patches/libX11/configure.ac +++ /dev/null @@ -1,6 +0,0 @@ -AC_PREREQ([2.60]) -AC_INIT([libX11], [1.6.2], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11]) -AM_INIT_AUTOMAKE([foreign]) -AC_CONFIG_FILES([include/Makefile]) -AC_OUTPUT diff --git a/depends/patches/qt/no-xlib.patch b/depends/patches/qt/no-xlib.patch new file mode 100644 index 00000000000..fe82c2c73cb --- /dev/null +++ b/depends/patches/qt/no-xlib.patch @@ -0,0 +1,69 @@ +From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001 +From: Carl Dong +Date: Thu, 18 Jul 2019 17:22:05 -0400 +Subject: [PATCH] Wrap xlib related code blocks in #if's + +They are not necessary to compile QT. +--- + qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp +index 7c62c2e2b3..c05c6c0a07 100644 +--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp ++++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp +@@ -49,7 +49,9 @@ + #include + #include + #include ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) + #include ++#endif + #include + #include + +@@ -384,6 +386,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget) + w->setCursor(c, isBitmapCursor); + } + ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) + static int cursorIdForShape(int cshape) + { + int cursorId = 0; +@@ -437,6 +440,7 @@ static int cursorIdForShape(int cshape) + } + return cursorId; + } ++#endif + + xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) + { +@@ -558,7 +562,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) + xcb_cursor_t QXcbCursor::createFontCursor(int cshape) + { + xcb_connection_t *conn = xcb_connection(); ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) + int cursorId = cursorIdForShape(cshape); ++#endif + xcb_cursor_t cursor = XCB_NONE; + + // Try Xcursor first +@@ -589,6 +595,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) + // Non-standard X11 cursors are created from bitmaps + cursor = createNonStandardCursor(cshape); + ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) + // Create a glpyh cursor if everything else failed + if (!cursor && cursorId) { + cursor = xcb_generate_id(conn); +@@ -596,6 +603,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) + cursorId, cursorId + 1, + 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); + } ++#endif + + if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { + const char *name = cursorNames[cshape]; +-- +2.22.0 +