blob: b96e69eeb417dddf8a78f8d259214f9c3e263eb2 [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001SUMMARY = "Linux libcamera framework"
2SECTION = "libs"
3
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
Brad Bishope42b3e32020-01-15 22:08:42 -05005
6LIC_FILES_CHKSUM = "\
Andrew Geisslerc87764f2020-06-27 00:16:32 -05007 file://LICENSES/GPL-2.0-or-later.txt;md5=fed54355545ffd980b814dab4a3b312c \
8 file://LICENSES/LGPL-2.1-or-later.txt;md5=2a4f4fd2128ea2f65047ee63fbca9f68 \
Brad Bishope42b3e32020-01-15 22:08:42 -05009"
10
Patrick Williams8e7b46e2023-05-01 14:19:06 -050011SRC_URI = " \
12 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \
Patrick Williams73bd93f2024-02-20 08:07:48 -060013 file://0001-media_device-Add-bool-return-type-to-unlock.patch \
14 file://0002-options-Replace-use-of-VLAs-in-C.patch \
Patrick Williams39653562024-03-01 08:54:02 -060015 file://0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch \
Patrick Williams8e7b46e2023-05-01 14:19:06 -050016"
Brad Bishope42b3e32020-01-15 22:08:42 -050017
Patrick Williams73bd93f2024-02-20 08:07:48 -060018SRCREV = "89227a428a82e724548399d35c98ea89566f9045"
Brad Bishope42b3e32020-01-15 22:08:42 -050019
Patrick Williams2390b1b2022-11-03 13:47:49 -050020PE = "1"
Brad Bishope42b3e32020-01-15 22:08:42 -050021
22S = "${WORKDIR}/git"
23
Patrick Williams2194f502022-10-16 14:26:09 -050024DEPENDS = "python3-pyyaml-native python3-jinja2-native python3-ply-native python3-jinja2-native udev gnutls chrpath-native libevent libyaml"
Brad Bishope42b3e32020-01-15 22:08:42 -050025DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'qt', 'qtbase qtbase-native', '', d)}"
26
Andrew Geisslerd688a012020-09-18 13:36:00 -050027PACKAGES =+ "${PN}-gst"
28
29PACKAGECONFIG ??= ""
30PACKAGECONFIG[gst] = "-Dgstreamer=enabled,-Dgstreamer=disabled,gstreamer1.0 gstreamer1.0-plugins-base"
31
Patrick Williamse760df82023-05-26 11:10:49 -050032LIBCAMERA_PIPELINES ??= "auto"
33
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000034EXTRA_OEMESON = " \
Patrick Williamse760df82023-05-26 11:10:49 -050035 -Dpipelines=${LIBCAMERA_PIPELINES} \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000036 -Dv4l2=true \
37 -Dcam=enabled \
38 -Dlc-compliance=disabled \
39 -Dtest=false \
40 -Ddocumentation=disabled \
41"
42
Patrick Williams213cb262021-08-07 19:21:33 -050043RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland qt', 'qtwayland', '', d)}"
Brad Bishope42b3e32020-01-15 22:08:42 -050044
45inherit meson pkgconfig python3native
46
Patrick Williams213cb262021-08-07 19:21:33 -050047do_configure:prepend() {
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070048 sed -i -e 's|py_compile=True,||' ${S}/utils/ipc/mojo/public/tools/mojom/mojom/generate/template_expander.py
49}
50
Patrick Williams213cb262021-08-07 19:21:33 -050051do_install:append() {
Patrick Williams2390b1b2022-11-03 13:47:49 -050052 chrpath -d ${D}${libdir}/libcamera.so
Patrick Williams2a254922023-08-11 09:48:11 -050053 chrpath -d ${D}${libexecdir}/libcamera/v4l2-compat.so
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050054}
55
Andrew Geissler20137392023-10-12 04:59:14 -060056do_package:append() {
57 bb.build.exec_func("do_package_recalculate_ipa_signatures", d)
58}
59
60do_package_recalculate_ipa_signatures() {
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050061 local modules
62 for module in $(find ${PKGD}/usr/lib/libcamera -name "*.so.sign"); do
63 module="${module%.sign}"
64 if [ -f "${module}" ] ; then
65 modules="${modules} ${module}"
66 fi
67 done
68
69 ${S}/src/ipa/ipa-sign-install.sh ${B}/src/ipa-priv-key.pem "${modules}"
70}
71
Patrick Williams2a254922023-08-11 09:48:11 -050072FILES:${PN} += " ${libexecdir}/libcamera/v4l2-compat.so"
Patrick Williams2390b1b2022-11-03 13:47:49 -050073FILES:${PN}-gst = "${libdir}/gstreamer-1.0"
Andrew Geissler517393d2023-01-13 08:55:19 -060074
75# libcamera-v4l2 explicitly sets _FILE_OFFSET_BITS=32 to get access to
76# both 32 and 64 bit file APIs.
77GLIBC_64BIT_TIME_FLAGS = ""