summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libgcrypt
diff options
context:
space:
mode:
authorSimone Weiss <simone.weiss@elektrobit.com>2022-05-04 14:25:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-05 21:17:12 +0100
commit7e101c0231f9593185146770f1496a38fa9c590e (patch)
tree7b84d918597fc306348f24d00c58bd6ef164844b /meta/recipes-support/libgcrypt
parentbed63756c56f296ff3d5a7eef66e978bd19f1008 (diff)
downloadopenembedded-core-contrib-7e101c0231f9593185146770f1496a38fa9c590e.tar.gz
libgcrypt: Add ptest
Add a ptest for libgcript to core-image-ptest-all. All tests passed on a trial run. Signed-off-by: Simone Weiss <simone.weiss@elektrobit.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libgcrypt')
-rw-r--r--meta/recipes-support/libgcrypt/files/run-ptest3
-rw-r--r--meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb15
2 files changed, 17 insertions, 1 deletions
diff --git a/meta/recipes-support/libgcrypt/files/run-ptest b/meta/recipes-support/libgcrypt/files/run-ptest
new file mode 100644
index 0000000000..4818a061b4
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C build/tests runtest-TESTS
diff --git a/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb b/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb
index 251e0d0348..aa83de226d 100644
--- a/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb
+++ b/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb
@@ -18,6 +18,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
DEPENDS = "libgpg-error"
+RDEPENDS:${PN}-ptest = "bash"
UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
@@ -25,6 +26,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
file://0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch \
file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
+ file://run-ptest \
"
SRC_URI[sha256sum] = "ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de"
@@ -33,11 +35,13 @@ CVE_CHECK_IGNORE += "CVE-2018-12433 CVE-2018-12438"
BINCONFIG = "${bindir}/libgcrypt-config"
-inherit autotools texinfo binconfig-disabled pkgconfig
+inherit autotools texinfo binconfig-disabled pkgconfig ptest
EXTRA_OECONF = "--disable-asm"
EXTRA_OEMAKE:class-target = "LIBTOOLFLAGS='--tag=CC'"
+PRIVATE_LIBS:${PN}-ptest:append = " libgcrypt.so.20"
+
PACKAGECONFIG ??= "capabilities"
PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"
@@ -52,6 +56,15 @@ do_install:append() {
install -m 0644 ${B}/src/libgcrypt.pc ${D}/${libdir}/pkgconfig/
}
+do_install_ptest() {
+ cp -r --preserve=mode,links -v ${S} ${D}${PTEST_PATH}
+ cp -r --preserve=mode,links -v ${B} ${D}${PTEST_PATH}
+ rm ${D}${PTEST_PATH}/build/cipher/gost-s-box
+ rm ${D}${PTEST_PATH}/build/doc/yat2m
+ find ${D}/${PTEST_PATH}/build -name "*.cmake" -or -name "Makefile" \
+ | xargs sed -e "s|${WORKDIR}|${PTEST_PATH}|g" -e "s|${WORKDIR}/recipe-sysroot-native||g" -i
+}
+
PACKAGES =+ "dumpsexp-dev"
FILES:${PN}-dev += "${bindir}/hmac256"