naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
Blob Blame History Raw
From 6bf4cd485735ecff5c0ccfb6b36bf1b2f310997a Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 14 Jun 2022 09:12:00 +0900
Subject: [PATCH] test: install libxkbcommon and x11 keymaps

(cherry picked from commit 1136175c7fd4898c6fdc59c1f729386cf994265c)

Related: #2087652
---
 test/test-functions | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/test/test-functions b/test/test-functions
index 050fefaf1b..644c3a8613 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -685,6 +685,7 @@ setup_basic_environment() {
     install_dbus
     install_fonts
     install_keymaps
+    install_x11_keymaps
     install_terminfo
     install_execs
     install_fs_tools
@@ -1198,7 +1199,7 @@ install_missing_libraries() {
     local lib path
     # A number of dependencies is now optional via dlopen, so the install
     # script will not pick them up, since it looks at linkage.
-    for lib in libcryptsetup libidn libidn2 pwquality libqrencode tss2-esys tss2-rc tss2-mu tss2-tcti-device libfido2 libbpf libelf libdw; do
+    for lib in libcryptsetup libidn libidn2 pwquality libqrencode tss2-esys tss2-rc tss2-mu tss2-tcti-device libfido2 libbpf libelf libdw xkbcommon; do
         ddebug "Searching for $lib via pkg-config"
         if pkg-config --exists "$lib"; then
                 path="$(pkg-config --variable=libdir "$lib")"
@@ -1214,6 +1215,10 @@ install_missing_libraries() {
                 # (eg: libcryptsetup), so just ignore them
                 inst_libs "${path}/${lib}.so" || true
                 inst_library "${path}/${lib}.so" || true
+
+                if [[ "$lib" == "libxkbcommon" ]]; then
+                    install_x11_keymaps full
+                fi
         else
             ddebug "$lib.pc not found, skipping"
             continue
@@ -1889,6 +1894,18 @@ install_keymaps() {
     fi
 }
 
+install_x11_keymaps() {
+    dinfo "Install x11 keymaps"
+
+    if (( $# == 0 )); then
+        # Install only keymap list.
+        inst /usr/share/X11/xkb/rules/base.lst
+    else
+        # When it takes any argument, then install all keymaps.
+        inst_recursive /usr/share/X11/xkb
+    fi
+}
+
 install_zoneinfo() {
     dinfo "Install time zones"
     inst_any /usr/share/zoneinfo/Asia/Seoul