diff mbox series

[meta-oe,49/55] bcu: Fix build with CMake 4.5

Message ID 20261125080732.2419614-55-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-multimedia] clightd: Port ALS sensor to libiio 1.0 | expand

Commit Message

Khem Raj Nov. 25, 2026, 8:07 a.m. UTC
CMakeLists.txt runs create_version_h.sh directly with execute_process().
The script has no "#!" line, which CMake 4.5 no longer tolerates: the
exec fails with "exec format error", configure carries on, version.h is
never generated and do_compile fails with:

  bcu.c:58:10: fatal error: 'version.h' file not found

Add a shebang to the script. Also add UPSTREAM_CHECK_GITTAGREGEX so only
bcu_X.Y.Z release tags are considered (the tag list also has a stray
bcu__1.0.173).

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...01-create_version_h.sh-Add-a-shebang.patch | 30 +++++++++++++++++++
 meta-oe/recipes-support/bcu/bcu_1.2.1.bb      |  3 ++
 2 files changed, 33 insertions(+)
 create mode 100644 meta-oe/recipes-support/bcu/bcu/0001-create_version_h.sh-Add-a-shebang.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/bcu/bcu/0001-create_version_h.sh-Add-a-shebang.patch b/meta-oe/recipes-support/bcu/bcu/0001-create_version_h.sh-Add-a-shebang.patch
new file mode 100644
index 0000000000..d8d05eb794
--- /dev/null
+++ b/meta-oe/recipes-support/bcu/bcu/0001-create_version_h.sh-Add-a-shebang.patch
@@ -0,0 +1,30 @@ 
+From 5cf6653144fe9b3dcb892f40cb919d4536711a5a Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Mon, 23 Nov 2026 19:28:03 -0800
+Subject: [PATCH] create_version_h.sh: Add a shebang
+
+CMake runs this script directly through execute_process(). Without a
+"#!" line the kernel cannot execute it, and CMake 4.5 reports
+"exec format error" and carries on, so version.h is never created
+and the build fails with:
+
+  bcu.c:58:10: fatal error: 'version.h' file not found
+
+Add a /bin/sh shebang so the script can be run directly.
+
+Upstream-Status: Pending
+AI-Generated: Uses Claude Code
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ create_version_h.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/create_version_h.sh b/create_version_h.sh
+index e777359..0b6ed65 100755
+--- a/create_version_h.sh
++++ b/create_version_h.sh
+@@ -1,3 +1,4 @@
++#!/bin/sh
+ echo creating ${1}/version.h
+ 
+ if [ "${APPVEYOR_BUILD_VERSION}" = "" ];
diff --git a/meta-oe/recipes-support/bcu/bcu_1.2.1.bb b/meta-oe/recipes-support/bcu/bcu_1.2.1.bb
index 19ea077e90..3a1e80ece5 100644
--- a/meta-oe/recipes-support/bcu/bcu_1.2.1.bb
+++ b/meta-oe/recipes-support/bcu/bcu_1.2.1.bb
@@ -11,9 +11,12 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=884d48c2aa7b82e1ad4a33909fab24b6"
 
 SRC_URI = "git://github.com/nxp-imx/bcu;protocol=https;nobranch=1;tag=${BPN}_${PV} \
            file://0001-CMakeLists-do-not-use-vendored-libcurl.patch \
+           file://0001-create_version_h.sh-Add-a-shebang.patch \
            "
 SRCREV = "1c79dcf115bcf2c8ad632dadbc749c5e25c52cb1"
 
+UPSTREAM_CHECK_GITTAGREGEX = "^bcu_(?P<pver>\d+(\.\d+)+)$"
+
 
 DEPENDS = "curl libyaml libusb1 openssl libftdi"