To * workaround bug in CMake 3.13.3 * stay compatible with future CMake releases
91 lines
3.1 KiB
Bash
91 lines
3.1 KiB
Bash
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
# you also find the URL of a binary repository.
|
|
|
|
_reponame=tagparser
|
|
_pkgname=tagparser
|
|
_android_arch=arm64-v8a
|
|
_pkg_arch=aarch64
|
|
_android_toolchain=$_pkg_arch-linux-android
|
|
_android_platform=22
|
|
_prefix=/opt/android-libs/$_pkg_arch
|
|
|
|
pkgname=android-$_pkg_arch-$_pkgname
|
|
pkgver=8.2.0
|
|
pkgrel=1
|
|
arch=('any')
|
|
pkgdesc="C++ library for reading and writing MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags (Android, $_pkg_arch)"
|
|
license=('GPL')
|
|
depends=("android-$_pkg_arch-c++utilities")
|
|
optdepends=("$_pkgname-doc: API documentation")
|
|
checkdepends=("android-$_pkg_arch-cppunit" "android-$_pkg_arch-openssl")
|
|
# FIXME: run tests with qemu
|
|
#checkdepends+=('qemu-binfmt-arm' "android-$_pkg_arch-linker")
|
|
makedepends=('cmake' 'android-ndk' 'android-sdk')
|
|
#conflicts=("android-$_pkgname-$_android_arch")
|
|
#replaces=("android-$_pkgname-$_android_arch")
|
|
url="https://github.com/Martchus/${_reponame}"
|
|
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz")
|
|
sha256sums=('c695b21327510840b37fe474dde698628a1215b5b7e66591d2393c628f528302')
|
|
options=(!buildflags staticlibs !strip !emptydirs)
|
|
|
|
prepare() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
|
|
local android_sdk_path=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
|
local android_ndk_path=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
|
local include_dir=$_prefix/include
|
|
|
|
cmake \
|
|
-DCMAKE_SYSTEM_NAME=Android \
|
|
-DCMAKE_SYSTEM_VERSION=$_android_platform \
|
|
-DCMAKE_ANDROID_ARCH_ABI=$_android_arch \
|
|
-DCMAKE_ANDROID_SDK="$android_sdk_path" \
|
|
-DCMAKE_ANDROID_NDK="$android_ndk_path" \
|
|
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX=$_prefix \
|
|
-DCMAKE_FIND_ROOT_PATH="$android_ndk_path/sysroot;$_prefix" \
|
|
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,$_prefix/lib" \
|
|
-DNO_DOXYGEN=ON \
|
|
-Dcppunit_DYNAMIC_INCLUDE_DIR="$include_dir" \
|
|
-Dcppunit_STATIC_INCLUDE_DIR="$include_dir" \
|
|
-Dcppunit_DYNAMIC_LIB="$_prefix/lib/libcppunit-1.14.so" \
|
|
-Dcppunit_STATIC_LIB="$_prefix/lib/libcppunit.a" \
|
|
.
|
|
make VERBOSE=1
|
|
}
|
|
|
|
check() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
|
|
# can not run the tests so compile them at least
|
|
make tests VERBOSE=1
|
|
|
|
# FIXME: see c++utilities
|
|
|
|
#if [[ -z $TEST_FILE_PATH ]]; then
|
|
# msg2 'Skipping execution of testsuite because the environment variable TEST_FILE_PATH is not set.'
|
|
# return
|
|
#fi
|
|
|
|
#export LD_LIBRARY_PATH=$PWD:$prefix/lib:$android_ndk_path/sources/cxx-stl/llvm-libc++/libs/arm64-v8a:$android_ndk_path/platforms/android-28/arch-arm64/usr/lib
|
|
#make check VERBOSE=1
|
|
}
|
|
|
|
package() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
make DESTDIR="${pkgdir}" install
|
|
|
|
# add tests to the package for possibly executing them later under Android
|
|
if [[ -f ${_pkgname}_tests ]]; then
|
|
mkdir "${pkgdir}/$_prefix/bin"
|
|
cp ${_pkgname}_tests "${pkgdir}/$_prefix/bin"
|
|
fi
|
|
}
|