summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e8a1f170016f6857b6e79e58bc5accec5a31dd85 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Andreas Radke <andyrtr@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

_android_arch=armv7a-eabi

pkgname=android-${_android_arch}-libgpg-error
pkgver=1.50
pkgrel=1
arch=('any')
pkgdesc="Support library for libgcrypt (Android ${_android_arch})"
url="https://www.gnupg.org"
license=('LGPL')
depends=('android-ndk')
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${pkgver}.tar.bz2"{,.sig}
        '0001-Unversioned-libs.patch')
# https://www.gnupg.org/download/integrity_check.html
sha256sums=('69405349e0a633e444a28c5b35ce8f14484684518a508dc48a089992fe93e20a'
            'SKIP'
            'd109aec757f631d3cda57d396f473338df4d74ee69d940445d474208efc38f17')
validpgpkeys=('6DAA6E64A76D2840571B4902528897B826403ADA') # Werner Koch (dist signing 2020)
validpgpkeys+=('AC8E115BF73E2D8D47FA9908E98E9B2D19C6C8BD') # Niibe Yutaka (GnuPG Release Key)

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

    autoreconf -vfi
    patch -Np1 -i ../0001-Unversioned-libs.patch
}

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

    host=

    case "$_android_arch" in
        aarch64)
            host=aarch64-unknown-linux-gnu
            ;;
        armv7a-eabi)
            host=arm-unknown-linux-androideabi
            ;;
        x86)
            host=i686-unknown-linux-gnu
            ;;
        x86-64)
            host=x86_64-unknown-linux-gnu
            ;;
        *)
            ;;
    esac

    android-${_android_arch}-configure \
        --disable-doc \
        --disable-tests \
        --host "${host}" \
        --enable-install-gpg-error-config
    make $MAKEFLAGS
}

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

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