PORTNAME=	libical
DISTVERSION=	3.0.20
PORTREVISION=	1
CATEGORIES=	devel
MASTER_SITES=	https://github.com/libical/libical/releases/download/v${DISTVERSION}/

MAINTAINER=	desktop@FreeBSD.org
COMMENT=	Implementation of the IETF Calendaring and Scheduling protocols
WWW=		https://github.com/libical/libical

LICENSE=	LGPL21 MPL20
LICENSE_COMB=	dual
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libicuuc.so:devel/icu

USES=		cmake:testing compiler:c++11-lib cpe gnome pathfix perl5 \
		pkgconfig
CPE_VENDOR=	libical_project
USE_LDCONFIG=	yes
USE_PERL5=	build

CMAKE_ON=	CMAKE_DISABLE_FIND_PACKAGE_BerkeleyDB \
		CMAKE_DISABLE_FIND_PACKAGE_Doxygen
CMAKE_OFF=	LIBICAL_BUILD_TESTING
CMAKE_TESTING_ON=	LIBICAL_BUILD_TESTING

DOCSDIR=	${PREFIX}/share/gtk-doc/html/libical-glib

PLIST_SUB=	VERSION=${DISTVERSION}

OPTIONS_DEFINE=		ALLOWEMPTY DOCS GLIB INTROSPECTION VAPI
OPTIONS_DEFAULT=	GLIB INTROSPECTION VAPI
OPTIONS_SUB=		yes

ALLOWEMPTY_DESC=	Prevent empty properties from being replaced with X-LIC-ERROR
GLIB_DESC=		Build GLib bindings
INTROSPECTION_DESC=	Build GObject Introspection

ALLOWEMPTY_CMAKE_BOOL=	ICAL_ALLOW_EMPTY_PROPERTIES

DOCS_BUILD_DEPENDS=	gtkdoc-scan:textproc/gtk-doc
DOCS_CMAKE_BOOL=	ICAL_BUILD_DOCS

GLIB_USE=		GNOME=glib20,libxml2
GLIB_CMAKE_BOOL=	ICAL_GLIB

INTROSPECTION_USE=		GNOME=introspection:build
INTROSPECTION_CMAKE_BOOL=	GOBJECT_INTROSPECTION

VAPI_IMPLIES=		INTROSPECTION
VAPI_USES=		vala:build
VAPI_CMAKE_BOOL=	ICAL_GLIB_VAPI

.include <bsd.port.mk>
