# Template file for 'rem'
pkgname="rem"
version="0.5.3"
revision=1
build_style=gnu-makefile
make_build_args="EXTRA_CFLAGS=$CFLAGS EXTRA_LFLAGS=$LDFLAGS RELEASE=1
 LIBRE_MK=${XBPS_CROSS_BASE}/usr/share/re/re.mk \
 SYSROOT=${XBPS_CROSS_BASE}/usr LIBREM_PATH=${wrksrc} \
 LIBRE_INC=${XBPS_CROSS_BASE}/usr/include/re LIBRE_SO=${XBPS_CROSS_BASE}/usr/lib"
make_install_args="${make_build_args}"
make_use_env=yes
makedepends="re-devel"
short_desc="Library for real-time audio and video processing"
maintainer="JohnZ <johnz@posteo.net>"
license="BSD-3-Clause"
homepage="http://www.creytiv.com/"
distfiles="http://www.creytiv.com/pub/rem-${version}.tar.gz"
checksum=9f98a79947d4709282a5791ac30f0eda03d5d34086f36df74bff4f8aac0e8050
shlib_provides="librem.so"

case $XBPS_TARGET_MACHINE in
	i686*) arch="i686";;
	x86_64*) arch="x86_64";;
	armv6*) arch="arm6";;
	aarch64*) arch="arm64";;
	arm*) arch="arm";;
	mips*) arch="mips";;
esac

case "$XBPS_TARGET_MACHINE" in
	armv6*) make_build_args+=" HAVE_ARMV6=1 ARCH=$arch";;
	aarch64* | armv7* ) make_build_args+=" HAVE_NEON= ARCH=$arch";;
	*) make_build_args+=" ARCH=$arch"
esac

pre_build() {
	make ${make_build_args} info
}

post_install() {
	vlicense docs/COPYING
}

rem-devel_package() {
	short_desc+=" - development files"
	depends="${sourcepkg}>=${version}_${revision}"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/*.a
		vmove usr/lib/pkgconfig
	}
}
