summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a194f6a60a6f636065b7a30155f84e862c30c296 (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
67
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Fabio 'Lolix' Loli <lolix@disroot.org>
# Contributor: Nikola Hadžić <nikola@firemail.cc>
pkgname=gst-plugins-rs
pkgver=1.24.3
pkgrel=1
pkgdesc="GStreamer plugins written in Rust"
arch=('x86_64')
url="https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license=('Apache-2.0 AND LGPL-2.1-or-later AND MIT AND MPL-2.0')
depends=(
  'cairo'
#  'dav1d'  ## requires <1.3
  'gst-plugins-base-libs'
  'gst-plugins-bad-libs'
  'graphene'
  'gstreamer'
  'gtk4'
  'libwebp'
  'libsodium'
  'openssl'
  'pango'
)
makedepends=(
  'cargo'
  'cargo-c'
  'clang'
  'git'
  'hotdoc'
  'meson'
  'nasm'
  'python-tomli'
)
provides=('gst-plugin-gtk4')
conflicts=('gst-plugin-gtk4')
source=("git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git#tag=gstreamer-$pkgver")
sha256sums=('c350793466ebca167839156a30587c6a8cce29fdcbf3f33d665c57c8fb9cc2b2')

prepare() {
  cd "$pkgname"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  CFLAGS+=" -ffat-lto-objects"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  arch-meson "$pkgname" build \
    -D sodium-source='system' \
    -D dav1d='disabled'
  meson compile -C build
}

check() {
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  meson test -C build --print-errorlogs || :
}

package() {
  meson install -C build --destdir "$pkgdir"

  cd "$pkgname"
  install -Dm644 LICENSE-MIT -t "$pkgdir/usr/share/licenses/$pkgname/"
}