From 7abf2d316c10520834972a7977f037810bf81277 Mon Sep 17 00:00:00 2001
From: Upgrade Helper <auh@yoctoproject.org>
Date: Mon, 1 Jun 2026 15:13:10 +0000
Subject: [PATCH] nettle: upgrade 3.10.2 -> 4.0

---
 ...get-to-only-build-tests-not-run-them.patch | 10 ++--
 ...der-files-of-openssl-only-if-enable_.patch |  6 +--
 .../{nettle_3.10.2.bb => nettle_4.0.bb}       | 48 +++++++++++++++++--
 3 files changed, 53 insertions(+), 11 deletions(-)
 rename meta/recipes-support/nettle/{nettle_3.10.2.bb => nettle_4.0.bb} (57%)

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 ee3e74c43b..ce6eb06530 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,4 @@
-From 3ea3eaf5bda21529fc8a8da3d8b07ebc3875ba7e Mon Sep 17 00:00:00 2001
+From 41efa69ebce70f4171a63da6dc407df849f74c14 Mon Sep 17 00:00:00 2001
 From: Trevor Gamblin <tgamblin@baylibre.com>
 Date: Fri, 2 Aug 2024 09:48:43 -0400
 Subject: [PATCH] Makefile.in: Add target to only build tests (not run them)
@@ -21,10 +21,10 @@ Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
  2 files changed, 5 insertions(+)
 
 diff --git a/Makefile.in b/Makefile.in
-index 71ad761..0f239f4 100644
+index 9399985..4d4046e 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -53,6 +53,9 @@ clean distclean mostlyclean maintainer-clean tags:
+@@ -56,6 +56,9 @@ clean distclean mostlyclean maintainer-clean tags:
  	  echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done
  	$(MAKE) $@-here
  
@@ -35,10 +35,10 @@ index 71ad761..0f239f4 100644
  	true
  
 diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
-index 0699fa0..8ac9983 100644
+index b2f0518..c93b9b6 100644
 --- a/testsuite/Makefile.in
 +++ b/testsuite/Makefile.in
-@@ -137,6 +137,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../non-nettle.$(OBJEXT) \
+@@ -144,6 +144,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
  
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 89b5c7bec4..8eb0eac1c9 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 ec2ca7e505e6bfe1fff2a7d6e6bb39b60b93e19a Mon Sep 17 00:00:00 2001
+From 2da05e71f04cd344682149d0284fadccfb222ebc Mon Sep 17 00:00:00 2001
 From: Haiqing Bai <Haiqing.Bai@windriver.com>
 Date: Fri, 9 Dec 2016 15:23:17 +0800
 Subject: [PATCH] nettle: check header files of openssl only if
@@ -23,10 +23,10 @@ Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
  1 file changed, 5 insertions(+), 3 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 7c003bb..779f7ff 100644
+index af017d8..9294e24 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -197,9 +197,11 @@ AC_TYPE_SIZE_T
+@@ -177,9 +177,11 @@ AC_TYPE_SIZE_T
  AC_CHECK_SIZEOF(long)
  AC_CHECK_SIZEOF(size_t)
  
diff --git a/meta/recipes-support/nettle/nettle_3.10.2.bb b/meta/recipes-support/nettle/nettle_4.0.bb
similarity index 57%
rename from meta/recipes-support/nettle/nettle_3.10.2.bb
rename to meta/recipes-support/nettle/nettle_4.0.bb
index 7b7be5f594..384d946801 100644
--- a/meta/recipes-support/nettle/nettle_3.10.2.bb
+++ b/meta/recipes-support/nettle/nettle_4.0.bb
@@ -1,3 +1,44 @@
+# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
+# The following is the difference between the old and the new license text.
+# Please update the LICENSE value if needed, and summarize the changes in
+# the commit message via 'License-Update:' tag.
+# (example: 'License-Update: copyright years updated.')
+#
+# The changes:
+#
+# --- COPYING.LESSERv3
+# +++ COPYING.LESSERv3
+# @@ -1,7 +1,7 @@
+# -		   GNU LESSER GENERAL PUBLIC LICENSE
+# +                   GNU LESSER GENERAL PUBLIC LICENSE
+#                         Version 3, 29 June 2007
+#  
+# - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+# + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+#   Everyone is permitted to copy and distribute verbatim copies
+#   of this license document, but changing it is not allowed.
+#  
+# @@ -10,7 +10,7 @@
+#  the terms and conditions of version 3 of the GNU General Public
+#  License, supplemented by the additional permissions listed below.
+#  
+# -  0. Additional Definitions. 
+# +  0. Additional Definitions.
+#  
+#    As used herein, "this License" refers to version 3 of the GNU Lesser
+#  General Public License, and the "GNU GPL" refers to version 3 of the GNU
+# @@ -111,7 +111,7 @@
+#         a copy of the Library already present on the user's computer
+#         system, and (b) will operate properly with a modified version
+#         of the Library that is interface-compatible with the Linked
+# -       Version. 
+# +       Version.
+#  
+#     e) Provide Installation Information, but only if you would otherwise
+#     be required to provide such information under section 6 of the
+# 
+#
+
 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/"
@@ -7,10 +48,11 @@ 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 \
+LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=3000208d539ec061b899bce1d9ce9404 \
                     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"
+                    file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \
+                    "
 
 DEPENDS += "gmp"
 
@@ -20,7 +62,7 @@ SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
            file://check-header-files-of-openssl-only-if-enable_.patch \
            "
 
-SRC_URI[sha256sum] = "fe9ff51cb1f2abb5e65a6b8c10a92da0ab5ab6eaf26e7fc2b675c45f1fb519b5"
+SRC_URI[sha256sum] = "3addbc00da01846b232fb3bc453538ea5468da43033f21bb345cb1e9073f5094"
 
 UPSTREAM_CHECK_REGEX = "nettle-(?P<pver>\d+(\.\d+)+)\.tar"
 
-- 
2.47.1

