summaryrefslogtreecommitdiff
path: root/devel/mongo-c-driver/Makefile
blob: 1ebeab6b07b3aa1a2c2d9412d134235cdd2b46e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
PORTNAME=	mongo-c-driver
DISTVERSION=	1.24.2
CATEGORIES=	devel
MASTER_SITES=	https://github.com/mongodb/${PORTNAME}/releases/download/${DISTVERSION}/

MAINTAINER=	ports@bsdserwis.com
COMMENT=	C Driver for MongoDB
WWW=		https://github.com/mongodb/mongo-c-driver

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libbson-1.0.so:devel/libbson \
		libzstd.so:archivers/zstd

USES=		cmake cpe pathfix pkgconfig python:env
CPE_VENDOR=	mongodb
USE_LDCONFIG=	yes

CMAKE_ARGS=	-DENABLE_ZLIB=SYSTEM
CMAKE_ON=	ENABLE_MONGOC \
		ENABLE_ZSTD \
		USE_SYSTEM_LIBBSON
CMAKE_OFF=	BUILD_TESTING \
		ENABLE_EXAMPLES \
		ENABLE_TESTS \
		ENABLE_UNINSTALL

OPTIONS_DEFINE=		CRYPTOPROFILE DOCS ICU MONGODBAWS RDTSCP SASL SNAPPY \
			SRV SSL UTF8PROC ZSTD
OPTIONS_DEFAULT=	SSL
OPTIONS_SUB=		yes

CRYPTOPROFILE_DESC=	Use system crypto profile (requires OpenSSL)
MONGODBAWS_DESC=	Enable support for the MONGODB-AWS authentication mechanism
RDTSCP_DESC=		Fast performance counters on Intel using the RDTSCP instruction
SRV_DESC=		Enable support for mongodb+srv URIs
UTF8PROC_DESC=		SCRAM-SHA-256 authentication with non-ASCII passwords

CRYPTOPROFILE_CMAKE_ON=	-DENABLE_CRYPTO_SYSTEM_PROFILE=ON
CRYPTOPROFILE_CMAKE_OFF=	-DENABLE_CRYPTO_SYSTEM_PROFILE=OFF

DOCS_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sphinx>0:textproc/py-sphinx@${PY_FLAVOR}
DOCS_CMAKE_ON=		-DENABLE_HTML_DOCS=ON -DENABLE_MAN_PAGES=ON

ICU_LIB_DEPENDS=	libicudata.so:devel/icu
ICU_CMAKE_ON=		-DENABLE_ICU=ON
ICU_CMAKE_OFF=		-DENABLE_ICU=OFF

MONGODBAWS_CMAKE_ON=	-DENABLE_MONGODB_AWS_AUTH=ON
MONGODBAWS_CMAKE_OFF=	-DENABLE_MONGODB_AWS_AUTH=OFF

RDTSCP_CMAKE_ON=	-DENABLE_RDTSCP=ON
RDTSCP_CMAKE_OFF=	-DENABLE_RDTSCP=OFF

SASL_LIB_DEPENDS=	libsasl2.so:security/cyrus-sasl2
SASL_CMAKE_ON=		-DENABLE_SASL=CYRUS
SASL_CMAKE_OFF=		-DENABLE_SASL=OFF

SNAPPY_LIB_DEPENDS=	libsnappy.so:archivers/snappy
SNAPPY_CMAKE_ON=	-DENABLE_SNAPPY=ON
SNAPPY_CMAKE_OFF=	-DENABLE_SNAPPY=OFF

SRV_CMAKE_ON=		-DENABLE_SRV=ON
SRV_CMAKE_OFF=		-DENABLE_SRV=OFF

SSL_USES=		ssl
SSL_CMAKE_OFF=		-DENABLE_SSL=OFF

UTF8PROC_CMAKE_ON=	-DUSE_BUNDLED_UTF8PROC=ON
UTF8PROC_CMAKE_OFF=	-DUSE_BUNDLED_UTF8PROC=OFF

ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
ZSTD_CMAKE_ON=		-DENABLE_ZSTD=ON
ZSTD_CMAKE_OFF=		-DENABLE_ZSTD=OFF

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSSL}
.if	${SSL_DEFAULT:Mlibressl*}
CMAKE_ARGS+=	-DENABLE_SSL=LIBRESSL
.endif
CMAKE_ARGS+=	-DENABLE_SSL=OPENSSL
.if ( ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400092 && ${SSL_DEFAULT} == base ) || ${SSL_DEFAULT:Mopenssl3*}
CFLAGS+=	-DOPENSSL_API_COMPAT=0x30000000L
.endif
.endif

# .if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1300523
# EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src_libmongoc_src_mongoc_mongoc-counters-private.h
# .endif

pre-configure-CRYPTOPROFILE-on:
.if ${SSL_DEFAULT:Mlibressl*}
	@${ECHO_MSG} "CRYPTOPROFILE requires OpenSSL."
	@${FALSE}
.endif

pre-configure-MONGODBAWS-on:
.if !${PORT_OPTIONS:MSSL}
	@${ECHO_MSG} "MONGODBAWS needs SSL."
	@${FALSE}
.endif

post-extract:
	${ECHO} "${DISTVERSION}" > ${WRKSRC}/VERSION_CURRENT

.include <bsd.port.mk>