summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/gettext
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2019-04-24 11:37:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-29 10:23:24 +0100
commit892e6258f737b0903fef29daef99f31f616e217f (patch)
treed3139f8f9e7ab4d24bac0ca6d60fe735cb22a3c7 /meta/recipes-core/gettext
parent434618bec47efdda90981d248bc481f45da093b4 (diff)
downloadopenembedded-core-892e6258f737b0903fef29daef99f31f616e217f.tar.gz
gettext: add ptest support
skip test lang-c since it need gcc/libtool on target Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/gettext')
-rw-r--r--meta/recipes-core/gettext/gettext-0.19.8.1/run-ptest6
-rw-r--r--meta/recipes-core/gettext/gettext-0.19.8.1/serial-tests-config.patch58
-rw-r--r--meta/recipes-core/gettext/gettext_0.19.8.1.bb57
3 files changed, 120 insertions, 1 deletions
diff --git a/meta/recipes-core/gettext/gettext-0.19.8.1/run-ptest b/meta/recipes-core/gettext/gettext-0.19.8.1/run-ptest
new file mode 100644
index 0000000000..f17f3c87a7
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.19.8.1/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+#This script is used to run gettext test suites
+cd tests
+
+make -k runtest-TESTS top_srcdir=.. srcdir=. abs_srcdir=$PWD top_builddir=$PWD/../ abs_top_srcdir=$PWD/../ | cat
diff --git a/meta/recipes-core/gettext/gettext-0.19.8.1/serial-tests-config.patch b/meta/recipes-core/gettext/gettext-0.19.8.1/serial-tests-config.patch
new file mode 100644
index 0000000000..31ff9138a9
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.19.8.1/serial-tests-config.patch
@@ -0,0 +1,58 @@
+From c4b1f3a0c7b7c40b343be9b95deb84e0485643be Mon Sep 17 00:00:00 2001
+From: "Hongjun.Yang" <hongjun.yang@windriver.com>
+Date: Thu, 28 Jul 2016 12:36:15 +0800
+Subject: [PATCH] fix for ptest
+
+Add serial-tests support, ptest need it
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ configure.ac | 2 +-
+ gettext-runtime/configure.ac | 2 +-
+ gettext-tools/configure.ac | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5e996fa..880581f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -23,7 +23,7 @@ AC_INIT([gettext],
+ [bug-gnu-gettext@gnu.org])
+ AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c])
+ AC_CONFIG_AUX_DIR([build-aux])
+-AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests dist-xz dist-lzip])
++AM_INIT_AUTOMAKE([1.13 silent-rules serial-tests dist-xz dist-lzip])
+
+ dnl Override automake's tar command used for creating distributions.
+ am__tar='${AMTAR} chof - --owner=root --group=root "$$tardir"'
+diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac
+index e9299b6..d4f5528 100644
+--- a/gettext-runtime/configure.ac
++++ b/gettext-runtime/configure.ac
+@@ -22,7 +22,7 @@ AC_INIT([gettext-runtime],
+ [bug-gnu-gettext@gnu.org])
+ AC_CONFIG_SRCDIR([intl/dcigettext.c])
+ AC_CONFIG_AUX_DIR([../build-aux])
+-AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests])
++AM_INIT_AUTOMAKE([1.11.1 silent-rules serial-tests])
+ AC_CONFIG_HEADERS([config.h])
+
+ dnl Installation directories.
+diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac
+index 920eeb6..c507434 100644
+--- a/gettext-tools/configure.ac
++++ b/gettext-tools/configure.ac
+@@ -22,7 +22,7 @@ AC_INIT([gettext-tools],
+ [bug-gnu-gettext@gnu.org])
+ AC_CONFIG_SRCDIR([src/msgfmt.c])
+ AC_CONFIG_AUX_DIR([../build-aux])
+-AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests])
++AM_INIT_AUTOMAKE([1.11.1 silent-rules serial-tests])
+ AC_CONFIG_HEADERS([config.h])
+
+ dnl Installation directories.
+--
+2.1.4
+
diff --git a/meta/recipes-core/gettext/gettext_0.19.8.1.bb b/meta/recipes-core/gettext/gettext_0.19.8.1.bb
index 404972439b..627568bc3f 100644
--- a/meta/recipes-core/gettext/gettext_0.19.8.1.bb
+++ b/meta/recipes-core/gettext/gettext_0.19.8.1.bb
@@ -22,12 +22,14 @@ SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
file://cr-statement.c-timsort.h-fix-formatting-issues.patch \
file://use-pkgconfig.patch \
file://fix-CVE-2018-18751.patch \
+ file://run-ptest \
+ file://serial-tests-config.patch \
"
SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
SRC_URI[sha256sum] = "ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43"
-inherit autotools texinfo pkgconfig
+inherit autotools texinfo pkgconfig ptest
EXTRA_OECONF += "--without-lispdir \
--disable-csharp \
@@ -129,4 +131,57 @@ do_install_append_class-native () {
}
+do_compile_ptest() {
+ cd ${B}/gettext-tools/tests/
+ sed -i '/^buildtest-TESTS: /c buildtest-TESTS: $(TESTS) $(check_PROGRAMS)' Makefile
+ oe_runmake buildtest-TESTS
+ cd -
+}
+
+do_install_ptest() {
+ if [ ${PTEST_ENABLED} = "1" ]; then
+ mkdir -p ${D}${PTEST_PATH}/tests
+ mkdir -p ${D}${PTEST_PATH}/src
+ mkdir -p ${D}${PTEST_PATH}/po
+ mkdir -p ${D}${PTEST_PATH}/misc
+ cp -rf ${S}/gettext-tools/tests/* ${D}${PTEST_PATH}/tests
+ cp -rf ${B}/gettext-tools/tests/.libs/* ${D}${PTEST_PATH}/tests
+ cp -rf ${B}/gettext-runtime/intl/.libs/libgnuintl.so.8* ${D}${libdir}/
+ cp -rf ${B}/gettext-tools/tests/Makefile ${D}${PTEST_PATH}/tests
+ sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
+ sed -i -e 's:CONFIG_SHELL=.*:& LOCALE_FR='fr_FR.iso88591' LOCALE_FR_UTF8='fr_FR.utf8' LOCALE_JA='ja_JP.eucjp':g' \
+ -e 's:lang-c lang-c++:lang-c++:g' ${D}${PTEST_PATH}/tests/Makefile
+ install ${S}/gettext-tools/src/msgunfmt.tcl ${D}${PTEST_PATH}/src
+ install ${S}/gettext-tools/src/project-id ${D}${PTEST_PATH}/src
+ install ${B}/gettext-runtime/src/gettext.sh ${D}${PTEST_PATH}/src
+ install ${B}/gettext-runtime/src/ngettext ${D}${PTEST_PATH}/src
+ install ${B}/gettext-runtime/src/envsubst ${D}${PTEST_PATH}/src
+ install ${B}/gettext-runtime/src/gettext ${D}${PTEST_PATH}/src
+ install ${B}/gettext-tools/src/.libs/cldr-plurals ${D}${PTEST_PATH}/src
+ install ${S}/gettext-tools/po/gettext-tools.pot ${D}${PTEST_PATH}/po
+ install ${B}/gettext-tools/misc/* ${D}${PTEST_PATH}/misc
+ find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
+ chmod 0755 ${D}${PTEST_PATH}/tests/lang-vala ${D}${PTEST_PATH}/tests/plural-1 ${D}${PTEST_PATH}/tests/xgettext-tcl-4 \
+ ${D}${PTEST_PATH}/tests/xgettext-vala-1 ${D}${PTEST_PATH}/tests/xgettext-po-2
+ fi
+}
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = "\
+ glibc-gconv-big5 \
+ glibc-charmap-big5 \
+ glibc-gconv-cp1251 \
+ glibc-charmap-cp1251 \
+ glibc-charmap-iso-8859-9 \
+ glibc-gconv-iso8859-9 \
+ glibc-charmap-koi8-r \
+ glibc-gconv-koi8-r \
+ glibc-gconv-iso8859-2 \
+ glibc-charmap-iso-8859-2 \
+ glibc-gconv-euc-kr \
+ glibc-charmap-euc-kr \
+"
+
+INSANE_SKIP_${PN}-ptest += "ldflags"
+INSANE_SKIP_${PN}-ptest += "rpaths"
+
BBCLASSEXTEND = "native nativesdk"