new file mode 100644
@@ -0,0 +1,35 @@
+From 028305ba9ad7769d6f1747a4945949ced8761ba9 Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Tue, 15 Apr 2025 15:32:58 +0800
+Subject: [PATCH] autogen.sh: drop '-unknown' suffix from version number
+
+If autogen.sh is run outside of a git repo, the find-version function
+always assumes that libgcrypt is a beta version and adds the suffix
+'-unknown' to the version number. This should not work for users who use
+tarball and re-run autoconf in build directory.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ autogen.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 9b36158..4b2e657 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -265,8 +265,8 @@ if [ "$myhost" = "find-version" ]; then
+ rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
+ else
+ ingit=no
+- beta=yes
+- tmp="-unknown"
++ beta=no
++ tmp=""
+ rev="0000000"
+ rvd="0"
+ fi
+--
+2.34.1
+
@@ -24,6 +24,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
file://no-native-gpg-error.patch \
file://no-bench-slope.patch \
+ file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "09120c9867ce7f2081d6aaa1775386b98c2f2f246135761aae47d81f58685b9c"
If autogen.sh is run outside of a git repo, the find-version function always assumes that libgcrypt is a beta version and adds the suffix '-unknown' to the version number. Befor the fix: $ mpicalc --version mpicalc 2.0 libgcrypt 1.11.0-unknown After the fix: $ mpicalc --version mpicalc 2.0 libgcrypt 1.11.0 Signed-off-by: Yi Zhao <yi.zhao@windriver.com> --- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libgcrypt/libgcrypt_1.11.0.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/libgcrypt/files/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch