# # spec file for package libxkbcommon # # Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %if ! 0%{?suse_version} || 0%{?suse_version} >= 1315 %bcond_without x11 %else %bcond_with x11 %endif Name: libxkbcommon Version: 1.8.1 Release: 1.1 Summary: Library for handling xkb descriptions License: MIT Group: Development/Libraries/C and C++ URL: https://xkbcommon.org/ #Git-Clone: https://github.com/xkbcommon/libxkbcommon Source: https://github.com/xkbcommon/libxkbcommon/archive/refs/tags/xkbcommon-%version.tar.gz Source2: baselibs.conf BuildRequires: bison BuildRequires: flex BuildRequires: meson >= 0.51 BuildRequires: pkg-config BuildRequires: xz BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(wayland-client) >= 1.2.0 BuildRequires: pkgconfig(wayland-protocols) >= 1.7 BuildRequires: pkgconfig(wayland-scanner) BuildRequires: pkgconfig(xkeyboard-config) BuildRequires: pkgconfig(xorg-macros) >= 1.8 BuildRequires: pkgconfig(xproto) %if %{with x11} BuildRequires: pkgconfig(xcb-xkb) >= 1.10 %endif %description xkbcommon is a keymap handling library, which can parse XKB descriptions (e.g. from xkeyboard-config), and use this to help its users make sense of their keyboard input. Unfortunately, X11's requirements mean this is not actually usable for the X server, but it should be perfectly usable for client toolkits, as well as alternative windowing systems, compositors and system-level clients such as Wayland and kmscon. %package -n libxkbcommon0 Summary: Library for handling xkb descriptions Group: System/Libraries Requires: xkeyboard-config %description -n libxkbcommon0 xkbcommon is a keymap handling library, which can parse XKB descriptions (e.g. from xkeyboard-config), and use this to help its users make sense of their keyboard input. Unfortunately, X11's requirements mean this is not actually usable for the X server, but it should be perfectly usable for client toolkits, as well as alternative windowing systems, compositors and system-level clients such as Wayland and kmscon. %package -n libxkbcommon-x11-0 Summary: Library for handling xkb descriptions using XKB-X11 Group: System/Libraries %description -n libxkbcommon-x11-0 An addon library that supports creating keymaps with the XKB X11 protocol by querying the X server directly. %package devel Summary: Development files for the libxkbcommon library Group: Development/Libraries/C and C++ Requires: libxkbcommon0 = %version-%release %description devel xkbcommon is a keymap handling library, which can parse XKB descriptions (e.g. from xkeyboard-config), and use this to help its users make sense of their keyboard input. Unfortunately, X11's requirements mean this is not actually usable for the X server, but it should be perfectly usable for client toolkits, as well as alternative windowing systems, compositors and system-level clients such as Wayland and kmscon. This package contains the development headers for the library found in libxkbcommon. %package tools Summary: Utilities from xkbcommon Group: System/X11/Utilities %description tools xkbcommon tools for introspection and debugging. %package tools-bash-completion Summary: Bash completion for %name-tools Requires: %name-tools = %version Requires: bash-completion Supplements: (%name-tools and bash-completion) BuildArch: noarch %description tools-bash-completion Bash completion for %name-tools. %package x11-devel Summary: Development files for the libxkbcommon-x11 library Group: Development/Libraries/C and C++ Requires: libxkbcommon-x11-0 = %version-%release %description x11-devel xkbcommon is a keymap handling library, which can parse XKB descriptions (e.g. from xkeyboard-config), and use this to help its users make sense of their keyboard input. This package contains the development headers for the library found in %name-x11-0. %package -n libxkbregistry0 Summary: Library for handling xkb descriptions Group: System/Libraries %description -n libxkbregistry0 libxkbregistry is a C library that lists available XKB models, layouts and variants for a given ruleset. %package -n libxkbregistry-devel Summary: Header files for xkbregistry Group: Development/Libraries/C and C++ Requires: libxkbregistry0 = %version-%release %description -n libxkbregistry-devel libxkbregistry is a C library that lists available XKB models, layouts and variants for a given ruleset. This is aimed at tools that provide a listing of available keyboard layouts to the user. %prep %autosetup -p1 -n libxkbcommon-xkbcommon-%version %build %if %{with x11} ef=-Denable-x11=true %else ef=-Denable-x11=false %endif # includedir intentional, cf. bugzilla.opensuse.org/795968 %meson -Denable-docs=false --includedir="%_includedir/%name" $ef %meson_build %install %meson_install chmod -x %buildroot/%_datadir/bash-completion/completions/xkbcli* %ldconfig_scriptlets -n libxkbcommon0 %ldconfig_scriptlets -n libxkbcommon-x11-0 %ldconfig_scriptlets -n libxkbregistry0 %files -n libxkbcommon0 %license LICENSE %_libdir/libxkbcommon.so.* %files devel %doc NEWS.md %_includedir/%name/ %if %{with x11} %exclude %_includedir/%name/xkbcommon/xkbcommon-x11.h %endif %_libdir/libxkbcommon.so %_libdir/pkgconfig/xkbcommon.pc %files tools %_bindir/xkbcli %_libexecdir/xkbcommon/ %_mandir/man1/xkbcli* %files tools-bash-completion %license LICENSE %_datadir/bash-completion/completions/xkbcli* %if %{with x11} %files -n libxkbcommon-x11-0 %license LICENSE %_libdir/libxkbcommon-x11.so.* %files x11-devel %license LICENSE %dir %_includedir/%name %dir %_includedir/%name/xkbcommon %_includedir/%name/xkbcommon/xkbcommon-x11.h %_libdir/libxkbcommon-x11.so %_libdir/pkgconfig/xkbcommon-x11.pc %endif %files -n libxkbregistry0 %_libdir/libxkbregistry.so.0* %files -n libxkbregistry-devel %_libdir/libxkbregistry.so %_libdir/pkgconfig/xkbregistry.pc %changelog * Wed Mar 12 2025 Jan Engelhardt - Update to release 1.8.1 * Fixed segfault due to invalid arithmetic to bring negative layout indexes into range. * The tools do not load the default RMLVO (rules, model, layout, variant, options) values from the environment anymore. * Tue Feb 4 2025 Jan Engelhardt - Update to release 1.8 * `NoSymbol` is now systematically dropped in multi-keysyms levels. * Added the upper case mapping ß → ẞ (`ssharp` → `U1E9E`). This enable to type ẞ using CapsLock thanks to the internal capitalization rules. * Updated keysyms case mappings to cover full Unicode 16.0. * Implemented the `GroupLatch` action, usually activated with the keysym `ISO_Group_Latch`. * Symbols: Added support for multiple actions per levels. * Sat Mar 23 2024 Jan Engelhardt - Update to release 1.7 * Added early detection of invalid encodings and BOM for keymaps, rules & Compose. Also added a hint that the expected encoding must be UTF-8 compatible. * Updated keysyms using latest xorgproto (cd33097fc779f280925c6d6bbfbd5150f93ca5bc): For the sake of compatibility, this reintroduces some deleted keysyms and postpones the effective deprecation of others that had landed in xkbcommon 1.6.0. * Reverted removal of some XKB_KEYs and fixed inconsistencies in names. Details see upstream changelog. * ``xkbcli compile-compose``: added new CLI utility to test Compose files. * ``xkbcli interactive-evdev``: added a ``--verbose`` option. * ``xkbcli interactive-x11``: added support for Compose. * ``xkbcli interactive-wayland``: added support for Compose. * Fri Jan 12 2024 Pierre Le Marre - Add libxkbcommon-tools-bash-completions. * Tue Jan 9 2024 Marcus Meissner - add libxkbregistry-devel to baselibs for use by wine-32bit. (bsc#1218640) * Sun Dec 17 2023 Tobias Klausmann - dxvk need libxkbregistry0 for building -32bit variants, provide them. * Mon Oct 9 2023 Jan Engelhardt - Update to release 1.6.0 * Remove keysyms: XKB_KEY_dead_lowline, XKB_KEY_dead_aboveverticalline, XKB_KEY_dead_belowverticalline, XKB_KEY_dead_longsolidusoverlay * Add Compose iterator API to iterate the entries in a compose table. * Structured log messages with a message registry. There is an ongoing work to assign unique identifiers to log messages and add a corresponding error index documentation page. * Add a new warning for numeric keysyms references in XKB files: the preferred keysym reference form is its name or its Unicode value, if relevant. * Add the upper bound `XKB_KEYSYM_MAX` to check valid keysyms. * Add a warning when loading a keymap using RMLVO with no layout but with the variant set. * Add support for ``modifier_map None { … }``. This feature is missing compared to the X11 implementation. It allows to reset the modifier map of a key. * Mon Jan 2 2023 Jan Engelhardt - Update to release 1.5.0 * Fix crash in `xkbcli interactive-wayland` under a compositor which supports new versions of the xdg-shell protocol. * New API: XKB_CONTEXT_NO_SECURE_GETENV, RXKB_CONTEXT_NO_SECURE_GETENV * Sun May 22 2022 Jan Engelhardt - Update to release 1.4.1 * Fix compose sequence overriding (common prefix) not working correctly. Regressed in 1.2.0. * Remove various bogus currency sign (particulary Euro and Korean Won) entries from the keysym <-> Unicode mappings. They prevented the real keysyms/codepoints for these from mapping correctly. * Fri Feb 4 2022 Jan Engelhardt - Update to release 1.4.0 * In libxkbregistry, variants now inherit iso639, iso3166 and brief from parent layout if omitted. * In libxkbregistry, skip over invalid ISO-639 or ISO-3166 entries. * Fri Sep 10 2021 Jan Engelhardt - Update to release 1.3.1 * In `xkbcli interactive-x11`, use the Esc keysym instead of the Esc keycode for quitting. * In `xkbcli how-to-type`, add `--keysym` argugment for how to type a keysym instead of a Unicode codepoint. * Fix a crash in `xkb_x11_keymap_new_from_device` error handling given some invalid keymaps. Had regressed in 1.2.0. * Sat May 1 2021 Jan Engelhardt - Update to release 1.3.0 * `xkbcli list` was changed to output YAML instead of a custom format. * Fix segmentation fault in case-insensitive `xkb_keysym_from_name` for certain values like the empty string. * Wed Apr 14 2021 Jan Engelhardt - Update to release 1.2.1 [boo#1184688] * Fix `xkb_x11_keymap_new_from_device()` failing when the keymap contains key types with missing level names, like the one used by the `numpad:mac` option in xkeyboard-config. (Regressed in 1.2.0.) * Sat Apr 3 2021 Jan Engelhardt - Update to release 1.2.0 * `xkb_x11_keymap_new_from_device()` is much faster. It now performs only 2 roundtrips to the X server, instead of dozens (in first-time calls). * Case-sensitive `xkb_keysym_from_name()` is much faster. * Keysym names of the form `0x12AB` and `U12AB` are parsed more strictly. * Compose files now have a size limit (65535 internal nodes). * Compose table loading (`xkb_compose_table_new_from_locale()` and similar) is much faster. * Thu Mar 4 2021 Jan Engelhardt - Update to release 1.1.0 * Update keysym definitions to latest xorgproto. In particular, this adds many special keysyms corresponding to Linux evdev keycodes. * New XKB_KEY_* definitions. * Wed Jan 20 2021 Dominique Leuenberger - Fix dependency of libxkbregistry-devel: the devel package must require the library libxkbregistry0. * Mon Nov 23 2020 Jan Engelhardt - Update to release 1.0.3 * Fix (hopefully) a segfault in xkb_x11_keymap_new_from_device() in some unclear situation (bug introduced in 1.0.2). * Fix keymaps created with xkb_x11_keymap_new_from_device() do not have level names (bug introduced in 0.8.0). * Fri Nov 20 2020 Jan Engelhardt - Update to release 1.0.2 * Fix a bug where a keysym that cannot be resolved in a keymap gets compiled to a garbage keysym. Now it is set to XKB_KEY_NoSymbol instead. * Improve the speed of xkb_x11_keymap_new_from_device() on repeated calls in the same xkb_context(). * Sat Sep 12 2020 Jan Engelhardt - Update to release 1.0.1 * Make the table output of `xkbcli how-to-type` aligned. * Sun Sep 6 2020 Jan Engelhardt - Update to release 1.0.0 * Now it is possible to add custom layouts and options at the system (/etc) and user (~/.config) level, at least when libxkbcommon is in use. * libxkbregistry is a C library that lists available XKB models, layouts and variants for a given ruleset. This is a separate library (.so/.pc files) and aimed at tools that provide a listing of available keyboard layouts to the user. * Add an `xkbcli` command-line utility. * Sun Jan 19 2020 Jan Engelhardt - Update to release 0.10.0 * Fix quadratic complexity in the XKB file parser. * Add $XDG_CONFIG_HOME/xkb to the default search path. If $XDG_CONFIG_HOME is not set, $HOME/.config/xkb is used. If $HOME is not set, the path is not added. The XDG path is looked up before the existing default search path $HOME/.xkb. * Add support for include statements in XKB rules files. * Fix bug where the merge mode only applied to the first vmod in a "virtual_modifiers" statement. * Reject interpret modifier predicate with more than one value. * Correctly handle capitalization of the ssharp keysym. * Mon Oct 21 2019 Jan Engelhardt - Update to release 0.9.1 * Fix context creation failing when run in privileged processes as defined by `secure_getenv(3)`, e.g. GDM. * Sun Oct 20 2019 Jan Engelhardt - Update to release 0.9.0 * Move ~/.xkb to before XKB_CONFIG_ROOT. This enables the user to have full control of the keymap definitions, instead of only augmenting them. * Fri Feb 22 2019 Jan Engelhardt - Update to new upstream release 0.8.4 * Only changes to the build procedure. * Fri Feb 8 2019 Jan Engelhardt - Update to new upstream release 0.8.3 * New APIs: XKB_KEY_XF86MonBrightnessCycle, XKB_KEY_XF86RotationLockToggle. * Tue Aug 7 2018 jengelh@inai.de - Update to new upstream release 0.8.2 (boo#1105832) * Fix a few NULL-dereferences, out-of-bounds access and undefined behavior in the XKB text format parser. * CVEs fixed: CVE-2018-15853, CVE-2018-15854, CVE-2018-15855, CVE-2018-15856, CVE-2018-15857, CVE-2018-15858, CVE-2018-15859, CVE-2018-15861, CVE-2018-15862, CVE-2018-15863, CVE-2018-15864 - run make check * Fri Dec 15 2017 jengelh@inai.de - Update to new upstream release 0.8.0 * Added xkb_keysym_to_{upper,lower} to perform case-conversion directly on keysyms. This is useful in some odd cases, but working with the Unicode representations should be preferred when possible. * Added Unicode conversion rules for the signifblank and permille keysyms. * Fixed a bug in the parsing of XKB key type definitions where the number of levels were determined by the number of level * names*. Keymaps which omit level names were hence miscompiled. This regressed in version 0.4.3. Keymaps from xkeyboard-config were not affected since they don't omit level names. * Thu Oct 19 2017 jayvdb@gmail.com - Allow building x11 subpackage on any distribution * Mon Aug 7 2017 jengelh@inai.de - Update to new upstream release 0.7.2 * Added new keysym definitions from xproto. * New APIs: XKB_KEY_XF86Keyboard, XKB_KEY_XF86WWAN, XKB_KEY_XF86RFKill, XKB_KEY_XF86AudioPreset. * Wed Jan 18 2017 jengelh@inai.de - Update to new upstream release 0.7.1 * Fixed various reported problems when the current locale is tr_TR.UTF-8. * Fri Nov 11 2016 jengelh@inai.de - Update to new upstream release 0.7.0 * Added support for different "modes" of calculating consumed modifiers. The existing mode, based on the XKB standard, has proven to be unintuitive in various shortcut implementations. * A new mode, based on the calculation used by the GTK toolkit, is added. This mode is less eager to declare a modifier as consumed. * Fri Apr 8 2016 zaitor@opensuse.org - Update to version 0.6.1: * Add LICENSE to distributed files in tarball releases. * Minor typo fix in xkb_keymap_get_as_string() documentation. - Changes from version 0.6.0: * If the XKB_CONFIG_ROOT environment variable is set, it is used as the XKB configuration root instead of the path determined at build time. * Tests and benchmarks now build correctly on OSX. * An XKB keymap provides a name for each key it defines. Traditionally these names are limited to at most 4 characters, and are thus somewhat obscure, but might still be useful (xkbcommon lifts the 4 character limit). * The new functions xkb_keymap_key_get_name() and xkb_keymap_key_by_name() can be used to get the name of a key or find a key by name. Note that a key may have aliases. * Documentation improvements. * New API: + xkb_keymap_key_by_name(). + xkb_keymap_key_get_name(). * Mon Nov 2 2015 mlin@suse.com - Requires xkeyboard-config, bsc#952403 * libxkbcommon should brings xkeyboard-config together always as libxkbcommon does not distribute xkb data itself, and especially requires xkeyboard-config for any rely on libxkbcommon in the minimal system. * Mon Nov 3 2014 hrvoje.senjan@gmail.com - Update to version 0.5.0: * Added support for Compose/dead keys in a new module (included in libxkbcommon). See the documentation or the xkbcommon/xkbcommon-compose.h header file for more details. * Improved and reordered some sections of the documentation. * The doxygen HTML pages were made nicer to read. * Most tests now run also on non-linux platforms. * A warning is emitted by default about RMLVO values which are not used during keymap compilation, which are most often a user misconfiguration. For example, "terminate:ctrl_alt_backspace" instead of "terminate:ctrl_alt_bksp". * Added symbol versioning for libxkbcommon and libxkbcommon-x11. Note: binaries compiled against this and future versions will not be able to link against the previous versions of the library. * Removed several compatablity symbols from the binary (the API isn't affected). This affects binaries which: 1. Were compiled against a pre-stable (<0.2.0) version of libxkbcommon, and 2. Are linked against the this or later version of libxkbcommon. Such a scenario is likely to fail already. * If Xvfb is not available, the x11comp test is now correctly skipped instead of hanging. * Benchmarks were moved to a separate bench/ directory. * Build fixes from OpenBSD. * Fixed a bug where key type entries such as "map[None] = Level2;" were ignored. * New API: XKB_COMPOSE_* xkb_compose_* * Thu Sep 11 2014 jengelh@inai.de - Add commentary about upcoming symbol version support to .spec file. * Tue Sep 9 2014 jengelh@inai.de - Switch to library versioning as described in Shared Library Packaging guidelines. This permits installation of multiple libxkbcommons. * Thu Aug 21 2014 dimstar@opensuse.org - Update to version 0.4.3: + Fixed a bug which caused xkb_x11_keymap_new_from_device() to misrepresent modifiers for some keymaps. https://github.com/xkbcommon/libxkbcommon/issues/9 + Fixed a bug which caused xkb_x11_keymap_new_from_device() to ignore XKB PrivateAction's. + Modifiers are now always fully resolved after xkb_state_update_mask(). Previously the given state components were used as-is, without considering virtual modifier mappings. Note: this only affects non-standard uses of xkb_state_update_mask(). + Added a test for xkbcommon-x11, "x11comp". The test uses the system's Xvfb server and xkbcomp. If they do not exist or fail, the test is skipped. + Fixed memory leaks after parse errors in the XKB yacc parser. + The fix required changes which are currently incompatible with byacc. * Thu Jul 24 2014 jengelh@inai.de - Add symbol versioning to xkbcommon * Wed May 21 2014 hrvoje.senjan@gmail.com - Update to new upstream release 0.4.2 * Fixed a bug where explicitly passing "--enable-x11" to ./configure would in fact disable it (regressed in 0.4.1). * Added @since version annotations to the API documentation for everything introduced after the initial stable release (0.2.0). * Added a section to the documentation about keysym transformations, and clarified which functions perform a given transformation. * XKB files which fail to compile during keymap construction can no longer have any effect on the resulting keymap: changes are only applied when the entire compilation succeeds. Note: this was a minor correctness issue inherited from xkbcomp. * Fix an out-of-bounds array access in src/x11/util.c:adopt_atoms() error-handling code. Note: it seems impossible to trigger in the current code since the input size cannot exceed the required size. - Add back -enable-x11 flag for 1315+ * Wed Apr 9 2014 mlin@suse.com - Add COPYING and NEWS to files list * Tue Apr 8 2014 mlin@suse.com - Replace %%suse_version >= 1320 to 1315 in order to build -x11 package for SLE12 * Fri Apr 4 2014 hrvoje.senjan@gmail.com - Update to new upstream release 0.4.1 * Added two new functions, xkb_state_key_get_utf{8,32}(). They combine the operations of xkb_state_key_get_syms() and xkb_keysym_to_utf{8,32}(), and provide a nicer interface for it (espcially for multiple-keysyms-per-level). * The xkb_state_key_get_utf{8,32}() functions now apply Control transformation: when the Control modifier is active, the string is converted to an appropriate control character. This matches the behavior of libX11's XLookupString(3), and required by the XKB specification: http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Control_Modifier fdo#75892 * The consumed modifiers for a key are now calculated similarly to libX11. The previous behavior caused a bug where Shift would not cancel an active Caps Lock. * Make xkbcommon-x11 work with the keymap reported by the XQuartz X server. fdo#75798 * Reduce memory usage during keymap compilation some more. * New API: xkb_state_key_get_consumed_mods() xkb_state_key_get_utf8() xkb_state_key_get_utf32() * Deprecated API: XKB_MAP_COMPILE_PLACEHOLDER, XKB_MAP_NO_FLAGS use XKB_KEYMAP_NO_FLAGS instead. - Temporary ommit passing --enable-x11 flag, this release has a bug that actually disables x11 if explicitly enabled (fixed upstream, but used this approach instead of cherry-picking the patch, for the sake of avoiding three new BuildRequires & autoreconf) * Sat Mar 8 2014 hrvoje.senjan@gmail.com - Update to new upstream release 0.4.0 * Add a new add-on library, xkbcommon-x11, to support creating keymaps with the XKB X11 protocol, by querying the X server directly. See the xkbcommon/xkbcommon-x11.h header file for more details. This library requires libxcb-xkb >= 1.10, and is enabled by default. It can be disabled with the --disable-x11 configure switch. Distributions are encouraged to split the necessary files for this library (libxkbcommon-x11.so, xkbcommon-x11.pc, xkbcommon/xkbcommon-x11.h) to a separate package, such that the main package does not depend on X11 libraries. * Fix the keysym <-> name lookup table to not require huge amounts of relocations. * Fix a bug in the keysym <-> name lookup, whereby lookup might fail in some rare cases. * Reduce memory usage during keymap compilation. * New API: New keysyms from xproto 7.0.25 (German T3 layout keysyms). XKB_MOD_NAME_NUM for the usual NumLock modifier. xkb_x11_* types and functions, XKB_X11_* constants. - Add and build new libxkbcommon-x11-0 and libxkbcommon-x11-devel packages for openSUSE 13.2 and newer * Wed Apr 17 2013 jengelh@inai.de - Update to new upstream release 0.3.0 * This introduces the xkb_keymap_new_from_buffer API, relaxes restrictions on the xkb_keymap_new_from_names API, introduces support for setting default keymaps from the environment, and includes several new bugfixes, as well as swathes of testing improvements. * Tue Oct 23 2012 jengelh@inai.de - Update to first tarball release 0.2.0 * Tue Sep 25 2012 sndirsch@suse.com - specfile cleanup * Thu Nov 11 2010 jengelh@medozas.de - Initial package