# Template file for 'libcamera'
pkgname=libcamera
version=0.7.1
revision=2
build_style=meson
configure_args="-Dgstreamer=enabled -Dwerror=false -Dv4l2=enabled"
hostmakedepends="pkg-config python3-yaml python3-ply python3-Jinja2"
makedepends="openssl-devel libevent-devel gst-plugins-base1-devel gstreamer1-devel libyaml-devel"
short_desc="Complex camera support library for Linux, Android, and ChromeOS"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
homepage="https://libcamera.org/"
changelog="https://gitlab.freedesktop.org/camera/libcamera/-/releases"
distfiles="https://gitlab.freedesktop.org/camera/libcamera/-/archive/v${version}/libcamera-v${version}.tar.gz"
checksum=0904342980cb228a7f930ddee813de9f6196bca38a15670e0fb6072a0d143f1d

case "$XBPS_TARGET_MACHINE" in
	# PiSP is supported on aarch64 and armv*l for Raspberry Pi
	aarch64*|armv*) makedepends+=" libpisp-devel" ;;
esac

libcamera-devel_package() {
	depends="libcamera-${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
