summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a96b3374e88f8ba9be28fa4adbdc47d6181108f (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Darwin Bautista <djclue917@gmail.com>
# Contributor: Bob Finch <w9ya@qrparci.net>

_android_arch=aarch64

pkgname=android-${_android_arch}-portaudio
pkgver=19.7.0
pkgrel=2
arch=('any')
pkgdesc="A free, cross-platform, open source, audio I/O library. (Android ${_android_arch})"
url="https://github.com/portaudio/portaudio/"
license=('MIT')
depends=('android-ndk')
makedepends=('android-cmake'
             "android-${_android_arch}-alsa-lib")
options=(!strip !buildflags staticlibs !emptydirs)
source=("$url/archive/v$pkgver/portaudio-v$pkgver.tar.gz")
md5sums=('49ecd6de2350b3a1466116538f7be0e7')

prepare() {
    cd "${srcdir}/portaudio-$pkgver"
    source android-env ${_android_arch}

    (
        cd bindings/cpp
        autoreconf -fiv
    )

    autoreconf -fiv

    sed -i 's|"-lpthread |"|g' configure
    sed -i 's| -lpthread"|"|g' configure
    sed -i 's| -lpthread"|"|g' bindings/cpp/build/gnu/configure
    sed -i 's| -lpthread"|"|g' CMakeLists.txt
}

build() {
    cd "${srcdir}/portaudio-$pkgver"
    source android-env ${_android_arch}

    android-${_android_arch}-configure \
        --enable-cxx

    # build breaks with multiple jobs when building C++ bindings:
    # https://github.com/PortAudio/portaudio/issues/540
    make -j1
}

package() {
    cd "${srcdir}/portaudio-$pkgver"
    source android-env ${_android_arch}

    make DESTDIR="$pkgdir" install
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so
    ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_PREFIX_LIB}/*.a
}