summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6847fbe12bb60a2db01a44777e55e80ec2e3d873 (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
# Maintainer: Huang-Huang Bao <eh5@sokka.cn>

_pkgbase=pw-capture
pkgname=${_pkgbase}-git
pkgver=r35.a2842f1
pkgrel=1
pkgdesc="Vulkan/OpenGL (game) capture for PipeWire"
url="https://github.com/EHfive/${_pkgbase}"
license=('Apache-2.0 OR MIT')
arch=(x86_64)
makedepends=(git meson rust clang libpipewire libffi)
depends=(libpipewire-0.3.so pipewire libffi.so)
provides=(pw-capture)
optdepends=(
  'lib32-pw-capture: Capture 32-bit graphics applications'
  'vulkan-icd-loader'
  'libglvnd'
)
source=(
  "git+https://github.com/EHfive/${_pkgbase}.git"
)
sha256sums=('SKIP')
options=(!debug)

pkgver() {
  cd $_pkgbase
  (
    set -o pipefail
    git describe --long --abbrev=7 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}

prepare() {
  # make AUR helper happy
  rm -rf builddir || true

  cd $_pkgbase

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_HOME=../builddir/cargo-home
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  export RUSTUP_TOOLCHAIN=stable
  arch-meson $_pkgbase builddir \
    -D profile=release \
    -D frozen=true \
    -D "target=$(rustc -vV | sed -n 's/host: //p')"

  meson install -C builddir --destdir "$srcdir/destdir"
}

package() {
  cp -r destdir/. "$pkgdir"

  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 "${_pkgbase}/LICENSE-MIT"
}