# Description: Free Lossless Audio Codec.
# URL: https://xiph.org/flac/
# Maintainer: CRUX compat-32 Team, compat-32-ports at crux dot nu
# Depends on: libogg-32

name=flac-32
version=1.4.3
release=1
source=(https://downloads.xiph.org/releases/flac/flac-$version.tar.xz)

build() {
	cmake -S flac-$version -B build -G Ninja \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D CMAKE_INSTALL_LIBDIR=lib32 \
		-D CMAKE_BUILD_TYPE=Release \
		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
		-D BUILD_SHARED_LIBS=ON \
		-D BUILD_EXAMPLES=OFF \
		-D BUILD_TESTING=OFF \
		-Wno-dev
	cmake --build build
	DESTDIR=$PKG cmake --install build

	rm -r $PKG/usr/{bin,include,share/man}
	rmdir $PKG/usr/share
}