summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 799980bf9bd40cec87cc925c1148f2da7632b706 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>

_android_arch=aarch64

pkgname=android-${_android_arch}-npth
pkgver=1.7
pkgrel=3
arch=('any')
pkgdesc="The new GNU portable threads library (Android ${_android_arch})"
url="https://www.gnupg.org/software/npth/index.html"
license=('LGPL-2.1-or-later')
depends=('android-ndk')
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://gnupg.org/ftp/gcrypt/npth/npth-$pkgver.tar.bz2")
md5sums=('286274d0106ec408efebe4a399975b11')

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

    autoreconf -fiv
    sed  -i 's|have_ld_version_script=yes|have_ld_version_script=no|g' configure
    sed  -i '/config_libs \$LIB_CLOCK_GETTIME/d' configure
    sed  -i 's|@NPTH_CONFIG_LIBS@|-lnpth|g' npth.pc.in
    sed  -i 's|@INSERT_EXPOSE_RWLOCK_API@|1|g' src/npth.h.in
}

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

    export ac_cv_search_pthread_cancel=yes
    export ac_cv_type_pthread_rwlock_t=yes
    export ac_cv_search_clock_gettime=yes
    android-${_android_arch}-configure \
        --disable-tests
    make $MAKEFLAGS
}

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