summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Exequiel Pedone2019-04-15 17:14:56 -0300
committerGonzalo Exequiel Pedone2019-04-15 17:14:56 -0300
commitba62b0ef3d17fc2ee36fef38f666dbcb9ba85b06 (patch)
treec4c2bc69e98e89875e5c4605af2307b42f0c3587
downloadaur-ba62b0ef3d17fc2ee36fef38f666dbcb9ba85b06.tar.gz
New package.
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD72
-rwxr-xr-xandroid-env.sh101
4 files changed, 198 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..665115a5847
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+# Generated by mksrcinfo v8
+# lun abr 15 20:13:42 UTC 2019
+pkgbase = android-x86-libvpx
+ pkgdesc = VP8 and VP9 codec (android)
+ pkgver = 1.8.0
+ pkgrel = 1
+ url = http://www.webmproject.org/
+ arch = any
+ license = BSD
+ makedepends = android-pkg-config
+ makedepends = yasm
+ depends = android-ndk
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ options = !emptydirs
+ source = https://github.com/webmproject/libvpx/archive/v1.8.0.tar.gz
+ sha256sums = 86df18c694e1c06cc8f83d2d816e9270747a0ce6abe316e93a4f4095689373f6
+
+pkgname = android-x86-libvpx
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..b5bc2aa573e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg
+src
+*.tar.xz
+*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c92f456ae02
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,72 @@
+# PKGBUILD for android-libvpx
+# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
+
+_android_arch=x86
+source android-env.sh ${_android_arch}
+
+pkgname=android-${_android_arch}-libvpx
+pkgver=1.8.0
+pkgrel=1
+pkgdesc="VP8 and VP9 codec (android)"
+arch=('any')
+url="http://www.webmproject.org/"
+license=('BSD')
+
+if [ -z "${ANDROID_NO_DEPS}" ]; then
+ depends=('android-ndk')
+fi
+
+options=(!strip !buildflags staticlibs !emptydirs)
+makedepends=('android-pkg-config' 'yasm')
+source=(https://github.com/webmproject/libvpx/archive/v${pkgver}.tar.gz)
+sha256sums=('86df18c694e1c06cc8f83d2d816e9270747a0ce6abe316e93a4f4095689373f6')
+
+prepare() {
+ check_ndk_version_ge_than 18.0
+}
+
+build() {
+ cd "${srcdir}"/libvpx-${pkgver}
+
+ export CC=${ANDROID_CC}
+ export CXX=${ANDROID_CXX}
+ export STRIP=${ANDROID_STRIP}
+
+ case "$_android_arch" in
+ x86*)
+ ;;
+ *)
+ export AS=${ANDROID_AS}
+ ;;
+ esac
+
+ target=${_android_arch/aarch64/arm64}
+ target=${target/armv7a-eabi/armv7}
+ target=${target/x86-/x86_}
+ target=${target}-android-gcc
+
+ ./configure \
+ --target=${target} \
+ --prefix=${ANDROID_LIBS} \
+ --libdir=${ANDROID_LIBS}/lib \
+ --enable-static \
+ --disable-install-bins \
+ --disable-docs \
+ --disable-install-docs \
+ --disable-install-srcs \
+ --enable-pic \
+ --enable-postproc \
+ --enable-vp8 \
+ --enable-vp9 \
+ --enable-vp9-highbitdepth \
+ --enable-vp9-temporal-denoising
+
+ make $MAKEFLAGS
+}
+
+package() {
+ cd "${srcdir}"/libvpx-${pkgver}
+
+ make DESTDIR="$pkgdir" install
+ ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_LIBS}/lib/*.a
+}
diff --git a/android-env.sh b/android-env.sh
new file mode 100755
index 00000000000..3549d530bb1
--- /dev/null
+++ b/android-env.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+# Useful link to keep track of latest API changes:
+#
+# https://developer.android.com/ndk/downloads/revision_history
+
+_android_arch=$1
+
+if [ -z "${_android_arch}" ]; then
+ _android_arch=armv7a-eabi
+fi
+
+# Minimum Android platform based on:
+#
+# https://developer.android.com/about/dashboards/
+if [ -z "${ANDROID_MINIMUM_PLATFORM}" ]; then
+ export ANDROID_MINIMUM_PLATFORM=22
+fi
+
+if [ -z "${ANDROID_HOME}" ]; then
+ export ANDROID_HOME=/opt/android-sdk
+fi
+
+if [ -z "${ANDROID_NDK_HOME}" ]; then
+ export ANDROID_NDK_HOME=/opt/android-ndk
+fi
+
+get_last() {
+ ls $1 | sort -V | tail -n 1
+}
+
+if [ -z "${ANDROID_BUILD_TOOLS_REVISION}" ]; then
+ export ANDROID_BUILD_TOOLS_REVISION=$(get_last ${ANDROID_HOME}/build-tools)
+fi
+
+if [ -z "${ANDROID_API_VERSION}" ]; then
+ export ANDROID_API_VERSION=android-$ANDROID_MINIMUM_PLATFORM
+fi
+
+if [ -z "${ANDROID_NDK_PLATFORM}" ]; then
+ export ANDROID_NDK_PLATFORM=android-$ANDROID_MINIMUM_PLATFORM
+fi
+
+export ANDROID_PLATFORM=${ANDROID_NDK_HOME}/platforms/$ANDROID_NDK_PLATFORM
+export ANDROID_TOOLCHAIN=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64
+export ANDROID_SYSROOT=${ANDROID_TOOLCHAIN}/sysroot
+export ANDROID_CROSS_PREFIX=$ANDROID_TOOLCHAIN/bin/
+export ANDROID_PKGCONFIG=android-${_android_arch}-pkg-config
+
+case "$_android_arch" in
+ aarch64)
+ export ANDROID_TOOLS_COMPILER_PREFIX=${ANDROID_CROSS_PREFIX}aarch64-linux-android${ANDROID_MINIMUM_PLATFORM}-
+ export ANDROID_TOOLS_PREFIX=${ANDROID_CROSS_PREFIX}aarch64-linux-android-
+ ;;
+ armv7a-eabi)
+ export ANDROID_TOOLS_COMPILER_PREFIX=${ANDROID_CROSS_PREFIX}armv7a-linux-androideabi${ANDROID_MINIMUM_PLATFORM}-
+ export ANDROID_TOOLS_PREFIX=${ANDROID_CROSS_PREFIX}arm-linux-androideabi-
+ ;;
+ x86)
+ export ANDROID_TOOLS_COMPILER_PREFIX=${ANDROID_CROSS_PREFIX}i686-linux-android${ANDROID_MINIMUM_PLATFORM}-
+ export ANDROID_TOOLS_PREFIX=${ANDROID_CROSS_PREFIX}i686-linux-android-
+ ;;
+ x86-64)
+ export ANDROID_TOOLS_COMPILER_PREFIX=${ANDROID_CROSS_PREFIX}x86_64-linux-android${ANDROID_MINIMUM_PLATFORM}-
+ export ANDROID_TOOLS_PREFIX=${ANDROID_CROSS_PREFIX}x86_64-linux-android-
+ ;;
+esac
+
+export ANDROID_CC=${ANDROID_TOOLS_COMPILER_PREFIX}clang
+export ANDROID_CXX=${ANDROID_TOOLS_COMPILER_PREFIX}clang++
+export ANDROID_AR=${ANDROID_TOOLS_PREFIX}ar
+export ANDROID_AS=${ANDROID_TOOLS_PREFIX}as
+export ANDROID_NM=${ANDROID_TOOLS_PREFIX}nm
+export ANDROID_RANLIB=${ANDROID_TOOLS_PREFIX}ranlib
+export ANDROID_STRIP=${ANDROID_TOOLS_PREFIX}strip
+export ANDROID_LIBS=/opt/android-libs/${_android_arch}
+export PKG_CONFIG_SYSROOT_DIR=${ANDROID_LIBS}
+export PKG_CONFIG_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig:${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig
+
+ndk_version() {
+ grep 'Pkg.Revision' ${ANDROID_NDK_HOME}/source.properties | awk '{print $3}'
+}
+
+check_ndk_version_ge_than() {
+ version=$1
+ ndk_ver=$(ndk_version)
+
+ if [ "${version}" = "${ndk_ver}" ]; then
+ return 0
+ fi
+
+ older_ver=$(printf "${version}\n${ndk_ver}" | sort -V | head -n 1)
+
+ if [ "${older_ver}" = "${ndk_ver}" ]; then
+ echo "ERROR: NDK version >= $version required."
+
+ return 1
+ fi
+
+ return 0
+}