summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c633e1eae58de3b479966f19b316fab1b14b53a5 (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
75
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Robert Emil Berge <filoktetes@linuxophic.org>
# Contributor: Mateusz Herych <heniekk@gmail.com>

_android_arch=aarch64

pkgname=android-${_android_arch}-gavl
pkgver=1.4.0
pkgrel=1
arch=('any')
pkgdesc="Low level library, upon which multimedia APIs can be built (Android ${_android_arch})"
url='http://gmerlin.sourceforge.net/'
license=('GPL-2.0-or-later')
depends=('android-ndk')
makedepends=('android-configure')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://downloads.sourceforge.net/gmerlin/gavl-$pkgver.tar.gz"
        '0001-Fix-monotonic-clock-check.patch')
sha256sums=('51aaac41391a915bd9bad07710957424b046410a276e7deaff24a870929d33ce'
            '20b096ac3665f21ad98271cb1e3eff74113def989f1bc877739cc4baddff6dd4')

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

    patch -Np1 -i ../0001-Fix-monotonic-clock-check.patch
    sed -i 's| -funroll-all-loops | |g' configure.ac

    autoreconf -fiv

    # Fix build
    sed -i 's|volume_test_LDADD = ../gavl/libgavl.la|volume_test_LDADD = -lm ../gavl/libgavl.la|' src/Makefile.{am,in}
    sed -i 's/LDFLAGS="$GMERLIN_DEP_RPATH"/LDFLAGS="$LDFLAGS $GMERLIN_DEP_RPATH"/' configure{,.ac}
}

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

    # Platform specific patches
    case "$_android_arch" in
        aarch64)
             host=armv8-unknown-linux
            ;;
        armv7a-eabi)
             host=armv7-unknown-linux
            ;;
        x86)
             host=x86-unknown-linux
            ;;
        x86-64)
             host=x86_64-unknown-linux
            ;;
        *)
            ;;
    esac

    android-${_android_arch}-configure \
        --host=${host} \
        --with-cpuflags=none \
        --without-doxygen
    make $MAKEFLAGS
}

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

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