1SUMMARY="C++ library for the Debug Adapter Protocol"
2DESCRIPTION="cppdap is a C++11 library implementation of the Debug Adapter Protocol, providing \
3an API for implementing a DAP client or server."
4HOMEPAGE="https://github.com/google/cppdap/"
5COPYRIGHT="2019-2023 Google LLC"
6LICENSE="Apache v2"
7REVISION="3"
8SOURCE_URI="https://github.com/google/cppdap/archive/dap-$portVersion-a.tar.gz"
9CHECKSUM_SHA256="5d35ca5db78570b6bef698e3365f79bd82a4f78e8393546387f78d7bdb2a2a08"
10SOURCE_DIR="cppdap-dap-$portVersion-a"
11PATCHES="cppdap-$portVersion.patchset"
12
13ARCHITECTURES="all !x86_gcc2"
14SECONDARY_ARCHITECTURES="x86"
15
16libVersion="$portVersion"
17libVersionCompat="$libVersion compat >= ${libVersion}"
18
19PROVIDES="
20	cppdap$secondaryArchSuffix = $portVersion
21	lib:libcppdap$secondaryArchSuffix = $libVersionCompat
22	"
23REQUIRES="
24	haiku$secondaryArchSuffix
25	lib:libstdc++$secondaryArchSuffix
26	"
27
28PROVIDES_devel="
29	cppdap${secondaryArchSuffix}_devel = $portVersion
30	devel:libcppdap$secondaryArchSuffix = $libVersionCompat
31	"
32REQUIRES_devel="
33	cppdap$secondaryArchSuffix == $portVersion base
34	"
35
36BUILD_REQUIRES="
37	haiku${secondaryArchSuffix}_devel
38	devel:nlohmann_json
39	"
40BUILD_PREREQUIRES="
41	cmd:cmake
42	cmd:gcc$secondaryArchSuffix
43	cmd:make
44	cmd:pkg_config$secondaryArchSuffix
45	"
46
47defineDebugInfoPackage cppdap$secondaryArchSuffix \
48	$libDir/libcppdap.so
49
50BUILD()
51{
52	cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
53		-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=ON \
54		-DBUILD_SHARED_LIBS=ON \
55		$cmakeDirArgs
56	cmake --build build $jobArgs
57}
58
59INSTALL()
60{
61	cmake --install build
62
63	prepareInstalledDevelLib libcppdap
64	fixPkgconfig
65
66	# devel package
67	packageEntries devel \
68		$developDir \
69		$libDir/cmake
70}
71
72TEST()
73{
74	make -C build test
75}
76