pmaports/temp/libcamera/APKBUILD
Robert Mader 73688a3fdb
temp/libcamera: Apply s5kjn1 CCM tuning to imx376 as well
It's far from perfect but better than the default. Most importantly it
gives users of the OP6 - one of the most popular devices - an impression of
where libcamera development is heading - and an incentive to help/play
around with tuning.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8992>
2026-07-10 14:58:08 +02:00

187 lines
5.1 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=1
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
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
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
"