# Template file for 'nghttp3'
pkgname=nghttp3
version=1.18.0
revision=1
build_style=cmake
configure_args="-DENABLE_STATIC_LIB=ON -DBUILD_TESTING=ON"
short_desc="HTTP/3 library written in C"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="MIT"
homepage="https://nghttp2.org/nghttp3/"
changelog="https://github.com/ngtcp2/nghttp3/releases"
distfiles="https://github.com/ngtcp2/nghttp3/releases/download/v${version}/nghttp3-${version}.tar.xz"
checksum=aad782c23d3f01bd4bb52c8bac7a553b631ef8115fd1612703df6183449fef19

do_check() {
	cmake --build build --target check
}

post_install() {
	vlicense COPYING
	rm -rf "${DESTDIR}/usr/share/doc"
}

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