archrelease: copy trunk to extra-x86_64
[arch-packages.git] / openal / trunk / PKGBUILD
blob15d7ede9371f0c6814a2d6f943239df6e966a611
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.21.1
8 pkgrel=3
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 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"
21         ffmpeg-5.0.diff)
22 sha512sums=('SKIP'
23             '9a2bcc2036799d4ca9d98845b75b4ae03d9f300e4e7ddf20f7b52239e625d3b064728cd48c5dc36862ae63d0a26ecd994aa4a1594b0ff45c93d226a1fe023337')
25 pkgver() {
26   cd openal-soft
27   git describe --tags | sed 's/^openal-soft-//;s/-/+/g'
30 prepare() {
31   cd openal-soft
33   # Missing include
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
43 build() {
44   cmake -S openal-soft -B build -G Ninja \
45     -DCMAKE_INSTALL_PREFIX=/usr \
46     -DCMAKE_BUILD_TYPE=None \
47     -DCMAKE_INSTALL_LIBDIR=lib
48   cmake --build build
51 _pick() {
52   local p="$1" f d; shift
53   for f; do
54     d="$srcdir/$p/${f#$pkgdir/}"
55     mkdir -p "$(dirname "$d")"
56     mv "$f" "$d"
57     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
58   done
61 package_openal() {
62   provides+=(libopenal.so)
64   DESTDIR="$pkgdir" cmake --install build
65   install -Dt "$pkgdir/usr/share/doc/openal" -m644 openal-soft/docs/*
67   cd "$pkgdir"
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)
75   optdepends=()
76   mv examples/* "$pkgdir"