mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2025-12-20 02:20:17 +01:00
The Linux kernel adds a few evdev keycodes roughly every other release. These aren't available as keysyms through XKB until they have been added as keycode in xkeyboard-config and mapped there to a newly defined keysym in the X11 proto headers. In the past, this was done manually, a suitable keysym was picked at random and the mapping updated accordingly. This doesn't scale very well and, given we have a large reserved range for XF86 keysyms anyway, can be done easier. Let's reserve the range 0x10081XXX range for a 1:1 mapping of Linux kernel codes. That's 4095 values, the kernel currently uses only 767 anyway. The lower 3 bytes of keysyms within that range have to match the kernel value to make them easy to add and search for. Nothing in X must care about the actual keysym value anyway. Since we expect this to be parsed by other scripts for automatic updating, the format of those #defines is quite strict. Add a script to generate keycodes as well as verify that the existing ones match the current expected format. The script is integrated into the CI and meson test, so we will fail if an update breaks the expectations. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
|
|
|
|
include:
|
|
# Arch container builder template
|
|
- project: 'freedesktop/ci-templates'
|
|
ref: 6f86b8bcb0cd5168c32779c4fea9a893c4a0c046
|
|
file:
|
|
- '/templates/arch.yml'
|
|
|
|
# global variables to be used by most/all jobs.
|
|
variables:
|
|
FDO_UPSTREAM_REPO: 'xorg/proto/xorgproto'
|
|
# Changing the tag will rebuild the container images. The value is just a
|
|
# string, but we use the date for human benefits.
|
|
FDO_DISTRIBUTION_TAG: '2021-01-21.1'
|
|
|
|
stages:
|
|
- prep
|
|
- check
|
|
- build
|
|
- test
|
|
|
|
container-prep:
|
|
extends:
|
|
- .fdo.container-build@arch
|
|
stage: prep
|
|
variables:
|
|
GIT_STRATEGY: none
|
|
# minimal set of packages required to build and install
|
|
BASE_PACKAGES: 'meson ninja gcc'
|
|
# extra packages we need for various tests
|
|
EXTRA_PACKAGES: 'git libevdev python python-libevdev python-black'
|
|
FDO_DISTRIBUTION_PACKAGES: $BASE_PACKAGES $EXTRA_PACKAGES
|
|
|
|
meson:
|
|
extends:
|
|
- .fdo.distribution-image@arch
|
|
stage: build
|
|
parallel:
|
|
matrix:
|
|
- MESON_OPTIONS: ['', '-Dlegacy=true']
|
|
script:
|
|
- mkdir -p ../_inst
|
|
- meson builddir --prefix="$PWD/../_inst" $MESON_OPTIONS
|
|
- meson configure builddir
|
|
- ninja -C builddir test
|
|
- ninja -C builddir install
|
|
|
|
check evdev keysyms:
|
|
extends:
|
|
- .fdo.distribution-image@arch
|
|
stage: test
|
|
script:
|
|
- ./scripts/keysym-generator.py --header=include/X11/XF86keysym.h verify
|
|
|
|
check formatting:
|
|
extends:
|
|
- .fdo.distribution-image@arch
|
|
stage: check
|
|
script:
|
|
- black scripts/keysym-generator.py
|
|
- git diff --exit-code || (echo "Please run Black against the Python script" && false)
|
|
only:
|
|
changes:
|
|
- scripts/keysym-generator.py
|