upgrading ddcutil [ebuild U ~] app-misc/ddcutil-2.2.0:0/5::gentoo [2.1.4:0/5::gentoo] USE="user-permissions -X -usb-monitor (-drm%)" VIDEO_CARDS="-nvidia" 0 KiB although flag -X, and this is really a minimal fresh installation without X, it still does search for X headers and fails: .... Making all in ddc make[3]: Entering directory '/var/tmp/portage/app-misc/ddcutil-2.2.0/work/ddcutil-2.2.0/src/ddc' /bin/sh ../../libtool --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/libdrm -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../../src -I../../src/public -Wall -std=c11 -Werror=unused-result -Wformat-security -fno-common -Wimplicit-function-declaration -Wno-compound-token-split-by-macro -Wimplicit-fallthrough -D_GLIBCXX_ASSERTIONS -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion -fPIC -D_GNU_SOURCE -O2 -pipe -march=goldmont-plus -c -o ddc_common_init.lo ddc_common_init.c libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/libdrm -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../../src -I../../src/public -Wall -std=c11 -Werror=unused-result -Wformat-security -fno-common -Wimplicit-function-declaration -Wno-compound-token-split-by-macro -Wimplicit-fallthrough -D_GLIBCXX_ASSERTIONS -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion -fPIC -D_GNU_SOURCE -O2 -pipe -march=goldmont-plus -c ddc_common_init.c -fPIC -DPIC -o .l ibs/ddc_common_init.o In file included from ../../src/dw/dw_common.h:17, from ddc_common_init.c:68: ../../src/dw/dw_xevent.h:10:10: fatal error: X11/Xlib.h: No such file or directory 10 | #include <X11/Xlib.h> | ^~~~~~~~~~~~ compilation terminated. make[3]: *** [Makefile:511: ddc_common_init.lo] Error 1 make[3]: Leaving directory '/var/tmp/portage/app-misc/ddcutil-2.2.0/work/ddcutil-2.2.0/src/ddc' Reproducible: Always
Reported upstream https://github.com/rockowitz/ddcutil/issues/504 It seems it fails differently depending on whether the headers are installed or not.
Upstream fix available: https://github.com/rockowitz/ddcutil/commit/a35d1dc432d4dd419e4874b37c62d23f3ae70469
My situation is slightly different. I have the X11 headers available, but the package is being built with USE="-X", and I get the following error: libtool: link: x86_64-pc-linux-gnu-gcc -shared -fPIC -DPIC -Wl,--whole-archive ./.libs/libcommon.a libmain/.libs/libsharedlib.a -Wl,--no-whole-archive -lz -ljansson -lglib-2.0 -ludev -ldrm -Werror=unused-result -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion -march=native -O3 -flto=auto -fuse-linker-plugin -Wl,-O1 -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -Wl,-soname -Wl,libddcutil.so.5 -Wl,-version-script -Wl,.libs/libddcutil.ver -o .libs/libddcutil.so.5.2.0 /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-misc/ddcutil-2.2.0/temp/cc0xgFv2.ltrans2.ltrans.o: in function `dw_free_xevent_data': <artificial>:(.text+0x11dd): undefined reference to `XCloseDisplay' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-misc/ddcutil-2.2.0/temp/cc0xgFv2.ltrans2.ltrans.o: in function `dw_send_x11_termination_message': <artificial>:(.text+0x2aa6): undefined reference to `XSendEvent' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x2af8): undefined reference to `XFlush' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-misc/ddcutil-2.2.0/temp/cc0xgFv2.ltrans2.ltrans.o: in function `dw_next_X11_event_of_interest': <artificial>:(.text+0x2cf1): undefined reference to `XIfEvent' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x2e5d): undefined reference to `XCheckTypedEvent' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-misc/ddcutil-2.2.0/temp/cc0xgFv2.ltrans2.ltrans.o: in function `dw_init_xevent_screen_change_notification': <artificial>:(.text+0x2f2f): undefined reference to `XOpenDisplay' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x2f64): undefined reference to `XRRQueryExtension' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x2f9d): undefined reference to `XCloseDisplay' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x304b): undefined reference to `XRRQueryVersion' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x3088): undefined reference to `XRRSelectInput' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x30aa): undefined reference to `XInternAtom' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x30c2): undefined reference to `XRRSelectInput' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-misc/ddcutil-2.2.0/temp/cc0xgFv2.ltrans2.ltrans.o: in function `dw_detect_xevent_screen_change': <artificial>:(.text+0x3283): undefined reference to `XCheckTypedEvent' /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0x32ac): undefined reference to `XCheckTypedEvent' collect2: error: ld returned 1 exit status Enabling USE="X" for the package allows it to build without issue.
Ok yup I see the same thing in the discussion on GitHub. Chucking that commit in /etc/portage/patches for now makes it work.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd0c7bedf719a3fc3eab0f2277ba35cd32946262 commit dd0c7bedf719a3fc3eab0f2277ba35cd32946262 Author: Kostadin Shishmanov <kostadinshishmanov@protonmail.com> AuthorDate: 2025-02-27 15:00:42 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-02-27 16:03:41 +0000 app-misc/ddcutil: add patch to fix build with USE=-X Upstream added a feature [1] that uses X11 API unconditionally which broke building with USE=-X. The patch [2] changes it, so support for this feature is enabled only if ddcutil is built with X support. [1] https://github.com/rockowitz/ddcutil/commit/6bf1062d [2] https://github.com/rockowitz/ddcutil/commit/a35d1dc Closes: https://bugs.gentoo.org/950320 Signed-off-by: Kostadin Shishmanov <kostadinshishmanov@protonmail.com> Signed-off-by: Sam James <sam@gentoo.org> app-misc/ddcutil/ddcutil-2.2.0.ebuild | 1 + .../files/ddcutil-2.2.0-fix-build-without-X.patch | 280 +++++++++++++++++++++ 2 files changed, 281 insertions(+)
This is not fixed, I see in build.log: Applying ddcutil-2.2.0-fix-build-without-X.patch .. ... configure: x11... disabled ... In file included from ../../src/dw/dw_common.h:17, from ddc_common_init.c:68: ../../src/dw/dw_xevent.h:10:10: fatal error: X11/Xlib.h: No such file or directory
Created attachment 920037 [details] build.log with ddcutil-2.2.0-fix-build-without-X.patch
(In reply to Morton Pellung from comment #6) > This is not fixed, I see in build.log: > > Applying ddcutil-2.2.0-fix-build-without-X.patch .. > ... > configure: x11... disabled > ... > In file included from ../../src/dw/dw_common.h:17, > from ddc_common_init.c:68: > ../../src/dw/dw_xevent.h:10:10: fatal error: X11/Xlib.h: No such file or > directory It doesn't sound intentional that X11/Xlib.h would still be required even when building it with X11 support disabled. This would be an upstream bug.
Upstream just committed some more fixes for this case
Märt and Morton, I will make a PR adding the new commits to the patch. I guess the first patch worked for me because I have X installed while you don't.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0d08b8ad9215bbde888a1d08f3d9ec052667884 commit d0d08b8ad9215bbde888a1d08f3d9ec052667884 Author: Kostadin Shishmanov <kostadinshishmanov@protonmail.com> AuthorDate: 2025-03-01 16:10:49 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-03-01 21:35:36 +0000 app-misc/ddcutil: fix patch for USE=-X Turns out upstream didn't completely solve the issue and ddcutil still failed to build on systems where X was not installed. Bug: https://bugs.gentoo.org/950320 Signed-off-by: Kostadin Shishmanov <kostadinshishmanov@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/40832 Signed-off-by: Sam James <sam@gentoo.org> .../files/ddcutil-2.2.0-fix-build-without-X.patch | 145 ++++++++++++++++++--- 1 file changed, 129 insertions(+), 16 deletions(-)
Location of error moved to: make[3]: Entering directory '/var/tmp/portage/app-misc/ddcutil-2.2.0/work/ddcutil-2.2.0/src/ddc' /bin/sh ../../libtool --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/libdrm -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../../src -I../../src/public -Wall -std=c11 -Werror=unused-result -Wformat-security -fno-common -Wimplicit-function-declaration -Wno-compound-token-split-by-macro -Wimplicit-fallthrough -D_GLIBCXX_ASSERTIONS -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion -fPIC -D_GNU_SOURCE -O2 -pipe -march=goldmont-plus -c -o ddc_services.lo ddc_services.c libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/libdrm -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../../src -I../../src/public -Wall -std=c11 -Werror=unused-result -Wformat-security -fno-common -Wimplicit-function-declaration -Wno-compound-token-split-by-macro -Wimplicit-fallthrough -D_GLIBCXX_ASSERTIONS -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion -fPIC -D_GNU_SOURCE -O2 -pipe -march=goldmont-plus -c ddc_services.c -fPIC -DPIC -o .libs/ddc_services.o In file included from ddc_services.c:66: ../../src/dw/dw_xevent.h:10:10: fatal error: X11/Xlib.h: No such file or directory 10 | #include <X11/Xlib.h> | ^~~~~~~~~~~~ compilation terminated. make[3]: *** [Makefile:511: ddc_services.lo] Error 1 make[3]: Leaving directory '/var/tmp/portage/app-misc/ddcutil-2.2.0/work/ddcutil-2.2.0/src/ddc'
Morton, could you also notify upstream at https://github.com/rockowitz/ddcutil/issues/504 ? I actually have x11 installed so it doesn't reproduce on my machine.