summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 95e00a12f2cc59ed27ec24fdacf89a8b3b1c74d6 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# PKGBUILD for android-ffmpeg
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>

_android_arch=aarch64
source android-env.sh ${_android_arch}

pkgname=android-${_android_arch}-ffmpeg
pkgver=4.1.2
pkgrel=2
pkgdesc="Complete solution to record, convert and stream audio and video (android)"
arch=('any')
url="http://ffmpeg.org/"
license=('GPL3')
depends=('apache-ant'
         'android-ndk>=r18.b'
         "android-platform-$ANDROID_MINIMUM_PLATFORM"
         'android-sdk-25.2.5'
         'android-sdk-build-tools'
         'android-sdk-platform-tools')
options=(!strip !buildflags staticlibs !emptydirs)
makedepends=('android-pkg-config' 'git' 'yasm')
source=("git+https://git.ffmpeg.org/ffmpeg.git#tag=n${pkgver}"
        'configure.patch')
sha256sums=('SKIP'
            '574f234bd6e09c47e8435faffd464a3fe01dcfdfd939889e6608451f795a1701')

prepare() {
    cd ffmpeg
    patch -Np1 -i ../configure.patch
}

build() {
    cd ffmpeg

    unset CC
    unset CXX
    unset CFLAGS
    unset CXXFLAGS
    unset LDFLAGS
    unset CHOST
    unset CARCH

    case "$_android_arch" in
        aarch64)
            target_arch=aarch64
            ;;
        armv7a-eabi)
            target_arch=arm
            ;;
        x86)
            target_arch=x86_32
            ;;
        x86-64)
            target_arch=x86_64
            ;;
    esac

    configue_opts="
        --prefix="${ANDROID_LIBS}"
        --enable-cross-compile
        --cross-prefix="${ANDROID_CROSS_PREFIX}"
        --target-os=android
        --arch=${target_arch}
        --sysroot="${ANDROID_SYSROOT}"
        --pkg-config=${ANDROID_PKGCONFIG}
        --cc=${ANDROID_CC}
        --cxx=${ANDROID_CXX}
        --ar=${ANDROID_AR}
        --ranlib=${ANDROID_RANLIB}
        --strip=${ANDROID_STRIP}
        --nm=${ANDROID_NM}
        --disable-debug
        --enable-static
        --disable-stripping
        --enable-gpl
        --enable-shared
        --enable-version3
        --enable-pic
        --disable-doc
        --disable-ffmpeg
        --disable-ffprobe
        --disable-libv4l2
        --disable-v4l2-m2m
        --disable-indev=v4l2
        --disable-outdev=v4l2"

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

    ./configure ${configue_opts}
    make $MAKEFLAGS
}

package() {
    cd ffmpeg
    make DESTDIR="$pkgdir" install

    ${ANDROID_STRIP} "${pkgdir}"/${ANDROID_LIBS}/lib/*.a
    ${ANDROID_STRIP} "${pkgdir}"/${ANDROID_LIBS}/lib/*.so
}