COMMENT =	C++ library for cloud-based client-server communication

PKGNAME =	cpprest-${GH_TAGNAME}

GH_ACCOUNT =	Microsoft
GH_PROJECT =	cpprestsdk
GH_TAGNAME =	2.10.18

SHARED_LIBS +=	cpprest			0.0 # 0.0

CATEGORIES =	net devel

# MIT
PERMIT_PACKAGE = Yes

WANTLIB += ${COMPILER_LIBCXX} boost_atomic-mt boost_chrono-mt
WANTLIB += boost_date_time-mt boost_filesystem-mt boost_random-mt
WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt crypto
WANTLIB += m ssl z

# websocketpp is a header-only library included as git submodule.
MASTER_SITES0 =	https://github.com/zaphoyd/websocketpp/archive/refs/tags/
DISTFILES =	${GH_DISTFILE} \
		websocketpp-{}0.8.2.tar.gz:0

# C++11
COMPILER =	base-clang ports-gcc

MODULES =	devel/cmake

CONFIGURE_ARGS += -DWERROR=off

LIB_DEPENDS =	devel/boost

# test #1 and #8 fails with default pf.conf since they try to
# phone home.

post-extract:
	rmdir ${WRKSRC}/Release/libs/websocketpp
	cd ${WRKDIR} && mv websocketpp-* cpprestsdk-*/Release/libs/
	cd ${WRKSRC}/Release/libs/ && mv websocketpp-* websocketpp

.include <bsd.port.mk>
