archrelease: copy trunk to extra-x86_64
[arch-packages.git] / openal / repos / extra-x86_64 / PKGBUILD
blobdb3bca10bfb36ea8ddddba6f9a21ab6457ddee34
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Allan McRae <allan@archlinux.org>
3 # Contributor: Jason Chu <jchu@xentac.net>
5 pkgbase=openal
6 pkgname=(openal openal-examples)
7 pkgver=1.22.2
8 pkgrel=1
9 pkgdesc="Cross-platform 3D audio library, software implementation"
10 arch=(x86_64)
11 url="https://github.com/kcat/openal-soft"
12 license=(LGPL)
13 depends=(gcc-libs)
14 makedepends=(alsa-lib libpulse fluidsynth portaudio jack pipewire qt5-base sdl2
15              libsndfile ffmpeg libmysofa git cmake ninja)
16 optdepends=('qt5-base: alsoft-config GUI Configurator'
17             'fluidsynth: MIDI rendering'
18             'libmysofa: makemhr tool')
19 options=(debug)
20 _commit=dc83d99c95a42c960150ddeee06c124134b52208  # tags/1.22.2
21 source=("git+https://github.com/kcat/openal-soft#commit=$_commit")
22 b2sums=('SKIP')
24 pkgver() {
25   cd openal-soft
26   git describe --tags | sed 's/^openal-soft-//;s/[^-]*-g/r&/;s/-/+/g'
29 prepare() {
30   cd openal-soft
33 build() {
34   cmake -S openal-soft -B build -G Ninja \
35     -DCMAKE_INSTALL_PREFIX=/usr \
36     -DCMAKE_BUILD_TYPE=None \
37     -DCMAKE_INSTALL_LIBDIR=lib
38   cmake --build build
41 _pick() {
42   local p="$1" f d; shift
43   for f; do
44     d="$srcdir/$p/${f#$pkgdir/}"
45     mkdir -p "$(dirname "$d")"
46     mv "$f" "$d"
47     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
48   done
51 package_openal() {
52   provides+=(libopenal.so)
54   DESTDIR="$pkgdir" cmake --install build
55   install -Dt "$pkgdir/usr/share/doc/openal" -m644 openal-soft/docs/*
57   cd "$pkgdir"
58   _pick examples usr/bin/al{ffplay,hrtf,latency,loopback,multireverb}
59   _pick examples usr/bin/al{play,record,reverb,stream,tonegen}
62 package_openal-examples() {
63   pkgdesc+=" (example programs)"
64   depends=("openal=$pkgver-$pkgrel" sdl2 libsndfile ffmpeg)
65   optdepends=()
66   mv examples/* "$pkgdir"