Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyboard #4

Merged
merged 5 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:

- name: Install dependencies
run: |
sudo apt install -y ninja-build
sudo apt install -y ninja-build \
meson

- name: Install emsdk
run: |
Expand All @@ -36,10 +37,14 @@ jobs:
run: |
. emsdk/emsdk_env.sh
python scripts/fmt.py
python scripts/iso-codes.py
python scripts/json.py
python scripts/json-c.py
python scripts/marisa.py
python scripts/libexpat.py
python scripts/libthai.py
python scripts/libxkbcommon.py
python scripts/xkeyboard-config.py
python scripts/marisa.py

- name: Release
if: ${{ github.ref == 'refs/heads/master' }}
Expand Down
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@
[submodule "libthai"]
path = libthai
url = https://github.com/tlwg/libthai
[submodule "libxkbcommon"]
path = libxkbcommon
url = https://github.com/xkbcommon/libxkbcommon
[submodule "iso-codes"]
path = iso-codes
url = https://salsa.debian.org/iso-codes-team/iso-codes
[submodule "libexpat"]
path = libexpat
url = https://github.com/libexpat/libexpat
[submodule "xkeyboard-config"]
path = xkeyboard-config
url = https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config
1 change: 1 addition & 0 deletions iso-codes
Submodule iso-codes added at c2fcaa
1 change: 1 addition & 0 deletions libexpat
Submodule libexpat added at dfa90b
1 change: 1 addition & 0 deletions libxkbcommon
Submodule libxkbcommon added at 7a31e3
323 changes: 323 additions & 0 deletions patches/libxkbcommon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
diff --git a/meson.build b/meson.build
index 2de4ee9..1a42dcc 100644
--- a/meson.build
+++ b/meson.build
@@ -94,12 +94,6 @@ endif
if cc.links('int main(){if(__builtin_expect(1<0,0)){}}', name: '__builtin_expect')
configh_data.set('HAVE___BUILTIN_EXPECT', 1)
endif
-if cc.has_header_symbol('unistd.h', 'eaccess', prefix: system_ext_define)
- configh_data.set('HAVE_EACCESS', 1)
-endif
-if cc.has_header_symbol('unistd.h', 'euidaccess', prefix: system_ext_define)
- configh_data.set('HAVE_EUIDACCESS', 1)
-endif
if cc.has_header_symbol('sys/mman.h', 'mmap')
configh_data.set('HAVE_MMAP', 1)
endif
@@ -600,281 +594,6 @@ configure_file(input: 'test/xkeyboard-config-test.py.in',
output: 'xkeyboard-config-test',
configuration: xkct_config)

-# Tests
-test_env = environment()
-test_env.set('XKB_LOG_LEVEL', 'debug')
-test_env.set('XKB_LOG_VERBOSITY', '10')
-test_env.set('top_srcdir', meson.current_source_dir())
-test_env.set('top_builddir', meson.current_build_dir())
-test_env.set('HAVE_XKBCLI_INTERACTIVE_EVDEV', configh_data.get('HAVE_XKBCLI_INTERACTIVE_EVDEV', 0).to_string())
-test_env.set('HAVE_XKBCLI_INTERACTIVE_WAYLAND', configh_data.get('HAVE_XKBCLI_INTERACTIVE_WAYLAND', 0).to_string())
-test_env.set('HAVE_XKBCLI_INTERACTIVE_X11', configh_data.get('HAVE_XKBCLI_INTERACTIVE_X11', 0).to_string())
-test_env.set('HAVE_XKBCLI_LIST', configh_data.get('HAVE_XKBCLI_LIST', 0).to_string())
-
-test_configh_data = configuration_data()
-test_configh_data.set_quoted('TEST_XKB_CONFIG_ROOT', meson.current_source_dir()/'test'/'data')
-configure_file(output: 'test-config.h', configuration: test_configh_data)
-
-# Some tests need to use unexported symbols, so we link them against
-# an internal copy of libxkbcommon with all symbols exposed.
-libxkbcommon_test_internal = static_library(
- 'xkbcommon-test-internal',
- 'test/common.c',
- 'test/test.h',
- 'test/evdev-scancodes.h',
- 'bench/bench.c',
- 'bench/bench.h',
- libxkbcommon_sources,
- include_directories: include_directories('src', 'include'),
- c_args: ['-DENABLE_PRIVATE_APIS'],
-)
-test_dep = declare_dependency(
- include_directories: include_directories('src', 'include'),
- link_with: libxkbcommon_test_internal,
- dependencies: [tools_dep],
-)
-if get_option('enable-x11')
- libxkbcommon_x11_test_internal = static_library(
- 'xkbcommon-x11-internal',
- libxkbcommon_x11_sources,
- 'test/xvfb-wrapper.c',
- 'test/xvfb-wrapper.h',
- include_directories: include_directories('src', 'include'),
- link_with: libxkbcommon_test_internal,
- dependencies: [
- xcb_dep,
- xcb_xkb_dep,
- ],
- )
- x11_test_dep = declare_dependency(
- link_with: libxkbcommon_x11_test_internal,
- dependencies: [
- test_dep,
- xcb_dep,
- xcb_xkb_dep,
- ],
- )
-endif
-# TODO: version range?
-keysyms_test_dep = [test_dep]
-keysyms_test_c_args = ['-DENABLE_PRIVATE_APIS']
-icu_dep = dependency('icu-uc', required: false)
-if icu_dep.found()
- keysyms_test_dep += [icu_dep]
- configh_data.set10('HAVE_ICU', true)
-endif
-test(
- 'keysym',
- executable('test-keysym', 'test/keysym.c', 'test/keysym.h',
- dependencies: keysyms_test_dep,
- c_args: keysyms_test_c_args),
- env: test_env,
-)
-test(
- 'keymap',
- executable('test-keymap', 'test/keymap.c', 'test/keysym.h',
- dependencies: test_dep),
- env: test_env,
-)
-test(
- 'filecomp',
- executable('test-filecomp', 'test/filecomp.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'context',
- executable('test-context', 'test/context.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'rules-file',
- executable('test-rules-file', 'test/rules-file.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'rules-file-includes',
- executable('test-rules-file-includes', 'test/rules-file-includes.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'stringcomp',
- executable('test-stringcomp', 'test/stringcomp.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'buffercomp',
- executable('test-buffercomp', 'test/buffercomp.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'log',
- executable('test-log', 'test/log.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'atom',
- executable('test-atom', 'test/atom.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'utf8',
- executable('test-utf8', 'test/utf8.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'state',
- executable('test-state', 'test/state.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'keyseq',
- executable('test-keyseq', 'test/keyseq.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'rulescomp',
- executable('test-rulescomp', 'test/rulescomp.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'compose',
- executable('test-compose', 'test/compose.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'utils',
- executable('test-utils', 'test/utils.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'symbols-leak-test',
- find_program('test/symbols-leak-test.py'),
- env: test_env,
- suite: ['python-tests'],
-)
-test(
- 'modifiers',
- executable('test-modifiers', 'test/modifiers.c', dependencies: test_dep),
- env: test_env,
-)
-test(
- 'messages',
- executable(
- 'test-messages',
- 'test/messages.c',
- 'tools/messages.c',
- 'tools/messages.h',
- include_directories: include_directories('src', 'include', 'tools'),
- dependencies: test_dep),
- env: test_env,
-)
-if get_option('enable-x11')
- test(
- 'x11',
- executable('test-x11', 'test/x11.c', dependencies: x11_test_dep),
- env: test_env,
- is_parallel : false,
- )
- test(
- 'x11comp',
- executable('test-x11comp', 'test/x11comp.c', dependencies: x11_test_dep),
- env: test_env,
- is_parallel : false,
- )
-endif
-if get_option('enable-xkbregistry')
- test(
- 'registry',
- executable('test-registry', 'test/registry.c',
- include_directories: include_directories('src'),
- dependencies: [dep_libxkbregistry, test_dep]),
- env: test_env,
- )
-endif
-if build_tools
- test('tool-option-parsing',
- find_program('test/tool-option-parsing.py'),
- env: test_env,
- suite: ['python-tests'])
-
- # A set of keysyms to test for. Add one or two symbols to this array
- # whenever the xorgproto gets updated to make sure we resolve them.
- keysyms_to_test = [
- 'XF86Macro23',
- ]
-
- env = environment()
- env.set('XKB_CONFIG_ROOT', meson.current_source_dir()/'test'/'data')
- foreach keysym: keysyms_to_test
- test('keysym-test-@0@'.format(keysym),
- find_program('test/test-keysym.py'),
- env: env,
- args: [keysym, '--tool', xkbcli_compile_keymap],
- suite: ['python-tests'])
- endforeach
-endif
-
-valgrind = find_program('valgrind', required: false)
-if valgrind.found()
- add_test_setup('valgrind',
- exe_wrapper: [valgrind,
- '--leak-check=full',
- '--track-origins=yes',
- '--gen-suppressions=all',
- '--error-exitcode=99'],
- timeout_multiplier : 10)
-else
- message('valgrind not found, disabling valgrind test setup')
-endif
-
-
-# Fuzzing target programs.
-executable('fuzz-keymap', 'fuzz/keymap/target.c', dependencies: test_dep)
-executable('fuzz-compose', 'fuzz/compose/target.c', dependencies: test_dep)
-
-
-# Benchmarks.
-bench_env = environment()
-bench_env.set('top_srcdir', meson.current_source_dir())
-benchmark(
- 'key-proc',
- executable('bench-key-proc', 'bench/key-proc.c', dependencies: test_dep),
- env: bench_env,
-)
-benchmark(
- 'rules',
- executable('bench-rules', 'bench/rules.c', dependencies: test_dep),
- env: bench_env,
-)
-benchmark(
- 'rulescomp',
- executable('bench-rulescomp', 'bench/rulescomp.c', dependencies: test_dep),
- env: bench_env,
-)
-benchmark(
- 'compose',
- executable('bench-compose', 'bench/compose.c', dependencies: test_dep),
- env: bench_env,
-)
-benchmark(
- 'compose-traversal',
- executable('bench-compose-traversal', 'bench/compose-traversal.c', dependencies: test_dep),
- env: bench_env,
-)
-benchmark(
- 'atom',
- executable('bench-atom', 'bench/atom.c', dependencies: test_dep),
- env: bench_env,
-)
-if get_option('enable-x11')
- benchmark(
- 'x11',
- executable('bench-x11', 'bench/x11.c', dependencies: x11_test_dep),
- env: bench_env,
- )
-endif
-
-
# Documentation.
if get_option('enable-docs')
doxygen = find_program('doxygen', required: false)
diff --git a/src/utils.h b/src/utils.h
index 7fd13bf..750a8e1 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -289,13 +289,13 @@ open_file(const char *path);

/* Compiler Attributes */

-#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__)
-# define XKB_EXPORT __attribute__((visibility("default")))
-#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
-# define XKB_EXPORT __global
-#else /* not gcc >= 4 and not Sun Studio >= 8 */
+// #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__)
+// # define XKB_EXPORT __attribute__((visibility("default")))
+// #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+// # define XKB_EXPORT __global
+// #else /* not gcc >= 4 and not Sun Studio >= 8 */
# define XKB_EXPORT
-#endif
+// #endif

#if defined(__MINGW32__)
# define ATTR_PRINTF(x,y) __attribute__((__format__(__MINGW_PRINTF_FORMAT, x, y)))
Loading