fp6-img/aports/temp/libcamera/APKBUILD
Jorijn van der Graaf 40ccdfeed6
Some checks failed
image / image (push) Has been cancelled
libcamera: backport contrast autofocus for the main camera (r4)
The DW9784 VCM works and libcamera discovers it through the sensor's
ancillary link, but nothing in the software ISP ever moves it. Backport
the out-of-tree autofocus work onto v0.7.2:

- 0007-0009 are Vasiliy Doylov's focus control, contrast autofocus and
  focus-loss detection from the softisp-playground branch;
- 0010 is Pavel Machek's Librem5-tested robustness work (centre-window,
  brightness-normalised sharpness, two-phase sweep, settle skip),
  squashed and adapted;
- 0011-0013 are ours: the lens write no longer sits inside the
  no-frame-start-emitter branch, the lensless-camera paths are guarded,
  and AfMode is advertised with a continuous default so that stock
  applications get autofocus without sending AfTrigger.

Provenance and the adaptations made to each patch are recorded in the
patch commit messages.
2026-08-17 02:02:45 +02:00

209 lines
7.7 KiB
Text

# Forked from Alpine for temporary downstream patches
maintainer="Robert Mader <robert.mader@collabora.com>"
pkgname=libcamera
_pkgver=0.7.2
pkgver=9999$_pkgver
pkgrel=4
pkgdesc="Linux camera framework"
url="https://libcamera.org/"
arch="all"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
# upstream calls 'date' with a non-POSIX option so we pull in coreutils
makedepends="
coreutils
doxygen
eudev-dev
glib-dev
gnutls-dev
graphviz
gst-plugins-base-dev
gtest-dev
libevent-dev
libpisp-dev
libunwind-dev
libyuv-dev
linux-headers
meson
py3-jinja2
py3-ply
py3-pybind11-dev
py3-sphinx
py3-sphinxcontrib-doxylink
py3-yaml
python3-dev
qt6-qtbase-dev
qt6-qttools-dev
yaml-dev
"
subpackages="
$pkgname-dbg
$pkgname-dev
qcam
$pkgname-gstreamer
$pkgname-v4l2
$pkgname-tools
py3-$pkgname-pyc:pyc
py3-$pkgname:py3
"
_tuning_files="
hi846.yaml
imx355.yaml
imx363.yaml
imx371.yaml
imx376.yaml
imx519.yaml
imx858.yaml
s5k3l6xx.yaml
s5kjn1.yaml
"
source="https://gitlab.freedesktop.org/camera/libcamera/-/archive/v$_pkgver/libcamera-v$_pkgver.tar.gz
0001-libcamera-simple-Enable-softISP-for-the-Pinephone.patch
0002-libcamera-simple-Skip-hwISP-formats-if-swISP-is-acti.patch
0003-libipa-Add-OV13B10-camera-sensor-helper.patch
0004-libcamera-sensor-Add-OV13B10-sensor-properties.patch
0005-libipa-Add-camera-sensor-helper-for-IMX896.patch
0006-libcamera-sensor-Add-IMX896-sensor-properties.patch
0007-libcamera-software_isp-Add-focus-control.patch
0008-libcamera-software_isp-Add-autofocus.patch
0009-AF-detect-focus-loss.patch
0010-af-two-phase-sweep-over-a-brightness-normalised-cent.patch
0011-libcamera-pipeline-simple-Apply-the-lens-position-un.patch
0012-libcamera-software_isp-af-Harden-the-lens-control-ha.patch
0013-libcamera-software_isp-af-Add-AfMode-and-focus-witho.patch
qcam.desktop
$_tuning_files
"
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 \
-Dpipelines=auto,virtual \
-Dv4l2=true \
-Dwerror=false \
-Ddocumentation=disabled \
. 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
amove usr/share/libcamera/ipa
for _tuning_file in $_tuning_files; do
install -Dm644 -t "$subpkgdir"/usr/share/libcamera/ipa/simple \
"$srcdir"/"$_tuning_file"
done
# then sign ipa's
local ipa
for ipa in "$subpkgdir"/usr/lib/libcamera/ipa/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
}
py3() {
pkgdesc="$pkgname (python bindings)"
depends="python3"
amove usr/lib/python*
}
sha512sums="
b317cdc96f61682ee0bf26dfb7c4d6441db9a9c5b93ab53528121a8cd44862b3d59cbaa3881bb0837e3e381564c184c7b742124aef4267eea754c6083de353c1 libcamera-v0.7.2.tar.gz
eef5e38efc874f2049d17f08b04d9f21c3e4616f66873358cd2c446e651f78d6952ae25ee13a6ef917e3f85bc7b6a6991152e42c8efd8c7f5bff69829a518826 0001-libcamera-simple-Enable-softISP-for-the-Pinephone.patch
191dfa09cfd08bcdf0d0d07410d17af590cf78b8bc8f8b7587fd2dc1c645a9ca07f2926b5d98381c011319b1f4e1d6195dd0d6dba65fd8c723882e6be0d6117d 0002-libcamera-simple-Skip-hwISP-formats-if-swISP-is-acti.patch
594e2c31bd51dac8f5f184b026301028431b1c67e48edb245790444713b64e927fac99cb8a33f0b7042c9689359079158b3f1d344b250904472c977f1313f83e 0003-libipa-Add-OV13B10-camera-sensor-helper.patch
89e0fc4a12aa4d5fbdc77b50e28b0a6d2cf8dfeb884b536507b6c24aa2ae5c616a32a517deb086e3284c72a82e6d6ddcf6eaa88f6c1c021adc6a0167194b7711 0004-libcamera-sensor-Add-OV13B10-sensor-properties.patch
f746cff46f78a8e7bd4cadd72c4ab05044971e36e412a56d4a14a420aeb1c9168b1f4ef411f4cc81a596159cab3d8a3713214a4ff0b2a4daf839b1a380c09b6e 0005-libipa-Add-camera-sensor-helper-for-IMX896.patch
1ac9747c941787c7ae76ed6520585b0d26494eb0f697bd74a9155ed04736a7b61f838dfb1bad01cf13b9cdd36f644a95a6ec1cbfe4f5c5a42cb23d4b6d9aa166 0006-libcamera-sensor-Add-IMX896-sensor-properties.patch
09fcc064f5263fbf5f759d74a798ac0a667af1b24729b7e3e7ff9806b7e4156fb68812f495454563e9a96d38d0f383f5b341adfadf31ebb3a54067bffdc2de74 0007-libcamera-software_isp-Add-focus-control.patch
4d4ed6462c6ba334fc0c568d93a15f0a4afc330d5e548c14eb2846855e6a08c5fb2627a1eb24f323f9c1861f22b57315d2d29e9c5875fe926d65658ebc53d1db 0008-libcamera-software_isp-Add-autofocus.patch
3797467e1a6a3370549fc3516ecbc41e02e01f347173146c569d7ba1ca239c5273316a532ba205550ce99ae2a4fd5e8a32aa5f021237096093319138694fea7f 0009-AF-detect-focus-loss.patch
c8ddc64ab943d9b215f4c997f2629e4403744c0ddb5de88cd42d384506a27c0762191eddd4d13559e7cc15e1a4d4542a55e5de985c7ea98f938ce796b43cc9e2 0010-af-two-phase-sweep-over-a-brightness-normalised-cent.patch
3965405be757917030c89db5da60aa226d0f0591e213d055d8312dbddee0c3d81fbcaa5928d6de4d3cb636572a27261d8686d87ae39b9634d70b33cf8388dc73 0011-libcamera-pipeline-simple-Apply-the-lens-position-un.patch
8734e27966bd1bc5a4b0324a3d8a3ee4ab371f6d1536500b2bb44d49bde874c3fd6f244312332226c352e4716ba12fb72bf51e64b9e97cf6fa646aa6dfef3277 0012-libcamera-software_isp-af-Harden-the-lens-control-ha.patch
dce81c2863ff6b9374115325f4af14ac5d396a6e2aee12f87d55a47d1d0bda860ae2af5a9d6885b126e20a12b7f3f40e49a2b9d738f94c04177bff6149da64e1 0013-libcamera-software_isp-af-Add-AfMode-and-focus-witho.patch
22167a4eceb6d1b40b0b7c45fdf116c71684f5340de7f767535cb8e160ad9d2ae0f00cb3d461f73a344520a48a4641cf46226841d78bee06bfbfd2a91337f754 qcam.desktop
2ee566653b17d565d2c0de67cbe6ebad25df5aac6051cad78e6bae52016fa2ca0247e964d735ac776b3e0bd447ead9c4fcb26cd7629228cdba3ceb91b46f378f hi846.yaml
55dab9dcb9b1982143b9d63e4e51138c5bffd7c8f4a8e4e122750b3ad9d475446956bc297d9f564819ade4be75a575d06633a064e14f8ba3ef77986783c5f067 imx355.yaml
285c6d0d712df341c0117c3762ddc139f53f44e6be36c3388d1a62696429175e2916f392163131e21f410c3676f02f5d125f375171f45f8d82ad278aa5076c62 imx363.yaml
2ee566653b17d565d2c0de67cbe6ebad25df5aac6051cad78e6bae52016fa2ca0247e964d735ac776b3e0bd447ead9c4fcb26cd7629228cdba3ceb91b46f378f imx371.yaml
55dab9dcb9b1982143b9d63e4e51138c5bffd7c8f4a8e4e122750b3ad9d475446956bc297d9f564819ade4be75a575d06633a064e14f8ba3ef77986783c5f067 imx376.yaml
2ee566653b17d565d2c0de67cbe6ebad25df5aac6051cad78e6bae52016fa2ca0247e964d735ac776b3e0bd447ead9c4fcb26cd7629228cdba3ceb91b46f378f imx519.yaml
55dab9dcb9b1982143b9d63e4e51138c5bffd7c8f4a8e4e122750b3ad9d475446956bc297d9f564819ade4be75a575d06633a064e14f8ba3ef77986783c5f067 imx858.yaml
2ee566653b17d565d2c0de67cbe6ebad25df5aac6051cad78e6bae52016fa2ca0247e964d735ac776b3e0bd447ead9c4fcb26cd7629228cdba3ceb91b46f378f s5k3l6xx.yaml
d59020e62520ee622282c85ce7bcdfe453c99becf48cc1005c5f8a4bb8b2511b19c89f38fb3c994e7c6a79d1f84e2ed5f5a09b4c5bdc1dc4a44b071dbccf0d44 s5kjn1.yaml
"