Skip to content
35 changes: 35 additions & 0 deletions recipes-multimedia/libcamera-apps/libcamera-apps.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
SUMMARY = "Raspberry libcamera-apps"

LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://license.txt;md5=a0013d1b383d72ba4bdc5b750e7d1d77"

SRC_URI = "git://github.com/raspberrypi/libcamera-apps.git;branch=main;protocol=https"

PV = "1.0+git${SRCPV}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such version as far as I can see. I don't see any 1.0 tags in the repo. Just use git in the recipe filename.

SRCREV = "11c5203a202777ddc339bba1dd8f85b53b60c279"

S = "${WORKDIR}/git"

DEPENDS = "libcamera opencv boost libjpeg-turbo libexif tiff"
RDEPENDS:${PN} = "libcamera opencv boost libjpeg-turbo libexif tiff python3-core"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these RDEPENDS? The packaging should be able to infer them without having them explicit. Any issues with that?


inherit cmake pkgconfig

EXTRA_OECMAKE = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "-DENABLE_X11=1", "-DENABLE_X11=0", d)} \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be nicer to handle as a PACKAGECONFIG. And you enable it by default for the right DISTRO_FEATURES match.

${@bb.utils.contains("MACHINE", "raspberrypi3", "-DENABLE_COMPILE_FLAGS_FOR_TARGET=armv8-neon", "", d)} \
${@bb.utils.contains("MACHINE", "raspberrypi4", "-DENABLE_COMPILE_FLAGS_FOR_TARGET=armv8-neon", "", d)} \
"

PACKAGECONFIG[qt] = "-DENABLE_QT=1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have the explicit disable as well for all these PACKAGECONFIG entries?
eg: PACKAGECONFIG[qt] = "-DENABLE_QT=1, -DENABLE_QT=0"

PACKAGECONFIG[opencv] = "-DENABLE_OPENCV=1"
PACKAGECONFIG[tensorflow-lite] = "-DENABLE_TFLITE=1"

COMPATIBLE_MACHINE = "^rpi$"

FILES:${PN}-dev = "${includedir} ${libdir}/pkgconfig"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in by default hence not needed.

FILES:${PN} += "${libdir}/libpreview.so"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this and all the following using SOLIBS = ".so". I assume the package provides unversioned libraries only.

FILES:${PN} += "${libdir}/libencoders.so"
FILES:${PN} += "${libdir}/liboutputs.so"
FILES:${PN} += "${libdir}/libimages.so"
FILES:${PN} += "${libdir}/libpost_processing_stages.so"
FILES:${PN} += "${libdir}/libcamera_app.so"