summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e622f1414b0c795a427a159aee5832b02cb2e5e4 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

_android_arch=aarch64

pkgname=android-${_android_arch}-libmodplug
pkgver=0.8.9.0
pkgrel=1
arch=('any')
pkgdesc="A MOD playing library (Android ${_android_arch})"
url="http://modplug-xmms.sourceforge.net/"
license=('custom')
depends=('android-ndk')
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://downloads.sourceforge.net/modplug-xmms/libmodplug-${pkgver}.tar.gz"
        'libmodplug-0.8.9.0-no-fast-math.patch')
sha256sums=('457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de'
            '24b97252803b39546199715158ab1d61616755c6c9756f8b2b9b1948477ce4ed')

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

    # FS#76950 (Gentoo)
    patch -Np1 -i ../libmodplug-0.8.9.0-no-fast-math.patch

    autoreconf -vfi
    sed -i 's|register||g' src/fastmix.cpp
}

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

    android-${_android_arch}-configure
    sed -i 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
    make $MAKEFLAGS
}

package() {
    cd "${srcdir}/libmodplug-${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
}