# Template file for 'libwebsockets'
pkgname=libwebsockets
version=4.3.2
revision=2
build_style=cmake
configure_args="-DLWS_WITH_LIBEV=ON -DLWS_WITH_LIBUV=ON -DLWS_WITH_HTTP2=ON
 -DLWS_IPV6=ON -DLWS_HAVE_LIBCAP=ON -DLWS_WITH_EVLIB_PLUGINS=OFF
 -DDISABLE_WERROR=ON"
makedepends="libcap-devel libev-devel libuv-devel openssl-devel zlib-devel"
short_desc="Lightweight client and server websocket library"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://libwebsockets.org"
changelog="https://raw.githubusercontent.com/warmcat/libwebsockets/main/changelog"
distfiles="https://github.com/warmcat/libwebsockets/archive/v${version}.tar.gz"
checksum=6a85a1bccf25acc7e8e5383e4934c9b32a102880d1e4c37c70b27ae2a42406e1

post_install() {
	vlicense LICENSE
}

libwebsockets-devel_package() {
	depends="libwebsockets>=${version}_${revision} libcap-devel libev-devel openssl-devel libuv-devel"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/bin
		vmove usr/share/libwebsockets-test-server
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove usr/lib/cmake
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}
