summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-core/kbd
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-core/kbd')
-rw-r--r--poky/meta/recipes-core/kbd/kbd/run-ptest4
-rw-r--r--poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch56
-rw-r--r--poky/meta/recipes-core/kbd/kbd_2.0.4.bb64
3 files changed, 124 insertions, 0 deletions
diff --git a/poky/meta/recipes-core/kbd/kbd/run-ptest b/poky/meta/recipes-core/kbd/kbd/run-ptest
new file mode 100644
index 000000000..7a2d205f5
--- /dev/null
+++ b/poky/meta/recipes-core/kbd/kbd/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+CURDIR=$(dirname `readlink -f $0`)
+make -k -C ${CURDIR}/tests check-TESTS
diff --git a/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch b/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
new file mode 100644
index 000000000..a9a3ab8ab
--- /dev/null
+++ b/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+kbd is out of source built, then the value of $(srcdir) is relative path of
+${S}/tests to ${B}/tests. Macro DATADIR is defined with $(srcdir) and replaced
+in .c files by compiler, and string @DATADIR@ is replaced with $(srdir) by rule
+"%: %.in" in Makefile.
+
+But kbd-ptest puts test cases and resource files in same directory, then some
+ptest cases fail to find resources.
+
+Replace DATADIR and @DATADIR@ with current directory(dot) to make test cases
+run as expected.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Index: kbd-2.0.4/tests/Makefile.am
+===================================================================
+--- kbd-2.0.4.orig/tests/Makefile.am
++++ kbd-2.0.4/tests/Makefile.am
+@@ -1,7 +1,7 @@
+ AM_CPPFLAGS = \
+ -I$(srcdir)/../src/libkeymap \
+ -I$(builddir)/../src/libkeymap \
+- -DDATADIR=\"$(srcdir)\" -DBUILDDIR=\"$(builddir)\"
++ -DDATADIR=\".\" -DBUILDDIR=\"$(builddir)\"
+
+ AM_CFLAGS = $(CHECK_CFLAGS)
+ LDADD = $(top_builddir)/src/libkeymap/libkeymap.la $(CHECK_LIBS) @INTLLIBS@
+Index: kbd-2.0.4/tests/alt-is-meta.in
+===================================================================
+--- kbd-2.0.4.orig/tests/alt-is-meta.in
++++ kbd-2.0.4/tests/alt-is-meta.in
+@@ -7,8 +7,8 @@ cd "$cwd"
+ rc=0
+ temp="$(mktemp "@BUILDDIR@/temp.XXXXXXXXX")"
+
+-./libkeymap-showmaps "@DATADIR@"/alt-is-meta.map > "$temp" || rc=$?
+-cmp -s "@DATADIR@//alt-is-meta.output" "$temp" || rc=$?
++./libkeymap-showmaps ./alt-is-meta.map > "$temp" || rc=$?
++cmp -s "./alt-is-meta.output" "$temp" || rc=$?
+
+ if [ "$rc" != 0 ]; then
+ printf 'failed\n'
+Index: kbd-2.0.4/tests/dumpkeys-fulltable.in
+===================================================================
+--- kbd-2.0.4.orig/tests/dumpkeys-fulltable.in
++++ kbd-2.0.4/tests/dumpkeys-fulltable.in
+@@ -5,7 +5,7 @@ cwd="$(readlink -ev "${0%/*}")"
+ cd "$cwd"
+
+ BUILDDIR="@BUILDDIR@"
+-DATADIR="@DATADIR@"
++DATADIR="."
+
+ check_keymap() {
+ local kmap temp rc
diff --git a/poky/meta/recipes-core/kbd/kbd_2.0.4.bb b/poky/meta/recipes-core/kbd/kbd_2.0.4.bb
new file mode 100644
index 000000000..4af3256ff
--- /dev/null
+++ b/poky/meta/recipes-core/kbd/kbd_2.0.4.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Keytable files and keyboard utilities"
+HOMEPAGE = "http://www.kbd-project.org/"
+# everything minus console-fonts is GPLv2+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
+
+inherit autotools gettext ptest pkgconfig
+
+RREPLACES_${PN} = "console-tools"
+RPROVIDES_${PN} = "console-tools"
+RCONFLICTS_${PN} = "console-tools"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
+ file://run-ptest \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://set-proper-path-of-resources.patch', '', d)} \
+ "
+
+SRC_URI[md5sum] = "c1635a5a83b63aca7f97a3eab39ebaa6"
+SRC_URI[sha256sum] = "5fd90af6beb225a9bb9b9fb414c090fba53c9a55793e172f508cd43652e59a88"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests','', d)} \
+ "
+
+PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
+PACKAGECONFIG[tests] = "--enable-tests, --disable-tests, libcheck"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests dumpkeys-fulltable alt-is-meta
+}
+
+do_install_ptest() {
+ install -D ${B}/tests/Makefile ${D}${PTEST_PATH}/tests/Makefile
+ sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
+ -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+ -e 's:${DEBUG_PREFIX_MAP}::g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${S}/config/missing::g' \
+ -e 's:${WORKDIR}::g' \
+ -e '/libkeymap_.*_SOURCES =/d' -e '/$(EXEEXT):/,/^$/d' ${D}${PTEST_PATH}/tests/Makefile
+
+ find ${B}/tests -executable -exec install {} ${D}${PTEST_PATH}/tests \;
+ find ${S}/tests \( -name \*.map -o -name \*.bin -o -name \*.output \) -exec install {} ${D}${PTEST_PATH}/tests \;
+
+ install -D -m 755 ${S}/config/test-driver ${D}${PTEST_PATH}/config/test-driver
+}
+
+PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
+
+FILES_${PN}-consolefonts = "${datadir}/consolefonts"
+FILES_${PN}-consoletrans = "${datadir}/consoletrans"
+FILES_${PN}-keymaps = "${datadir}/keymaps"
+FILES_${PN}-unimaps = "${datadir}/unimaps"
+
+RDEPENDS_${PN}-ptest = "make"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt showkey"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
OpenPOWER on IntegriCloud