1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Allan McRae <allan@archlinux.org>
3 # Contributor: Jason Chu <jchu@xentac.net>
6 pkgname=(openal openal-examples)
9 pkgdesc="Cross-platform 3D audio library, software implementation"
11 url="https://github.com/kcat/openal-soft"
14 makedepends=(alsa-lib libpulse fluidsynth portaudio jack 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 _commit=ae4eacf147e2c2340cc4e02a790df04c793ed0a9 # tags/1.21.1
20 source=("git+https://github.com/kcat/openal-soft#commit=$_commit"
23 '9a2bcc2036799d4ca9d98845b75b4ae03d9f300e4e7ddf20f7b52239e625d3b064728cd48c5dc36862ae63d0a26ecd994aa4a1594b0ff45c93d226a1fe023337')
27 git describe --tags | sed 's/^openal-soft-//;s/-/+/g'
34 git cherry-pick -n 302e88dbf0f10224a5b87be4ce43b3fdd9d20184
36 # https://bugs.archlinux.org/task/72729
37 git cherry-pick -n b7ff1de48efda9ad54e6a3b4c1526722c371e832
39 # Fix build with FFmpeg 5.0
40 git apply -3 ../ffmpeg-5.0.diff
44 cmake -S openal-soft -B build -G Ninja \
45 -DCMAKE_INSTALL_PREFIX=/usr \
46 -DCMAKE_BUILD_TYPE=None \
47 -DCMAKE_INSTALL_LIBDIR=lib
52 local p="$1" f d; shift
54 d="$srcdir/$p/${f#$pkgdir/}"
55 mkdir -p "$(dirname "$d")"
57 rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
62 provides+=(libopenal.so)
64 DESTDIR="$pkgdir" cmake --install build
65 install -Dt "$pkgdir/usr/share/doc/openal" -m644 openal-soft/docs/*
68 _pick examples usr/bin/al{ffplay,hrtf,latency,loopback,multireverb}
69 _pick examples usr/bin/al{play,record,reverb,stream,tonegen}
72 package_openal-examples() {
73 pkgdesc+=" (example programs)"
74 depends=("openal=$pkgver-$pkgrel" sdl2 libsndfile ffmpeg)
76 mv examples/* "$pkgdir"