diff options
author | David Runge <dvzrv@archlinux.org> | 2022-10-28 17:59:14 +0000 |
---|---|---|
committer | David Runge <dvzrv@archlinux.org> | 2022-10-28 17:59:14 +0000 |
commit | 0fd1f846d8866f67515cab87e3d1b50f0f91dacb (patch) | |
tree | 8aeb5fd80a60d29f36b932eb47e4aa4726d60acc |
Add libcamera 0.0.1 as new dependency for pipewire.
-rw-r--r-- | PKGBUILD | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..a6878a3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,112 @@ +# Maintainer: David Runge <dvzrv@archlinux.org> + +pkgbase=libcamera +pkgname=(libcamera libcamera-docs libcamera-tools gst-plugin-libcamera) +pkgver=0.0.1 +_commit=7219110a121c3904dca3bfb86da27ca5bfb57a76 # refs/tags/v0.0.1 +pkgrel=2 +pkgdesc="A complex camera support library for Linux, Android, and ChromeOS" +arch=(x86_64) +url="https://libcamera.org/" +license=(LGPL2.1 GPL2) +depends=(glibc) +makedepends=(doxygen git glib2 graphviz gst-plugins-base gtest libdrm +libjpeg-turbo libtiff libyaml meson python-jinja python-ply python-sphinx +python-pyyaml qt5-base qt5-tools sdl2 systemd texlive-core) +options=(debug) +source=(git+https://git.libcamera.org/$pkgname/$pkgname.git#tag=$_commit) +sha256sums=('SKIP') + +_pick() { + local p="$1" f d; shift + for f; do + d="$srcdir/$p/${f#$pkgdir/}" + mkdir -p "$(dirname "$d")" + mv "$f" "$d" + rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")" + done +} + +prepare() { + cd $pkgname +} + +build() { + local meson_options=( + -D v4l2=true + -D tracing=disabled + -D test=true + ) + + arch-meson $pkgname build "${meson_options[@]}" + meson compile -C build +} + +check() { + meson test -C build || echo "Tests require CLONE_NEWUSER/ CLONE_NEWNET." +} + +package_libcamera() { + meson install -C build --destdir "$pkgdir" + depends=( + gcc-libs + glibc + gnutls + libdrm + libelf + libunwind + libyaml + systemd-libs libudev.so + ) + optdepends=( + 'gst-plugin-libcamera: GStreamer plugin' + 'libcamera-docs: for documentation' + 'libcamera-tools: for applications' + ) + provides=(libcamera.so libcamera-base.so) + + ( + cd "$pkgdir" + _pick $pkgbase-docs usr/share/doc + _pick $pkgbase-tools usr/bin/{cam,qcam,lc-compliance} + _pick gst-plugin-$pkgbase usr/lib/gstreamer-* + ) +} + +package_libcamera-docs() { + pkgdesc+=" - documentation" + + mv -v $pkgname/* "$pkgdir" +} + +package_libcamera-tools() { + pkgdesc+=" - tools" + depends=( + gcc-libs + glibc + gtest + libcamera libcamera.so libcamera-base.so + libevent libevent-2.1.so libevent_pthreads-2.1.so + libjpeg-turbo libjpeg.so + libtiff libtiff.so + libyaml + qt5-base + sdl2 + ) + + mv -v $pkgname/* "$pkgdir" +} + +package_gst-plugin-libcamera() { + pkgdesc="Multimedia graph framework - libcamera plugin" + depends=( + gcc-libs + glibc + glib2 libg{lib,object}-2.0.so + gstreamer + gst-plugins-base-libs + libcamera libcamera.so libcamera-base.so + ) + + mv -v $pkgname/* "$pkgdir" +} |