# Description: Library for playing module music.
# URL: https://github.com/Konstanty/libmodplug
# Maintainer: John McQuah, jmcquah at disroot dot org

name=libmodplug
version=0.8.9.1
_commit=d1b97ed00
release=1
source=(https://github.com/Konstanty/$name/archive/$_commit.zip)
renames=($name-$version-$_commit.zip)

build() {
	cmake -B build -S $name-$_commit* -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON

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