Skip to content

Commit

Permalink
Update bundled libxkbcommon version to 0.4.0
Browse files Browse the repository at this point in the history
This release comes with important bug fixes. Also we can now
remove the workaround code which was needed for libxkbcommon 0.2.0.

Task-number: QTBUG-31712
Task-number: QTBUG-33732
Task-number: QTBUG-34056

Change-Id: I57caf7f803b9a01a15541a5ad82e464de3b8abbb
Reviewed-by: Oswald Buddenhagen <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
  • Loading branch information
Gatis Paeglis authored and The Qt Project committed Mar 19, 2014
1 parent c6b555d commit b19b080
Show file tree
Hide file tree
Showing 55 changed files with 11,428 additions and 9,368 deletions.
85 changes: 41 additions & 44 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3172,7 +3172,7 @@ if [ "$XPLATFORM_MAC" = "no" -a "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo
fi

if [ "$CFG_XCB" != "no" ] && [ "$CFG_XKBCOMMON" = "no" ]; then
if ( [ "$CFG_XCB" = "system" ] || [ "$CFG_XCB" = "qt" ] ) && [ "$CFG_XKBCOMMON" = "no" ]; then
echo "Error: -no-xkbcommon is not supported on XCB platform plugin."
exit 101
fi
Expand Down Expand Up @@ -5213,26 +5213,30 @@ if [ "$CFG_XCB" != "no" ]; then
fi
QMakeVar set QMAKE_X11_PREFIX "$QMAKE_X11_PREFIX"

if compileTest qpa/xcb "xcb" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
if [ "$CFG_XKBCOMMON" != no ] && compileTest qpa/xcb "xcb" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
QT_CONFIG="$QT_CONFIG xcb-plugin"

if [ "$CFG_XCB" = "qt" ]; then
QT_CONFIG="$QT_CONFIG xcb-qt"
else
CFG_XCB="system"

if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
XCB_PACKAGES="xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape"
QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags $XCB_PACKAGES 2>/dev/null`"
QMAKE_LIBS_XCB="`$PKG_CONFIG --libs $XCB_PACKAGES 2>/dev/null`"
# for xcb-xkb tests
fi

# libxcb version 1.10 was the first version that enables xcb-xkb by default,
# therefore the minimal xcb-xkb version we support is 1.10
CFG_XKB=no
if $PKG_CONFIG --exists "xcb-xkb >= 1.10" 2>/dev/null; then
QMAKE_CFLAGS_XKB="`$PKG_CONFIG --cflags xcb xcb-xkb 2>/dev/null`"
QMAKE_LIBS_XKB="`$PKG_CONFIG --libs xcb xcb-xkb 2>/dev/null`"
if compileTest qpa/xcb-xkb "xcb-xkb" $QMAKE_CFLAGS_XKB $QMAKE_LIBS_XKB; then
CFG_XKB=yes
fi
fi

if compileTest qpa/xcb-xkb "xcb-xkb" $QMAKE_CFLAGS_XKB $QMAKE_LIBS_XKB; then
CFG_XKB=yes
else
CFG_XKB=no
if [ "$CFG_XKB" = "no" ]; then
QMakeVar add DEFINES QT_NO_XKB
fi

Expand Down Expand Up @@ -5328,52 +5332,45 @@ fi

# Detect libxkbcommon
ORIG_CFG_XKBCOMMON="$CFG_XKBCOMMON"
if [ "$CFG_XKBCOMMON" != "qt" ]; then
# currently only xcb platform plugin requires xkbcommon, for other platforms it can be set to 'no'
if [ "$CFG_XKBCOMMON" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= 0.2.0" 2>/dev/null; then
QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
QMAKE_VERSION_XKBCOMMON="`$PKG_CONFIG --modversion xkbcommon 2>/dev/null`"
# currently only xcb platform plugin supports building xkbcommon
if [ "$CFG_XCB" != "no" ]; then
if [ "$CFG_XKBCOMMON" = "auto" ] || [ "$CFG_XKBCOMMON" = "system" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon xkbcommon-x11 >= 0.4.0" 2>/dev/null; then
QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon xkbcommon-x11 2>/dev/null`"
QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon xkbcommon-x11 2>/dev/null`"

QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON"
QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON"
QMakeVar set QMAKE_VERSION_XKBCOMMON "$QMAKE_VERSION_XKBCOMMON"
CFG_XKBCOMMON=system
else
CFG_XKBCOMMON=no
fi

if [ "$CFG_XCB" != "no" ] && [ "$CFG_XKBCOMMON" = "no" ]; then
# use the bundled version instead
CFG_XKBCOMMON=qt
fi
fi
fi

if [ "$CFG_XKBCOMMON" = "qt" ]; then
QT_CONFIG="$QT_CONFIG xkbcommon-qt"
# detect XKB config root
if [ "$CFG_XKB_CONFIG_ROOT" = "auto" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkeyboard-config" 2> /dev/null; then
CFG_XKB_CONFIG_ROOT="`$PKG_CONFIG --variable=xkb_base xkeyboard-config`"
else
# search for xkb configs in most probable locations
if [ -d "/usr/share/X11/xkb" ]; then
# Linux
CFG_XKB_CONFIG_ROOT="/usr/share/X11/xkb"
elif [ -d "/usr/local/share/X11/xkb" ]; then
# BSD UNIX
CFG_XKB_CONFIG_ROOT="/usr/local/share/X11/xkb"
if [ "$CFG_XKBCOMMON" = "qt" ]; then
QT_CONFIG="$QT_CONFIG xkbcommon-qt"
# detect XKB config root
if [ "$CFG_XKB_CONFIG_ROOT" = "auto" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkeyboard-config" 2> /dev/null; then
CFG_XKB_CONFIG_ROOT="`$PKG_CONFIG --variable=xkb_base xkeyboard-config`"
else
# search for xkb configs in most probable locations
if [ -d "/usr/share/X11/xkb" ]; then
# Linux
CFG_XKB_CONFIG_ROOT="/usr/share/X11/xkb"
elif [ -d "/usr/local/share/X11/xkb" ]; then
# BSD UNIX
CFG_XKB_CONFIG_ROOT="/usr/local/share/X11/xkb"
fi
fi
fi
QMakeVar set QMAKE_XKB_CONFIG_ROOT "$CFG_XKB_CONFIG_ROOT"
if [ "$CFG_XKB_CONFIG_ROOT" = "auto" ]; then
CFG_XKB_CONFIG_ROOT="not found"
fi
fi
QMakeVar set QMAKE_XKB_CONFIG_ROOT "$CFG_XKB_CONFIG_ROOT"
if [ "$CFG_XKB_CONFIG_ROOT" = "auto" ]; then
CFG_XKB_CONFIG_ROOT="not found"
fi
elif [ "$CFG_XKBCOMMON" = "no" ]; then
QMakeVar add DEFINES QT_NO_XKBCOMMON
else
CFG_XKBCOMMON=no
fi

# EGL Support
Expand Down Expand Up @@ -6852,7 +6849,7 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
echo
fi
if [ "$ORIG_CFG_XKBCOMMON" != qt ] && [ "$CFG_XKBCOMMON" = qt ]; then
echo "NOTE: libxkbcommon 0.2.0 (or higher) not found on the system, will use "
echo "NOTE: libxkbcommon and libxkbcommon-x11 0.4.0 or higher not found on the system, will use "
echo "the bundled version from 3rd party directory."
fi
if [ "$CFG_XKBCOMMON" = "qt" ] && [ "$CFG_XKB_CONFIG_ROOT" = "not found" ]; then
Expand Down
34 changes: 27 additions & 7 deletions src/3rdparty/xkbcommon.pri
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
QMAKE_CFLAGS += -std=gnu99 -w
INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp
INCLUDEPATH += $$PWD/xkbcommon \
$$PWD/xkbcommon/xkbcommon \
$$PWD/xkbcommon/src \
$$PWD/xkbcommon/src/xkbcomp

DEFINES += DFLT_XKB_CONFIG_ROOT='\\"$$QMAKE_XKB_CONFIG_ROOT\\"'

### RMLVO names can be overwritten with environmental variables (See libxkbcommon documentation)
### RMLVO names can be overwritten with environmental variables (see libxkbcommon documentation)
DEFINES += DEFAULT_XKB_RULES='\\"evdev\\"'
DEFINES += DEFAULT_XKB_MODEL='\\"pc105\\"'
DEFINES += DEFAULT_XKB_LAYOUT='\\"us\\"'
# Need to rename several files, qmake has problems processing a project when
# sub-directories contain files with an equal names.

# Need to rename 2 files, qmake has problems processing a project when
# directories contain files with equal names.
# libxkbcommon generates some of these files while executing "./autogen.sh"
# and some while executing "make" (actually YACC)
SOURCES += \
$$PWD/xkbcommon/src/atom.c \
$$PWD/xkbcommon/src/xkb-compat.c \ # renamed: compat.c -> xkb-compat.c
Expand All @@ -18,7 +23,10 @@ SOURCES += \
$$PWD/xkbcommon/src/keysym.c \
$$PWD/xkbcommon/src/keysym-utf.c \
$$PWD/xkbcommon/src/state.c \
$$PWD/xkbcommon/src/text.c
$$PWD/xkbcommon/src/text.c \
$$PWD/xkbcommon/src/context-priv.c \
$$PWD/xkbcommon/src/keymap-priv.c \
$$PWD/xkbcommon/src/utils.c

SOURCES += \
$$PWD/xkbcommon/src/xkbcomp/action.c \
Expand All @@ -29,12 +37,24 @@ SOURCES += \
$$PWD/xkbcommon/src/xkbcomp/keycodes.c \
$$PWD/xkbcommon/src/xkbcomp/keymap-dump.c \
$$PWD/xkbcommon/src/xkbcomp/keymap.c \
$$PWD/xkbcommon/src/xkbcomp/parser.c \
$$PWD/xkbcommon/src/xkbcomp/keywords.c \
$$PWD/xkbcommon/src/xkbcomp/rules.c \
$$PWD/xkbcommon/src/xkbcomp/scanner.c \
$$PWD/xkbcommon/src/xkbcomp/symbols.c \
$$PWD/xkbcommon/src/xkbcomp/types.c \
$$PWD/xkbcommon/src/xkbcomp/vmod.c \
$$PWD/xkbcommon/src/xkbcomp/xkbcomp.c
$$PWD/xkbcommon/src/xkbcomp/xkbcomp.c \
$$PWD/xkbcommon/src/xkbcomp/parser.c

!contains(DEFINES, QT_NO_XKB):contains(QT_CONFIG, use-xkbcommon-x11support): {
# Build xkbcommon-x11 support library, it depends on -lxcb and -lxcb-xkb, linking is done
# in xcb-plugin.pro (linked to system libraries or if Qt was configured with -qt-xcb then
# linked to -lxcb-static).
INCLUDEPATH += $$PWD/xkbcommon/src/x11
SOURCES += \
$$PWD/xkbcommon/src/x11/util.c \
$$PWD/xkbcommon/src/x11/x11-keymap.c \ # renamed: keymap.c -> x11-keymap.c
$$PWD/xkbcommon/src/x11/x11-state.c # renamed: state.c -> x11-keymap.c
}

TR_EXCLUDE += $$PWD/*
86 changes: 86 additions & 0 deletions src/3rdparty/xkbcommon/NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
libxkbcommon 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.


libxkbcommon 0.3.2
==================

- Log messages from the library now look like "xkbcommon: ERROR" by
default, instead of xkbcomp-like "Error: ".

- Apply capitalization transformation on keysyms in
xkb_keysym_get_one_sym(), to match the behavior specified in the XKB
specification:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Lock_Modifier

- Support byacc for generating the parser, in addition to Bison.

- New API:
XKB_KEY_XF86AudioMicMute keysym from xproto 7.0.24.
XKB_KEYSYM_NO_FLAGS
XKB_CONTEXT_NO_FLAGS
XKB_MAP_COMPILE_NO_FLAGS

- Bug fixes.


libxkbcommon 0.3.1
==================

- Replace the flex scanner with a hand-written one. flex is no longer
a build requirement.

- New API:
xkb_keymap_min_keycode()
xkb_keymap_max_keycode()
xkb_keymap_key_for_each()


libxkbcommon 0.3.0
==================

- Allow passing NULL to *_unref() functions; do nothing instead of
crashing.

- The functions xkb_keymap_num_levels_for_key() and
xkb_keymap_get_syms_by_level() now allow out-of-range values for the
'layout' parameter. The functions now wrap the value around the number
of layouts instead of failing.

- The function xkb_keysym_get_name() now types unicode keysyms in
uppercase and 0-padding, to match the format used by XKeysymToString().

- Building Linux-specific tests is no longer attempted on non-Linux
environments.

- The function xkb_keymap_new_from_names() now accepts a NULL value for
the 'names' parameter, instead of failing. This is equivalent to passing
a 'struct xkb_rule_names' with all fields set to NULL.

- New API:
xkb_keymap_new_from_buffer()

- Bug fixes.
47 changes: 21 additions & 26 deletions src/3rdparty/xkbcommon/README
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,17 @@ API

While xkbcommon's API is somewhat derived from the classic XKB API as found
in <X11/extensions/XKB.h> and friends, it has been substantially reworked to
expose fewer internal details to clients. The only supported API is available
in <xkbcommon/xkbcommon.h>. Any definition not in this header (including
accessing internal structures through the old macros previously available)
should be regarded as an implementation detail and is liable to change at any
time.
expose fewer internal details to clients. The supported API is available
in the <xkbcommon/xkbcommon-*.h> files. Additional support is provided for
X11 (XCB) clients, in the xkbcommon-x11 library, <xkbcommon/xkbcommon-x11.h>.

During its early development, xkbcommon does not promise API or ABI stability.
Regardless, we will attempt to not break ABI during a minor release series,
so applications written against 0.1.0 should be completely compatible with
0.1.3, but not necessarily with 0.2.0. However, new symbols may be introduced
in any release. Thus, anyone packaging xkbcommon should make sure any package
depending on it depends on a release greater than or equal to the version it
was built against (or earlier, if it doesn't use any newly-introduced
symbols), but less than the next major release.

xkbcommon 1.x will offer full API and ABI stability for its lifetime, with a
soname of libxkbcommon.so.1. Any ABI breaks will wait until xkbcommon 2.0,
which will be libxkbcommon.so.2.

The xkbcomp command-line tool has also been removed, although this will
likely reappear in a later release.
The xkbcommon API and ABI are stable. We will attempt to not break ABI during
a minor release series, so applications written against 0.1.0 should be
completely compatible with 0.5.3, but not necessarily with 1.0.0. However, new
symbols may be introduced in any release. Thus, anyone packaging xkbcommon
should make sure any package depending on it depends on a release greater than
or equal to the version it was built against (or earlier, if it doesn't use
any newly-introduced symbols), but less than the next major release.


Relation to X11
Expand Down Expand Up @@ -101,19 +91,24 @@ Development
An extremely rudimentary homepage can be found at:
http://xkbcommon.org

xkbcommon is maintained in git at freedesktop.org:
git://anongit.freedesktop.org/git/libxkbcommon
xkbcommon is maintained in git at github.com:
https://github.com/xkbcommon/libxkbcommon

Patches are always welcome, and may be sent to either [email protected],
or [email protected]. Bugs are tracked in Bugzilla at:
http://bugs.freedesktop.org
or [email protected].

Bugs are tracked in Bugzilla at:
https://bugs.freedesktop.org/describecomponents.cgi?product=libxkbcommon
Or in github at:
https://github.com/xkbcommon/libxkbcommon/issues

The maintainer is Daniel Stone, who can be reached at:
The maintainers are Daniel Stone and Ran Benita, who can be reached at:
<[email protected]>
<[email protected]>


Credits
=======

Many thanks are due to Dan Nicholson for his heroic work in getting xkbcommon
off the ground initially, as well as to Ran Benita for subsequent development.
off the ground initially.
Loading

0 comments on commit b19b080

Please sign in to comment.