summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/libcamera
diff options
context:
space:
mode:
Diffstat (limited to 'meta-multimedia/recipes-multimedia/libcamera')
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-libcamera-Do-not-assume-libc-with-clang.patch68
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera_0.7.0.bb (renamed from meta-multimedia/recipes-multimedia/libcamera/libcamera_0.6.0.bb)11
2 files changed, 7 insertions, 72 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-libcamera-Do-not-assume-libc-with-clang.patch b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-libcamera-Do-not-assume-libc-with-clang.patch
deleted file mode 100644
index 25d88cfff4..0000000000
--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-libcamera-Do-not-assume-libc-with-clang.patch
+++ /dev/null
@@ -1,68 +0,0 @@
1From 0c68347365ec4c0bd3f84e1d2f9f51eb3c2405c8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 24 Oct 2025 11:10:59 -0700
4Subject: [PATCH] libcamera: Do not assume libc++ with clang
5
6Clang on linux can be defaulting to use libstdc++, it
7should be using default platform C++ runtime library which the
8toolchain should be configured to do the right thing
9
10Add logic in meson file to detect C++ runtime used by toolchain
11and defile -stdlib= parameter accordingly
12
13Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2025-October/054151.html]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 meson.build | 32 +++++++++++++++++++++-----------
17 1 file changed, 21 insertions(+), 11 deletions(-)
18
19diff --git a/meson.build b/meson.build
20index fa6487f6..89294936 100644
21--- a/meson.build
22+++ b/meson.build
23@@ -118,7 +118,24 @@ cpp_arguments = [
24 '-Wnon-virtual-dtor',
25 ]
26
27-cxx_stdlib = 'libstdc++'
28+# Try to detect libc++
29+libcxx_ver = cxx.get_define('_LIBCPP_VERSION',
30+ prefix: '#include <vector>\n')
31+
32+# Try to detect libstdc++
33+glibcxx_ver = cxx.get_define('__GLIBCXX__',
34+ prefix: '#include <vector>\n')
35+
36+stdlib_msg = 'unknown'
37+
38+if libcxx_ver != ''
39+ cxx_stdlib = 'libc++'
40+elif glibcxx_ver != ''
41+ # __GLIBCXX__ is usually a yyyymmdd date code
42+ cxx_stdlib = 'libstdc++'
43+endif
44+
45+message('Detected C++ standard library: ' + cxx_stdlib)
46
47 if cc.get_id() == 'clang'
48 if cc.version().version_compare('<9')
49@@ -138,16 +155,9 @@ if cc.get_id() == 'clang'
50 ]
51 endif
52 endif
53-
54- # Use libc++ by default if available instead of libstdc++ when compiling
55- # with clang.
56- if cc.find_library('c++', required : false).found()
57- cpp_arguments += [
58- '-stdlib=libc++',
59- ]
60- cxx_stdlib = 'libc++'
61- endif
62-
63+ cpp_arguments += [
64+ '-stdlib=' + cxx_stdlib,
65+ ]
66 cpp_arguments += [
67 '-Wextra-semi',
68 '-Wthread-safety',
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.6.0.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.7.0.bb
index 64e8973d53..f83372df43 100644
--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.6.0.bb
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.7.0.bb
@@ -11,10 +11,9 @@ LIC_FILES_CHKSUM = "\
11 11
12SRC_URI = " \ 12SRC_URI = " \
13 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master;tag=v${PV} \ 13 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master;tag=v${PV} \
14 file://0001-libcamera-Do-not-assume-libc-with-clang.patch \
15" 14"
16 15
17SRCREV = "3c17d1fbb2bd93f221afee788ebf0d7394032e4d" 16SRCREV = "b7854fd07d42168f099b5ce30d1702e0e0875bf5"
18 17
19PE = "1" 18PE = "1"
20 19
@@ -23,10 +22,13 @@ DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native'
23 22
24PACKAGES =+ "${PN}-compliance ${PN}-gst ${PN}-pycamera" 23PACKAGES =+ "${PN}-compliance ${PN}-gst ${PN}-pycamera"
25 24
26PACKAGECONFIG ??= "" 25PACKAGECONFIG ??= " \
26 ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \
27"
27PACKAGECONFIG[dng] = ",,tiff" 28PACKAGECONFIG[dng] = ",,tiff"
28PACKAGECONFIG[compliance] = "-Dlc-compliance=enabled,-Dlc-compliance=disabled,gtest" 29PACKAGECONFIG[compliance] = "-Dlc-compliance=enabled,-Dlc-compliance=disabled,gtest"
29PACKAGECONFIG[gst] = "-Dgstreamer=enabled,-Dgstreamer=disabled,gstreamer1.0 gstreamer1.0-plugins-base" 30PACKAGECONFIG[gst] = "-Dgstreamer=enabled,-Dgstreamer=disabled,gstreamer1.0 gstreamer1.0-plugins-base"
31PACKAGECONFIG[opengl] = ",,virtual/libgl virtual/egl"
30PACKAGECONFIG[python] = "-Dpycamera=enabled,-Dpycamera=disabled,python3-pybind11" 32PACKAGECONFIG[python] = "-Dpycamera=enabled,-Dpycamera=disabled,python3-pybind11"
31PACKAGECONFIG[raspberrypi] = ",,libpisp" 33PACKAGECONFIG[raspberrypi] = ",,libpisp"
32PACKAGECONFIG[vimc] = ",," 34PACKAGECONFIG[vimc] = ",,"
@@ -46,10 +48,11 @@ LIBCAMERA_PIPELINES:aarch64 ??= "${ARM_PIPELINES}"
46 48
47EXTRA_OEMESON = " \ 49EXTRA_OEMESON = " \
48 -Dpipelines=${LIBCAMERA_PIPELINES} \ 50 -Dpipelines=${LIBCAMERA_PIPELINES} \
49 -Dv4l2=true \ 51 -Dv4l2=enabled \
50 -Dcam=enabled \ 52 -Dcam=enabled \
51 -Dtest=false \ 53 -Dtest=false \
52 -Ddocumentation=disabled \ 54 -Ddocumentation=disabled \
55 -Drpi-awb-nn=disabled \
53" 56"
54 57
55RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}" 58RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}"