new file mode 100644
@@ -0,0 +1,35 @@
+From 7358f4ff6c711bde1d83b9a38bbf349a23e0e243 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 libgpg-error 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 9f91297..daa2730 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -270,8 +270,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=""
+ cid="0000000"
+ rev="0000000"
+ rvd="0"
+--
+2.34.1
+
@@ -17,6 +17,7 @@ UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
file://pkgconfig.patch \
file://0001-Do-not-fail-when-testing-config-scripts.patch \
+ file://0001-autogen.sh-drop-unknown-suffix-from-version-number.patch \
file://run-ptest \
"
If autogen.sh is run outside of a git repo, the find-version function always assumes that libgpg-error is a beta version and adds the suffix '-unknown' to the version number. Befor the fix: $ gpg-error --version gpg-error (libgpg-error) 1.51-unknown After the fix: $ gpg-error --version gpg-error (libgpg-error) 1.51 Signed-off-by: Yi Zhao <yi.zhao@windriver.com> --- ...p-unknown-suffix-from-version-number.patch | 35 +++++++++++++++++++ .../libgpg-error/libgpg-error_1.51.bb | 1 + 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0001-autogen.sh-drop-unknown-suffix-from-version-number.patch