Skip to content

Commit 59260e4

Browse files
author
Gijs Peskens
committed
libcamera: use RPI sources
These contain changes not yet in libcamera upstream supporting rpi/pisp, required for RPi5/CM5 camera support. Signed-off-by: Gijs Peskens <gijs.peskens@munisense.com>
1 parent 7cea76c commit 59260e4

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

dynamic-layers/multimedia-layer/recipes-multimedia/libcamera/libcamera_%.bbappend

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
SUMMARY = "Linux libcamera framework"
2+
SECTION = "libs"
3+
4+
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
5+
6+
LIC_FILES_CHKSUM = "\
7+
file://LICENSES/GPL-2.0-or-later.txt;md5=fed54355545ffd980b814dab4a3b312c \
8+
file://LICENSES/LGPL-2.1-or-later.txt;md5=2a4f4fd2128ea2f65047ee63fbca9f68 \
9+
"
10+
11+
SRC_URI = " git://github.com/raspberrypi/libcamera.git;protocol=https;branch=main"
12+
13+
SRCREV = "29156679717bec7cc4784aeba3548807f2c27fca"
14+
15+
PE = "1"
16+
17+
S = "${WORKDIR}/git"
18+
19+
DEPENDS = "python3-pyyaml-native python3-jinja2-native python3-ply-native python3-jinja2-native udev gnutls chrpath-native libevent libyaml"
20+
DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}"
21+
22+
PACKAGES =+ "${PN}-gst ${PN}-pycamera"
23+
24+
PACKAGECONFIG ??= "raspberrypi"
25+
PACKAGECONFIG[gst] = "-Dgstreamer=enabled,-Dgstreamer=disabled,gstreamer1.0 gstreamer1.0-plugins-base"
26+
PACKAGECONFIG[pycamera] = "-Dpycamera=enabled,-Dpycamera=disabled,python3 python3-pybind11"
27+
28+
RPI_CONF_STR = "-Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp"
29+
30+
PACKAGECONFIG[raspberrypi] = "${RPI_CONF_STR},, libpisp"
31+
32+
LIBCAMERA_PIPELINES ??= "auto"
33+
34+
EXTRA_OEMESON = " \
35+
-Dpipelines=${LIBCAMERA_PIPELINES} \
36+
-Dv4l2=true \
37+
-Dcam=enabled \
38+
-Dlc-compliance=disabled \
39+
-Dtest=false \
40+
-Ddocumentation=disabled \
41+
"
42+
43+
RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}"
44+
45+
inherit meson pkgconfig python3native
46+
47+
do_configure:prepend() {
48+
}
49+
50+
do_install:append() {
51+
chrpath -d ${D}${libdir}/libcamera.so
52+
chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so
53+
}
54+
55+
do_package:append() {
56+
bb.build.exec_func("do_package_recalculate_ipa_signatures", d)
57+
}
58+
59+
do_package_recalculate_ipa_signatures() {
60+
local modules
61+
for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do
62+
module="${module%.sign}"
63+
if [ -f "${module}" ] ; then
64+
modules="${modules} ${module}"
65+
fi
66+
done
67+
68+
${S}/src/ipa/ipa-sign-install.sh ${B}/src/ipa-priv-key.pem "${modules}"
69+
}
70+
71+
FILES:${PN} += " ${libexecdir}/libcamera/v4l2-compat.so"
72+
FILES:${PN}-gst = "${libdir}/gstreamer-1.0"
73+
FILES:${PN}-pycamera = "${PYTHON_SITEPACKAGES_DIR}/libcamera"
74+
75+
# libcamera-v4l2 explicitly sets _FILE_OFFSET_BITS=32 to get access to
76+
# both 32 and 64 bit file APIs.
77+
GLIBC_64BIT_TIME_FLAGS = ""
78+
79+
CXXFLAGS:append:rpi = " -Wno-stringop-truncation "

0 commit comments

Comments
 (0)