From abb249841a0f8896023229b2df9eb209d9492089 Mon Sep 17 00:00:00 2001 From: Simone Weiss Date: Wed, 4 May 2022 14:25:15 +0200 Subject: libgcrypt: Add ptest Add a ptest for libgcript to core-image-ptest-all. All tests passed on a trial run. (From OE-Core rev: 7e101c0231f9593185146770f1496a38fa9c590e) Signed-off-by: Simone Weiss Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- meta/conf/distro/include/ptest-packagelists.inc | 1 + meta/recipes-support/libgcrypt/files/run-ptest | 3 +++ meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb | 15 ++++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/libgcrypt/files/run-ptest diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index 54a290871e..a1ead90649 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc @@ -87,6 +87,7 @@ PTESTS_SLOW = "\ glib-2.0-ptest \ gstreamer1.0-ptest \ libevent-ptest \ + libgcrypt-ptest \ lttng-tools-ptest \ openssh-ptest \ openssl-ptest \ 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" -- cgit v1.2.3-54-g00ecf