summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: af7def8f5a2bdab0c8affd9dc1fd3219bf31d638 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Martchus <martchus@gmx.net>
# Contributor: Karl-Felix Glatzer <karl.glatzer@gmx.de>

_android_arch=aarch64

pkgname=android-${_android_arch}-x264-bootstrap
pkgver=157.r72db4377
pkgrel=1
arch=('any')
pkgdesc='Free library for encoding H264/AVC video streams (android)'
license=('GPL')
url='https://www.videolan.org/developers/x264.html'
depends=('android-ndk')
options=(!strip !buildflags staticlibs !emptydirs)
makedepends=('android-configure' 'yasm' 'git')
provides=(${pkgname%-bootstrap})
conflicts=(${pkgname%-bootstrap})
_commit=72db437770fd1ce3961f624dd57a8e75ff65ae0b
source=("git+https://code.videolan.org/videolan/x264.git#commit=${_commit}"
        'soname.patch')
md5sums=('SKIP'
         'SKIP')

pkgver() {
    cd "${srcdir}"/x264
    local _ver=$(grep '#define X264_BUILD' x264.h | cut -d' ' -f3)
    local _rev=$(git rev-parse --short HEAD)
    echo ${_ver}.r${_rev}
}

prepare() {
    cd "${srcdir}"/x264
    patch -Np1 -i ../soname.patch
}

build() {
    cd "${srcdir}"/x264
    source android-env ${_android_arch}
    unset LDFLAGS CPPFLAGS

    configue_opts="
        --disable-cli"

    # Platform specific patches
    case "$_android_arch" in
        x86)
             configue_opts+="
                 --enable-pic
                 --disable-asm
                 --host=i686-linux"
            ;;
        *)
            ;;
    esac

    android-${_android_arch}-configure ${configue_opts}
    make $MAKEFLAGS
}

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