summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bb3964b6a698f0f34fd39907ebc5e5b1af3af7c0 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Thomas Bächler <thomas@archlinux.org>

_android_arch=x86

pkgname=android-${_android_arch}-libnl
pkgver=3.11.0
pkgrel=1
arch=('any')
pkgdesc="Library for applications dealing with netlink sockets (Android ${_android_arch})"
url='https://github.com/thom311/libnl/'
license=('GPL')
groups=('android-libnl')
depends=('android-ndk')
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://github.com/thom311/libnl/releases/download/libnl${pkgver//./_}/libnl-${pkgver}.tar.gz"{,.sig})
md5sums=('0a5eb82b494c411931a47638cb0dba51'
         'SKIP')
validpgpkeys=('49EA7C670E0850E7419514F629C2366E4DFC5728') # Thomas Haller

prepare() {
    cd "${srcdir}/libnl-${pkgver}"

    sed -i 's|-lpthread||g' configure
}

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

    export CFLAGS="${CFLAGS} -Din_addr_t=uint32_t"
    export CXXFLAGS="${CXXFLAGS} -Din_addr_t=uint32_t"

    android-${_android_arch}-configure \
        --enable-cli=no
    make $MAKEFLAGS
}

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

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