summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Exequiel Pedone2019-04-05 09:55:07 -0300
committerGonzalo Exequiel Pedone2019-04-05 09:55:07 -0300
commite52f2381dd4d7b80b73976178ecc7b3f28217a10 (patch)
treee939eff2d54461ffaffef7d2fddac2fcbf9cd6dd
downloadaur-e52f2381dd4d7b80b73976178ecc7b3f28217a10.tar.gz
Package created.
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD55
-rwxr-xr-xandroid-env.sh98
-rw-r--r--configure.patch14
5 files changed, 192 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..c822490b854
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+# Generated by mksrcinfo v8
+# vie abr 5 12:54:03 UTC 2019
+pkgbase = android-armv7a-eabi-libvorbis
+ pkgdesc = Vorbis codec library (android)
+ pkgver = 1.3.6
+ pkgrel = 1
+ url = http://xiph.org
+ arch = any
+ license = custom
+ makedepends = android-pkg-config
+ depends = android-armv7a-eabi-libogg
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.tar.gz
+ source = configure.patch
+ sha256sums = 6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb
+ sha256sums = 7d721302f969ef8477793e38f9ab7f1bd7b48da4f24864cc9e8c4873c3eb9a60
+
+pkgname = android-armv7a-eabi-libvorbis
+
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..4df9eaeacb4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# PKGBUILD for android-libvorbis
+# 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}-libvorbis
+pkgver=1.3.6
+pkgrel=1
+pkgdesc="Vorbis codec library (android)"
+arch=(any)
+url="http://xiph.org"
+license=('custom')
+depends=("android-${_android_arch}-libogg")
+makedepends=('android-pkg-config')
+options=(!strip !buildflags staticlibs)
+source=("http://downloads.xiph.org/releases/vorbis/libvorbis-${pkgver}.tar.gz"
+ 'configure.patch')
+sha256sums=('6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb'
+ '7d721302f969ef8477793e38f9ab7f1bd7b48da4f24864cc9e8c4873c3eb9a60')
+
+prepare() {
+ cd "${srcdir}"/libvorbis-${pkgver}
+
+ patch -Np1 -i "../configure.patch"
+}
+
+build() {
+ cd "${srcdir}"/libvorbis-${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
+
+ make $MAKEFLAGS
+}
+
+package() {
+ cd "${srcdir}"/libvorbis-${pkgver}
+
+ make DESTDIR="$pkgdir" install
+ rm -r "${pkgdir}"/${ANDROID_LIBS}/share/doc
+ ${ANDROID_STRIP} "${pkgdir}"/${ANDROID_LIBS}/lib/*.so
+ ${ANDROID_STRIP} "$pkgdir"/${ANDROID_LIBS}/lib/*.a
+}
diff --git a/android-env.sh b/android-env.sh
new file mode 100755
index 00000000000..f967d7dcd35
--- /dev/null
+++ b/android-env.sh
@@ -0,0 +1,98 @@
+#!/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_NDK_ROOT}" ]; then
+ export ANDROID_NDK_ROOT=/opt/android-ndk
+fi
+
+if [ -z "${ANDROID_SDK_ROOT}" ]; then
+ export ANDROID_SDK_ROOT=/opt/android-sdk
+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_SDK_ROOT}/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_ROOT}/platforms/$ANDROID_NDK_PLATFORM
+export ANDROID_TOOLCHAIN=${ANDROID_NDK_ROOT}/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_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_ROOT}/source.properties | awk '{print $3}'
+}
+
+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
+ return 1
+ fi
+
+ return 0
+}
diff --git a/configure.patch b/configure.patch
new file mode 100644
index 00000000000..039f0fca958
--- /dev/null
+++ b/configure.patch
@@ -0,0 +1,14 @@
+--- a/configure 2018-03-16 00:36:56.000000000 -0300
++++ b/configure 2019-04-05 09:44:01.490704791 -0300
+@@ -12734,9 +12734,9 @@
+ case $host in
+ *86-*-linux*)
+ DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+- CFLAGS="-O3 -Wall -Wextra -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
++ CFLAGS="-O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char"
+ # PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+- PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
++ PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline"
+
+ # glibc < 2.1.3 has a serious FP bug in the math inline header
+ # that will cripple Vorbis. Look to see if the magic FP stack