summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 91d683a0dd60b3877c1dc3e1d610e92170d75a50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Maintainer: Sam L. Yes <samlukeyes123@gmail.com>

pkgname=libcamera-clang-git
pkgver=r2468.8634c386
pkgrel=1
pkgdesc='A complex camera support library for Linux, Android, and ChromeOS (built with clang)'
arch=('x86_64' 'i686')
url='https://libcamera.org/'
provides=('libcamera' 'libcamera-git')
conflicts=('libcamera' 'libcamera-git')
makedepends=(
  "meson>=0.55" "python-yaml" 'python-ply' 'python-jinja' 'pkgconf' 'gnutls' 'openssl' 'git'
  'udev'        # for device hotplug enumeration
  'gstreamer'   # for gstreamer support
  'libevent'    # for 'cam' command
  'qt5-tools'   # for 'qcam' tool
  'clang>=5.0'
)
depends=(
  'libc++'
  'gst-plugins-base-libs'   # for gstreamer support
  #'lttng-ust'              # for tracing with LTTng
)
optdepends=(
  'libevent: for cam'
  'qt5-base: for qcam' 
)
license=('LGPL' 'GPL' 'Apache' 'BSD' 'MIT' 'custom')
#options=('!buildflags')
source=('git://linuxtv.org/libcamera.git/')
md5sums=('SKIP')
_licensedir=/usr/share/licenses/${pkgname}

pkgver() {
  cd libcamera
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "${srcdir}/libcamera"
    CC=clang CXX=clang++ arch-meson build \
        -Dwerror=false \
        -Dpipelines=ipu3,rkisp1,simple,uvcvideo,vimc \
        -Ddocumentation=disabled \
        -Dtracing=disabled  # comment this line to enable LTTng support
        # --prefix /usr --libexecdir lib \
    ninja -C build
}

# If this check fails, use --nocheck to skip it

check() {
  cd ${srcdir}/libcamera
  meson test -C build
}

package() {
    cd "$srcdir/libcamera"
    DESTDIR="${pkgdir}" ninja -C build install
    rm -rf "$pkgdir/usr/share/doc/"

    # Install licenses
    install -d ${pkgdir}/${_licensedir}/LICENSES
    install -m644 COPYING.rst ${pkgdir}/${_licensedir}
    install -m644 LICENSES/{BSD-{2,3}-Clause,CC-BY-SA-4.0,CC0-1.0,MIT,Linux-syscall-note}.txt ${pkgdir}/${_licensedir}/LICENSES
}