After compiling and installing graphics/xpdf4 on a host without desktop environment, the xpdf command produce the following output and does not accept any keyboard input. xkbcommon: ERROR: failed to add default include path /usr/local/share/X11/xkb Qt: Failed to create XKB context! Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, add ':' as separator to provide several search paths and/or make sure that XKB configuration data directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ . The error message was right as /usr/local/share/X11/xkb was empty. After installing x11/xkeyboard-config xpdf stoped emiting that message and correctly accepted keyboard input. xpdf is so far the only command affected. A dependency on x11/xkeyboard-config is obviously missing in x11-toolkits/qt5-gui. The dependency could alternatively be set on the x11/libxkbcommon port.
Hmm, I think it makes more sense to make libxkbcommon have a run-time dependency on xkeyboard-config. libxkbcommon's PACKAGING says: - (build optional, runtime) xkeyboard-config. During build, for automatically detecting the value of -Dxkb-config-root instead of guessing (/usr/share/X11/xkb). During runtime, not strictly needed, but most users of the library would need it. while its README.md says: libxkbcommon does not distribute a keymap dataset itself, other than for testing purposes. The most common dataset is xkeyboard-config, which is used by all current distributions for their X11 XKB data. Arch Linux, Fedora, openSUSE and Debian already have this dependency in their packages.
The suggestion to add a xkeyboard-config run dependency to libxkbcommon makes a lot of sense to me. I had to add an xkeyboard-config dependency to kodi-devel too in ports r490630 to workaround this issue here. Can we get some x11@ feedback here ASAP please? This is broken and easily fixable!
Created attachment 201281 [details] libxkbcommon.diff
A commit references this bug: Author: zeising Date: Tue Jan 22 21:03:10 UTC 2019 New revision: 490981 URL: https://svnweb.freebsd.org/changeset/ports/490981 Log: x11/libxkbcommon: Add dep on xkeyboard-config Add a run time dependency on x11/xkeyboard-config in x11/libxkbcommon. While not strictly necessary, this is recommended upstream, since almost all uses of libxkbcommon also needs xkeyboard-config. This is similar to how it is done in other distributions. This solves issues when graphics/xpdf4 is installed without a desktop or graphical environment, as well as other places. PR: 229127 Reported by: Bertrand Petit Suggested by: tobik Changes: head/x11/libxkbcommon/Makefile
Comitted as suggested, thank you!
(In reply to Niclas Zeising from comment #5) Thank you.