diff mbox series

[kirkstone,04/11] ntpsec: Add -D_GNU_SOURCE and fix building with devtool

Message ID 9f1013ba4555257989b640d3c37bf2f322a1a311.1663590728.git.akuster808@gmail.com
State New
Headers show
Series [kirkstone,01/11] nodejs-oe-cache-native: initial checkin | expand

Commit Message

akuster808 Sept. 19, 2022, 12:33 p.m. UTC
From: Khem Raj <raj.khem@gmail.com>

wscript detects .git directory and if its present them invokes git
describe --dirty which does not work on the devtool created git
repository, since its synthesized.

Add GNU_SOURCE define to get strptime() definition

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 375be9fd60e22fb60b53d664983cb70d26d8a288)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 ...01-wscript-Widen-the-search-for-tags.patch | 29 +++++++++++++++++++
 .../recipes-support/ntpsec/ntpsec_1.2.1.bb    |  6 ++--
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch
new file mode 100644
index 0000000000..98c62eed49
--- /dev/null
+++ b/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch
@@ -0,0 +1,29 @@ 
+From 9a7dead72f41e79979625c9bdef2fb638427d3d6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 22 Aug 2022 20:54:17 -0700
+Subject: [PATCH] wscript: Widen the search for tags
+
+Default is to look for annotated tags, howveer when using devtool we
+create our own git tree from release tarballs which will have tags but
+they are not annotated, therefore broaden the search to include all tags
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ wscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index 879ded1..dff835d 100644
+--- a/wscript
++++ b/wscript
+@@ -177,7 +177,7 @@ def configure(ctx):
+     if build_desc:
+         build_desc = ' ' + build_desc
+     if ctx.env.BIN_GIT:
+-        cmd = ctx.env.BIN_GIT + shlex.split("describe --dirty")
++        cmd = ctx.env.BIN_GIT + shlex.split("describe --tags --dirty")
+         git_short_hash = ctx.cmd_and_log(cmd).strip()
+         git_short_hash = '-'.join(git_short_hash.split('-')[1:])
+ 
diff --git a/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
index 3efac7d983..bed0e2e108 100644
--- a/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
+++ b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
@@ -16,7 +16,9 @@  SRC_URI = "https://ftp.ntpsec.org/pub/releases/ntpsec-${PV}.tar.gz \
            file://0001-ntpd-ntp_sandbox.c-allow-clone3-for-glibc-2.34-in-se.patch \
            file://0001-ntpd-ntp_sandbox.c-allow-newfstatat-on-all-archs-for.patch \
            file://0002-ntpd-ntp_sandbox.c-match-riscv-to-aarch-in-seccomp-f.patch \
-           file://volatiles.ntpsec"
+           file://volatiles.ntpsec \
+           file://0001-wscript-Widen-the-search-for-tags.patch \
+           "
 
 SRC_URI[sha256sum] = "f2684835116c80b8f21782a5959a805ba3c44e3a681dd6c17c7cb00cc242c27a"
 
@@ -54,7 +56,7 @@  export PYTAG = "cpython${@ d.getVar('PYTHON_BASEVERSION').replace('.', '')}"
 export pyext_PATTERN = "%s.so"
 export PYTHON_LDFLAGS = "-lpthread -ldl"
 
-CFLAGS:append = " -I${PYTHON_INCLUDE_DIR}"
+CFLAGS:append = " -I${PYTHON_INCLUDE_DIR} -D_GNU_SOURCE"
 
 EXTRA_OECONF = "--cross-compiler='${CC}' \
                 --cross-cflags='${CFLAGS}' \