# Template file for 'cppdap'
#
# As much as I know about Google, their library's ABI ain't stable.
# Rebuild all revdeps on update
pkgname=cppdap
version=1.58.0+a
revision=1
build_style=cmake
configure_args="-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=On
 -DCPPDAP_BUILD_TESTS=On -DBUILD_SHARED_LIBS=On"
makedepends="json-c++ gtest-devel"
short_desc="C++ library for the Debug Adapter Protocol"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="Apache-2.0"
homepage="https://github.com/google/cppdap"
distfiles="https://github.com/google/cppdap/archive/refs/tags/dap-${version/+/-}.tar.gz"
checksum=5d35ca5db78570b6bef698e3365f79bd82a4f78e8393546387f78d7bdb2a2a08

post_patch() {
	vsed -i -e "/project.*VERSION/s/VERSION [0-9.]* /VERSION ${version%+*} /" \
		-e "/add_library/s/ STATIC / /" \
		CMakeLists.txt
}

do_check() {
	cd build
	./cppdap-unittests
}

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