summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 82517feda5150b51c508cc8bfbc1a9ac915cc3b3 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: drakkan <nicola.murino at gmail dot com>

pkgname=android-meson
pkgver=3
pkgrel=2
arch=('any')
pkgdesc="Meson wrapper for Android"
depends=('meson'
         'android-environment'
         'android-pkg-config'
         'python-packaging')
license=("GPL")
url="https://mesonbuild.com/"
source=("toolchain_generator.py"
        "meson-android-wrapper.sh")
md5sums=('7538d07b82df15601d58bfb366cdcf47'
         '6298adc4689a7d9ea86b24dbc3873d1f')
_architectures="aarch64 armv7a-eabi x86 x86-64"

build() {
    for _arch in ${_architectures}; do
        unset ANDROID_CFLAGS
        unset ANDROID_CPPFLAGS
        unset ANDROID_CXXFLAGS
        unset ANDROID_LDFLAGS

        source android-env ${_arch}

        export CFLAGS="${ANDROID_CFLAGS}"
        export CPPFLAGS="${ANDROID_CPPFLAGS}"
        export CXXFLAGS="${ANDROID_CXXFLAGS}"
        export LDFLAGS="${ANDROID_LDFLAGS}"
        python toolchain_generator.py --arch ${_arch} --output-file toolchain-android-${_arch}.meson
        sed "s|@TRIPLE@|${_arch}|g;" meson-android-wrapper.sh > android-${_arch}-meson
    done
}

package() {
    install -d "${pkgdir}"/usr/bin
    install -d "${pkgdir}"/usr/share/android

    for _arch in ${_architectures}; do
        install -m 755 "${srcdir}/android-${_arch}-meson" "$pkgdir/usr/bin/android-${_arch}-meson"
        install -m 644 toolchain-android-${_arch}.meson "${pkgdir}"/usr/share/android/
    done
}