From 069ff98309dac06488082164e96e305241811839 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Fri, 2 Aug 2024 10:21:00 -0400 Subject: nettle: upgrade 3.9.1 -> 3.10 Refresh two patches to apply on top of 3.10. 11 of the ptests pass without the sc-valgrind.sh file, so make sure that's copied to the image fo ptests. Changelog: https://git.lysator.liu.se/nettle/nettle/-/blob/master/ChangeLog (From OE-Core rev: a663573dfd14c1c36c95928334836ae7acd61c0b) Signed-off-by: Trevor Gamblin Signed-off-by: Richard Purdie --- ...d-target-to-only-build-tests-not-run-them.patch | 21 +++++--- ...k-header-files-of-openssl-only-if-enable_.patch | 26 ++++++--- meta/recipes-support/nettle/nettle_3.10.bb | 62 ++++++++++++++++++++++ meta/recipes-support/nettle/nettle_3.9.1.bb | 61 --------------------- 4 files changed, 94 insertions(+), 76 deletions(-) create mode 100644 meta/recipes-support/nettle/nettle_3.10.bb delete mode 100644 meta/recipes-support/nettle/nettle_3.9.1.bb diff --git a/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch b/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch index e3f5c6de7d..345fc43ebe 100644 --- a/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch +++ b/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch @@ -1,4 +1,7 @@ -Add target to only build tests (not run them) +From e9fcb2177fda228ac065d189240e2d992e86e5bf Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin +Date: Fri, 2 Aug 2024 09:48:43 -0400 +Subject: [PATCH] Makefile.in: Add target to only build tests (not run them) Not sending upstream as this is only a start of a solution to installable tests: It's useful for us already as is. @@ -8,16 +11,20 @@ Upstream-Status: Inappropriate [not a complete solution] Signed-off-by: Jussi Kukkonen Refactored for 3.4 Signed-off-by: Armin Kuster + +Refactor for 3.10, including turning it into an mbox for easier use. + +Signed-off-by: Trevor Gamblin --- Makefile.in | 3 +++ testsuite/Makefile.in | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Makefile.in b/Makefile.in -index e5ccfc7..15c9275 100644 +index 2bf7f1e8..403a868a 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -52,6 +52,9 @@ clean distclean mostlyclean maintainer-clean tags: +@@ -53,6 +53,9 @@ clean distclean mostlyclean maintainer-clean tags: echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done $(MAKE) $@-here @@ -28,18 +35,18 @@ index e5ccfc7..15c9275 100644 true diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in -index 3f5e5f6..8fd68a3 100644 +index 0699fa0d..8ac9983c 100644 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in -@@ -122,6 +122,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ +@@ -137,6 +137,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../non-nettle.$(OBJEXT) \ # data. VALGRIND = valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes @IF_ASM@ --partial-loads-ok=yes +buildtest: $(TS_ALL) + - check: $(TS_ALL) + check: $(TS_ALL) $(TS_ALL:sc-%=%) TEST_SHLIB_DIR="$(TEST_SHLIB_DIR)" \ srcdir="$(srcdir)" \ -- -2.17.1 +2.39.2 diff --git a/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch b/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch index d5f266681e..49d633b5f7 100644 --- a/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch +++ b/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch @@ -1,4 +1,4 @@ -From ffee6b5f6204a0210f717968ec6ce514d70acca1 Mon Sep 17 00:00:00 2001 +From 5f7cdd2b878298577accade43a38e1a0951d17b4 Mon Sep 17 00:00:00 2001 From: Haiqing Bai Date: Fri, 9 Dec 2016 15:23:17 +0800 Subject: [PATCH] nettle: check header files of openssl only if @@ -15,22 +15,32 @@ refactored for 3.4. pending not in as of 3.4 Signed-off-by: Armin Kuster -Index: nettle-3.4/configure.ac -=================================================================== ---- nettle-3.4.orig/configure.ac -+++ nettle-3.4/configure.ac -@@ -185,9 +185,11 @@ AC_HEADER_TIME +Refactor for 3.10. + +Signed-off-by: Trevor Gamblin +--- + configure.ac | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 4f27e663..673c1492 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -197,9 +197,11 @@ AC_TYPE_SIZE_T AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(size_t) --AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],, +-AC_CHECK_HEADERS([openssl/evp.h openssl/ec.h openssl/rsa.h],, -[enable_openssl=no - break]) +if test "x$enable_openssl" = "xyes"; then -+ AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],, ++ AC_CHECK_HEADERS([openssl/evp.h openssl/ec.h openssl/rsa.h],, + [enable_openssl=no + break]) +fi # For use by the testsuite AC_CHECK_HEADERS([valgrind/memcheck.h]) +-- +2.39.2 + diff --git a/meta/recipes-support/nettle/nettle_3.10.bb b/meta/recipes-support/nettle/nettle_3.10.bb new file mode 100644 index 0000000000..92bc78263c --- /dev/null +++ b/meta/recipes-support/nettle/nettle_3.10.bb @@ -0,0 +1,62 @@ +SUMMARY = "A low level cryptographic library" +DESCRIPTION = "Nettle is a cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space." +HOMEPAGE = "http://www.lysator.liu.se/~nisse/nettle/" +DESCRIPTION = "It tries to solve a problem of providing a common set of \ +cryptographic algorithms for higher-level applications by implementing a \ +context-independent set of cryptographic algorithms" +SECTION = "libs" +LICENSE = "LGPL-3.0-or-later | GPL-2.0-or-later" + +LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \ + file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \ + file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e" + +DEPENDS += "gmp" + +SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ + file://Add-target-to-only-build-tests-not-run-them.patch \ + file://run-ptest \ + file://check-header-files-of-openssl-only-if-enable_.patch \ + " + +SRC_URI[sha256sum] = "b4c518adb174e484cb4acea54118f02380c7133771e7e9beb98a0787194ee47c" + +UPSTREAM_CHECK_REGEX = "nettle-(?P\d+(\.\d+)+)\.tar" + +inherit autotools ptest multilib_header lib_package + +EXTRA_AUTORECONF += "--exclude=aclocal" + +EXTRA_OECONF = "--disable-openssl" + +EXTRA_OECONF:append:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon",""," --disable-arm-neon --disable-fat",d)}" +EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon",""," --disable-arm-neon --disable-fat",d)}" + +do_compile_ptest() { + oe_runmake buildtest +} + +do_install:append() { + oe_multilib_header nettle/version.h +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/testsuite/ + install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ + install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ + install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/ + install ${S}/testsuite/sc-valgrind.sh ${D}${PTEST_PATH}/testsuite/ + + # Install a symlink for dlopen-test + ln -sr ${D}${libdir}/libnettle.so.*.* ${D}${PTEST_PATH}/libnettle.so + # These examples are needed for pkcs1-conv-test + install ${B}/examples/rsa-sign ${B}/examples/rsa-verify ${D}${PTEST_PATH}/testsuite/ + # Fix build-time relative paths + sed -i -e 's|../tools/|${bindir}/|g' ${D}${PTEST_PATH}/testsuite/*-test + sed -i -e 's|../examples/|./|g' ${D}${PTEST_PATH}/testsuite/*-test +} + +RDEPENDS:${PN}-ptest += "${PN}-bin" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-support/nettle/nettle_3.9.1.bb b/meta/recipes-support/nettle/nettle_3.9.1.bb deleted file mode 100644 index 396708cf87..0000000000 --- a/meta/recipes-support/nettle/nettle_3.9.1.bb +++ /dev/null @@ -1,61 +0,0 @@ -SUMMARY = "A low level cryptographic library" -DESCRIPTION = "Nettle is a cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space." -HOMEPAGE = "http://www.lysator.liu.se/~nisse/nettle/" -DESCRIPTION = "It tries to solve a problem of providing a common set of \ -cryptographic algorithms for higher-level applications by implementing a \ -context-independent set of cryptographic algorithms" -SECTION = "libs" -LICENSE = "LGPL-3.0-or-later | GPL-2.0-or-later" - -LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \ - file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \ - file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e" - -DEPENDS += "gmp" - -SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ - file://Add-target-to-only-build-tests-not-run-them.patch \ - file://run-ptest \ - file://check-header-files-of-openssl-only-if-enable_.patch \ - " - -SRC_URI[sha256sum] = "ccfeff981b0ca71bbd6fbcb054f407c60ffb644389a5be80d6716d5b550c6ce3" - -UPSTREAM_CHECK_REGEX = "nettle-(?P\d+(\.\d+)+)\.tar" - -inherit autotools ptest multilib_header lib_package - -EXTRA_AUTORECONF += "--exclude=aclocal" - -EXTRA_OECONF = "--disable-openssl" - -EXTRA_OECONF:append:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon",""," --disable-arm-neon --disable-fat",d)}" -EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon",""," --disable-arm-neon --disable-fat",d)}" - -do_compile_ptest() { - oe_runmake buildtest -} - -do_install:append() { - oe_multilib_header nettle/version.h -} - -do_install_ptest() { - install -d ${D}${PTEST_PATH}/testsuite/ - install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ - install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ - install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/ - - # Install a symlink for dlopen-test - ln -sr ${D}${libdir}/libnettle.so.*.* ${D}${PTEST_PATH}/libnettle.so - # These examples are needed for pkcs1-conv-test - install ${B}/examples/rsa-sign ${B}/examples/rsa-verify ${D}${PTEST_PATH}/testsuite/ - # Fix build-time relative paths - sed -i -e 's|../tools/|${bindir}/|g' ${D}${PTEST_PATH}/testsuite/*-test - sed -i -e 's|../examples/|./|g' ${D}${PTEST_PATH}/testsuite/*-test -} - -RDEPENDS:${PN}-ptest += "${PN}-bin" - -BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf