# Contributor:
# Maintainer:
pkgname=libcue
pkgver=2.3.0
pkgrel=0
pkgdesc="Library for parsing CUE sheet files"
url="https://github.com/lipnitsk/libcue"
license="GPL-2.0-or-later"
arch="all"
makedepends="cmake bison flex"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/lipnitsk/libcue/archive/v$pkgver.tar.gz"

# secfixes:
#   2.2.1-r2:
#     - CVE-2023-43641

build() {
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=true
	make -C build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="
fe2c39cc9794ac36c0706405e0432bab23228d343ba4e3395220d5b2a2ebf8b3c97e71d76a628f9144977c0dd56636f78d0c2d1f9f2b0d4068a837a258f035b6  libcue-2.3.0.tar.gz
"
