summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 581713a311730a0a7cd7075996534297a526eb09 (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
# Maintainer: Andrew Whatson <whatson@gmail.com>

_pkgbase=faudio
_pkgname=lib32-${_pkgbase}
_gitname=FAudio
pkgname=${_pkgname}-git
pkgver=r1121.3dd4e04
pkgrel=1
pkgdesc="Accuracy-focused XAudio reimplementation for open platforms"
arch=('x86_64')
url='https://github.com/FNA-XNA/FAudio'
license=('custom')
provides=("${_pkgname}")
depends=("${_pkgbase}" 'lib32-sdl2' 'lib32-ffmpeg')
makedepends=('git' 'cmake')
source=('git+https://github.com/FNA-XNA/FAudio'
        'faudio.pc'
        'force-lib32-sdl2.patch')
sha256sums=('SKIP'
            '371d1dfdfa335a354f41376807848ba0cc448890d6da60d0b5c9478033b7e54c'
            '14762bf049e8de0675d297e174a6b4c31de65d543e738a1c400747aa155d57ae')

pkgver() {
  cd "$srcdir/${_gitname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "$srcdir/${_gitname}"

  patch -p1 -i ../force-lib32-sdl2.patch

  mkdir -p build
  cd build

  export CFLAGS="${CFLAGS} -m32"

  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="${pkgdir}/usr" \
    -DCMAKE_INSTALL_LIBDIR=lib32 \
    -DCMAKE_INSTALL_INCLUDEDIR=include/FAudio \
    -DFFMPEG=ON \
    -DFFmpeg_LIBRARY_DIRS=/usr/lib32

  make
}

package() {
  cd "$srcdir/${_gitname}/build"

  make install

  rm -r "${pkgdir}/usr/include"

  mkdir -p "${pkgdir}/usr/share/licenses"
  ln -s "${_pkgbase}" "${pkgdir}/usr/share/licenses/${_pkgname}"

  install -D -m644 -t "${pkgdir}/usr/lib32/pkgconfig" ../../faudio.pc
}