Files
pmaports-rtwo/temp/libcamera/APKBUILD
T
Robert Mader cd6ef6e873 temp/libcamera: Enable virtual pipeline
Analog to a recent change in Fedora:
https://src.fedoraproject.org/rpms/libcamera/pull-request/14

This change allows to easily create virtual cameras, which is helpful
for testing and debugging purposes, both for system components like Mesa
and Pipewire as well as various apps.

The virtual cameras can be enabled by:
```
cd /usr/share/libcamera/pipeline/virtual
cp virtual.yaml.example virtual.yaml
systemctl --user restart pipewire
```

Using the test option allows to keep the arch dependent automatic pipeline
selection in place. It also enables building of the vimc pipeline -
which is very small - and all tests, however those don't get included
into the packages.

The new dependency, libyuv, is very small and already installed by
default for DEs like gnome-mobile.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6567
[ci:skip-build]: already built successfully in CI
2025-05-29 21:33:29 +02:00

170 lines
5.6 KiB
Bash

# Forked from Alpine for temporary downstream patches
pkgname=libcamera
_pkgver=0.5.0
pkgver=9999$_pkgver
pkgrel=1
pkgdesc="Linux camera framework"
url="https://libcamera.org/"
arch="all"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
depends_dev="
eudev-dev
glib-dev
gnutls-dev
gst-plugins-bad-dev
qt6-qtbase-dev
"
# upstream calls 'date' with a non-POSIX option so we pull in coreutils
makedepends="$depends_dev
coreutils
doxygen
graphviz
gtest-dev
libevent-dev
libpisp-dev
libunwind-dev
libyuv-dev
linux-headers
meson
py3-jinja2
py3-ply
py3-sphinx
py3-yaml
qt6-qttools-dev
yaml-dev
"
subpackages="
$pkgname-dbg
$pkgname-dev
$pkgname-doc
qcam
$pkgname-gstreamer
$pkgname-v4l2
$pkgname-tools
"
source="https://gitlab.freedesktop.org/camera/libcamera/-/archive/v$_pkgver/libcamera-v$_pkgver.tar.gz
0001-libcamera-simple-Enable-softwareISP-for-the-librem5.patch
0002-libcamera-simple-Force-disable-softwareISP-for-milli.patch
0003-libcamera-simple-Enable-softISP-for-the-Pinephone.patch
0004-libcamera-simple-Skip-hwISP-formats-if-swISP-is-acti.patch
0005-pipeline-simple-Consider-output-sizes-when-choosing-.patch
0006-pipeline-simple-Increase-internal-buffer-count-to-fo.patch
0007-ipa-simple-Add-tuning-file-for-IMX355.patch
0008-ipa-simple-Add-tuning-file-for-IMX363.patch
0009-ipa-simple-Add-tuning-file-for-s5k3l6xx.patch
0010-ipa-simple-Add-tuning-file-for-hi846.patch
0011-ipa-simple-Add-tuning-file-for-IMX371.patch
0012-ipa-simple-Add-tuning-file-for-IMX376.patch
qcam.desktop
"
builddir="$srcdir/$pkgname-v$_pkgver"
# gstreamer tests fail
# manual strip because ipa .sign files depend on the file contents- have to re-sign after strip
options="!strip !check"
case "$CARCH" in
arm*|aarch64)
subpackages="$subpackages $pkgname-raspberrypi"
;;
esac
case "$CARCH" in
ppc64le|s390x|riscv64|loongarch64)
# doesn't install any ipa
;;
*)
depends="$pkgname-ipa=$pkgver-r$pkgrel"
subpackages="$subpackages $pkgname-ipa"
;;
esac
build() {
abuild-meson \
-Dtest=true \
-Dv4l2=true \
-Dwerror=false \
. output
meson compile -C output
}
check() {
meson test -C output --print-errorlogs
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
install -Dm644 -t "$pkgdir"/usr/share/applications "$srcdir"/qcam.desktop
# manual strip first..
scanelf --recursive \
--nobanner \
--etype "ET_DYN,ET_EXEC" \
--format "%F" \
"$pkgdir" \
| while read -r file; do
strip "$file"
done
}
ipa() {
depends=""
amove usr/lib/libcamera
# then sign ipa's
local ipa
for ipa in "$subpkgdir"/usr/lib/libcamera/ipa*.so; do
msg "signing $ipa"
"$builddir"/src/ipa/ipa-sign.sh \
"$(find "$builddir"/output -type f -iname "*ipa-priv-key.pem")" \
"$ipa" \
"$ipa".sign
done
}
qcam() {
depends=""
amove usr/bin/qcam
amove usr/share/applications/qcam.desktop
}
gstreamer() {
depends=""
amove usr/lib/gstreamer-1.0
}
v4l2() {
depends=""
amove usr/libexec/libcamera/v4l2-compat.so
}
raspberrypi() {
depends=""
amove usr/share/libcamera/ipa/rpi
amove usr/libexec/libcamera/raspberrypi_ipa_proxy
amove usr/share/libcamera/pipeline/rpi/vc4
}
tools() {
depends=""
amove usr/bin/cam
amove usr/bin/lc-compliance
}
sha512sums="
afc196cc693ba9fedd352f3a31dbe0f4dd1c28f50e7d5198d0c87fd0b8920eb497f51facd80960a96204c1e2803f8bf15ceadca7a7aa2d1aa38e51171befcc21 libcamera-v0.5.0.tar.gz
0a93293b141f47ea9296f87bcd596e3625f4d609ea4c6c8f0381ef30230f5ded0f92d3bb7ec18406cca4b7c437a44628375d8d65b4761d78ddf3c5245e166467 0001-libcamera-simple-Enable-softwareISP-for-the-librem5.patch
e024d325ec088b89b22033e10090b6a9c895e212660f5c71c774d2833a1873bf8594285aaf7ce3277cc51bf03a7493be29b657d1e7c9a299c864be9b64933d0b 0002-libcamera-simple-Force-disable-softwareISP-for-milli.patch
add6bd7e641dc085921133bba7302740b1cf71c18a26f13e2c2c7bbbfb830cdee92e7e4603141cd720bac4e49d9b04874f262d36a764e79d4e2f4f38c3b6ec92 0003-libcamera-simple-Enable-softISP-for-the-Pinephone.patch
37aa7c96c04267240171f5a137baa9d41993428b1adead068cc7c7a3ed693824447a7cfa9aa2b6b591aa60b302a47e89499fed46f99ee2128c2d6e0540b52f8f 0004-libcamera-simple-Skip-hwISP-formats-if-swISP-is-acti.patch
3728068b572793db6342e105f6745d3a042818502883f10f44d2f2741498ec0bd431608c531f9e515b62adaa1f50d6354829d64ef31121b71774f3095b36d63f 0005-pipeline-simple-Consider-output-sizes-when-choosing-.patch
8d517419183e63b689422ba04bc4d5f6f59c7a05db67ff2548e7195169891f876bda7f15e5274765e0730f62abd3a1ab278fad27ff7669683e8e40164d2a5788 0006-pipeline-simple-Increase-internal-buffer-count-to-fo.patch
4242a4c4934edcb14a7c23020be3c5ea9596f241eb4c44910388489113102931d6d36c1ba9a3eb4676c0981b641e227087709eda3bf831b3b127add35b87fdd6 0007-ipa-simple-Add-tuning-file-for-IMX355.patch
a803793ed16eca2563bbbae84713dab6a5f3090ae6ae5f755393c0b2203bf4471f4f37b6fc69991894ced60a8607d671262a51a49f02730931e43c6a4a3e9635 0008-ipa-simple-Add-tuning-file-for-IMX363.patch
374366eeb471f2034319caa02df182d363187e4f1a0a8ec1dedfe39b3765cc19602c62df7881b99005b004395314e3f737c67a494d44a305e4afb2d0f0085115 0009-ipa-simple-Add-tuning-file-for-s5k3l6xx.patch
6ac1989989fbc7d560948d66f59f62a4f28c8b398398d204cf4323c5db5f1eb45d5caa0f287f4f95956a1346e1346d5e1cf2d3577d46c2588b38a15bdcdb3b76 0010-ipa-simple-Add-tuning-file-for-hi846.patch
7bdc0d5f8904d827ad62e16f4ea5d8bf72262bbbf3260634d59884060b4b8592262fc443bd380383bbf4f1eeb4f9da1bcd7080f04a964cc008ad570bedca81c4 0011-ipa-simple-Add-tuning-file-for-IMX371.patch
0e51325a3216dea7fabdcd329b03d2c6493f3e2665e2937e48d94e3fe28d8d01f3077417e8bf08748259aa07b7550eaa484811d17e08edf1817c5bc5c673baf5 0012-ipa-simple-Add-tuning-file-for-IMX376.patch
22167a4eceb6d1b40b0b7c45fdf116c71684f5340de7f767535cb8e160ad9d2ae0f00cb3d461f73a344520a48a4641cf46226841d78bee06bfbfd2a91337f754 qcam.desktop
"