8d419f
From 6bf4cd485735ecff5c0ccfb6b36bf1b2f310997a Mon Sep 17 00:00:00 2001
8d419f
From: Yu Watanabe <watanabe.yu+github@gmail.com>
8d419f
Date: Tue, 14 Jun 2022 09:12:00 +0900
8d419f
Subject: [PATCH] test: install libxkbcommon and x11 keymaps
8d419f
8d419f
(cherry picked from commit 1136175c7fd4898c6fdc59c1f729386cf994265c)
8d419f
8d419f
Related: #2087652
8d419f
---
8d419f
 test/test-functions | 19 ++++++++++++++++++-
8d419f
 1 file changed, 18 insertions(+), 1 deletion(-)
8d419f
8d419f
diff --git a/test/test-functions b/test/test-functions
8d419f
index 050fefaf1b..644c3a8613 100644
8d419f
--- a/test/test-functions
8d419f
+++ b/test/test-functions
8d419f
@@ -685,6 +685,7 @@ setup_basic_environment() {
8d419f
     install_dbus
8d419f
     install_fonts
8d419f
     install_keymaps
8d419f
+    install_x11_keymaps
8d419f
     install_terminfo
8d419f
     install_execs
8d419f
     install_fs_tools
8d419f
@@ -1198,7 +1199,7 @@ install_missing_libraries() {
8d419f
     local lib path
8d419f
     # A number of dependencies is now optional via dlopen, so the install
8d419f
     # script will not pick them up, since it looks at linkage.
8d419f
-    for lib in libcryptsetup libidn libidn2 pwquality libqrencode tss2-esys tss2-rc tss2-mu tss2-tcti-device libfido2 libbpf libelf libdw; do
8d419f
+    for lib in libcryptsetup libidn libidn2 pwquality libqrencode tss2-esys tss2-rc tss2-mu tss2-tcti-device libfido2 libbpf libelf libdw xkbcommon; do
8d419f
         ddebug "Searching for $lib via pkg-config"
8d419f
         if pkg-config --exists "$lib"; then
8d419f
                 path="$(pkg-config --variable=libdir "$lib")"
8d419f
@@ -1214,6 +1215,10 @@ install_missing_libraries() {
8d419f
                 # (eg: libcryptsetup), so just ignore them
8d419f
                 inst_libs "${path}/${lib}.so" || true
8d419f
                 inst_library "${path}/${lib}.so" || true
8d419f
+
8d419f
+                if [[ "$lib" == "libxkbcommon" ]]; then
8d419f
+                    install_x11_keymaps full
8d419f
+                fi
8d419f
         else
8d419f
             ddebug "$lib.pc not found, skipping"
8d419f
             continue
8d419f
@@ -1889,6 +1894,18 @@ install_keymaps() {
8d419f
     fi
8d419f
 }
8d419f
 
8d419f
+install_x11_keymaps() {
8d419f
+    dinfo "Install x11 keymaps"
8d419f
+
8d419f
+    if (( $# == 0 )); then
8d419f
+        # Install only keymap list.
8d419f
+        inst /usr/share/X11/xkb/rules/base.lst
8d419f
+    else
8d419f
+        # When it takes any argument, then install all keymaps.
8d419f
+        inst_recursive /usr/share/X11/xkb
8d419f
+    fi
8d419f
+}
8d419f
+
8d419f
 install_zoneinfo() {
8d419f
     dinfo "Install time zones"
8d419f
     inst_any /usr/share/zoneinfo/Asia/Seoul