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

_android_arch=riscv64

pkgname=android-${_android_arch}-libidn2
pkgver=2.3.7
pkgrel=2
arch=('any')
pkgdesc="A free software implementation of IDNA2008 (Android ${_android_arch})"
url="http://www.gnu.org/software/libidn"
license=("GPL3, LGPL3")
groups=('android-libidn2')
depends=("android-${_android_arch}-libunistring")
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://ftp.gnu.org/pub/gnu/libidn/libidn2-${pkgver}.tar.gz")
md5sums=('de2818c7dea718a4f264f463f595596b')

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

    export CFLAGS+=" -D__USE_FORTIFY_LEVEL=2"
    export CXXFLAGS+=" -D__USE_FORTIFY_LEVEL=2"
    export LDFLAGS+=" -Wl,--undefined-version"

    extra_opts=

    # Platform specific patches
    case "$_android_arch" in
        aarch64)
            extra_opts=--with-included-libunistring
            ;;
        *)
            ;;
    esac

    android-${_android_arch}-configure \
        ${extra_opts} \
        --disable-doc
    make $MAKEFLAGS
}

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

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