summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Exequiel Pedone2019-05-05 15:11:49 -0300
committerGonzalo Exequiel Pedone2019-05-05 15:11:49 -0300
commit41577285527306fadf3377caabcc0667f7f231e8 (patch)
tree298649aacf19f968b9f4533b536832df6d82d528
downloadaur-41577285527306fadf3377caabcc0667f7f231e8.tar.gz
Added android-speex package.
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD49
-rwxr-xr-xandroid-env.sh101
4 files changed, 176 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..4dfdcf782f6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+# Generated by mksrcinfo v8
+# dom may 5 18:10:42 UTC 2019
+pkgbase = android-armv7a-eabi-speex
+ pkgdesc = A free codec for free speech (android)
+ pkgver = 1.2.0
+ pkgrel = 1
+ url = http://www.speex.org
+ arch = any
+ license = BSD
+ makedepends = android-pkg-config
+ depends = android-armv7a-eabi-speexdsp
+ depends = android-armv7a-eabi-libogg
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ options = !emptydirs
+ source = http://downloads.xiph.org/releases/speex/speex-1.2.0.tar.gz
+ md5sums = 8ab7bb2589110dfaf0ed7fa7757dc49c
+
+pkgname = android-armv7a-eabi-speex
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..47731b2e711
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+pkg
+src
+*.tar.xz
+*.tar.gz
+*.tar.bz2
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..d0e928ffd53
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# PKGBUILD for android-speex
+# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
+
+_android_arch=armv7a-eabi
+source android-env.sh ${_android_arch}
+
+pkgname=android-${_android_arch}-speex
+pkgver=1.2.0
+pkgrel=1
+pkgdesc="A free codec for free speech (android)"
+arch=(any)
+url="http://www.speex.org"
+license=("BSD")
+depends=("android-${_android_arch}-speexdsp"
+ "android-${_android_arch}-libogg")
+options=(!strip !buildflags staticlibs !emptydirs)
+makedepends=('android-pkg-config')
+source=("http://downloads.xiph.org/releases/speex/speex-$pkgver.tar.gz")
+md5sums=('8ab7bb2589110dfaf0ed7fa7757dc49c')
+
+build() {
+ cd "${srcdir}"/speex-${pkgver}
+
+ export CC=${ANDROID_CC}
+ export CXX=${ANDROID_CXX}
+ target=${_android_arch/x86-/x86_}-linux-android
+
+ ./configure \
+ --host=${target} \
+ --target=${target} \
+ --build="$CHOST" \
+ --prefix=${ANDROID_LIBS} \
+ --libdir=${ANDROID_LIBS}/lib \
+ --includedir=${ANDROID_LIBS}/include \
+ --enable-shared \
+ --enable-static \
+ --disable-binaries
+
+ make $MAKEFLAGS
+}
+
+package() {
+ cd "${srcdir}"/speex-${pkgver}
+
+ make DESTDIR="$pkgdir" install
+ rm -r "${pkgdir}"/${ANDROID_LIBS}/share
+ ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_LIBS}/lib/*.so
+ ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_LIBS}/lib/*.a
+}
diff --git a/android-env.sh b/android-env.sh
new file mode 100755
index 00000000000..517f38e9b56
--- /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:
+#
+# http://gs.statcounter.com/os-version-market-share/android/mobile-tablet/worldwide
+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
+}