summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a0ba7eb7570fefa18ba4e54f1311a4f740e1d71 (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
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Bruno Pagani <archange@archlinux.org>

_android_arch=x86-64

pkgname=android-${_android_arch}-libyuv
pkgver=r2426+464c51a0
pkgrel=1
arch=('any')
pkgdesc="Library for YUV scaling (Android ${_android_arch})"
url="https://chromium.googlesource.com/libyuv/libyuv/"
license=('custom')
depends=("android-${_android_arch}-libjpeg")
makedepends=('android-cmake'
             'git')
options=(!strip !buildflags staticlibs !emptydirs)
# Version required by libavif
_commit=464c51a0353c71f08fe45f683d6a97a638d47833
source=("git+${url}#commit=${_commit}")
sha512sums=('SKIP')

pkgver() {
    cd "${srcdir}/libyuv"
    printf "r%s+%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "${srcdir}/libyuv"
    sed -i 's|yuvconvert ${JPEG_LIBRARY}|${ly_lib_shared} ${JPEG_LIBRARY}|' CMakeLists.txt
}

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

    android-${_android_arch}-cmake \
        -S . \
        -B build
    make -C build
}

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

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