summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: de9e4c594213e7a479b7617a3fb61749f90c40c8 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=v4l-utils-git
pkgver=1.28.1.r52.g363495b6
pkgrel=2
pkgdesc="Userspace tools and conversion library for Video 4 Linux"
arch=('i686' 'x86_64')
url="https://linuxtv.org/"
license=('GPL-2.0-or-later' 'LGPL-2.1-or-later')
depends=('gcc-libs' 'hicolor-icon-theme' 'json-c' 'libjpeg-turbo' 'systemd-libs')
makedepends=('git' 'alsa-lib' 'clang' 'doxygen' 'libbpf' 'meson' 'qt6-base' 'qt6-5compat')
optdepends=('alsa-lib: for qv4l2'
            'libbpf: for ir-keytable'
            'qt6-base: for qv4l2 and qvidcap'
            'qt6-5compat: for qv4l2 and qvidcap')
provides=("v4l-utils=$pkgver" 'edid-decode')
conflicts=('v4l-utils' 'edid-decode')
backup=('etc/rc_maps.cfg')
options=('staticlibs')
source=("git+https://git.linuxtv.org/v4l-utils.git")
sha256sums=('SKIP')


prepare() {
  cd "v4l-utils"

  sed -i 's/sbin/bin/' "utils/v4l2-dbg/meson.build"
}

pkgver() {
  cd "v4l-utils"

  _tag=$(git tag -l --sort -v:refname | sed '/rc[0-9]*/d' | head -n1)
  _rev=$(git rev-list --count $_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v4l-utils-//'
}

build() {
  cd "v4l-utils"

  CFLAGS="$CFLAGS -ffat-lto-objects" \
  CXXFLAGS="$CXXFLAGS -ffat-lto-objects" \
  meson setup \
    --buildtype=plain \
    --prefix="/usr" \
    --sbindir="bin" \
    -Db_pie="true" \
    -Ddefault_library="both" \
    -Dgconv="disabled" \
    "_build"
  meson compile -C "_build"
}

check() {
  cd "v4l-utils"

  #meson test -C "_build"
}

package() {
  cd "v4l-utils"

  meson install -C "_build" --destdir "$pkgdir"
}