# Description: High quality, one-dimensional sample-rate conversion library
# URL: https://sourceforge.net/p/soxr/wiki/Home/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: ffmpeg

name=libsoxr
version=0.1.3
release=2
source=(https://downloads.sourceforge.net/soxr/soxr-$version-Source.tar.xz)

build() {
	cmake -S soxr-$version-Source -B build -G Ninja \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D CMAKE_BUILD_TYPE=Release \
		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
		-D BUILD_EXAMPLES=OFF \
		-D BUILD_SHARED_LIBS=ON \
		-D WITH_AVFFT=ON \
		-D WITH_LSR_BINDINGS=ON \
		-D WITH_OPENMP=ON \
		-D WITH_PFFFT=ON \
		-Wno-dev

	ninja -C build -j ${JOBS:-1}
	DESTDIR=$PKG ninja -C build install

	rm -r $PKG/usr/share
}
