summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 519823a10d0371b805bf773f091a755061df6424 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Filip Brcic <brcha@gna.org>

_android_arch=x86

pkgname=android-${_android_arch}-libxml2
pkgver=2.13.4
pkgrel=1
arch=('any')
pkgdesc="XML parsing library, version 2 (Android ${_android_arch})"
url="http://www.xmlsoft.org/"
license=('LGPL')
groups=('android-libxml2')
depends=('android-ndk'
         "android-${_android_arch}-libiconv"
         "android-${_android_arch}-zlib"
         "android-${_android_arch}-xz")
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${pkgver}/libxml2-v${pkgver}.tar.gz")
md5sums=('2bbec3a88345981b4d17012dee35b11a')

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

    # disable doc & examples
    sed -i "s| doc example | |g" Makefile.am
    autoreconf -vfi
}

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

    android-${_android_arch}-configure \
        --without-python
    make $MAKEFLAGS

    # deps symbols are not included in static lib:
    ${ANDROID_AR} x "${ANDROID_PREFIX_LIB}/libiconv.a"
    ${ANDROID_AR} x "${ANDROID_PREFIX_LIB}/liblzma.a"
    ${ANDROID_AR} x "${ANDROID_PREFIX_LIB}/libz.a"
    ${ANDROID_AR} cru .libs/libxml2.a *.o
    ${ANDROID_RANLIB} .libs/libxml2.a
}

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

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