summaryrefslogtreecommitdiffstats
path: root/www/wt/Makefile
blob: 73f6a67233b98faed0bf28b760bfff27c932432b (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# Created by: Mohammad S. Babaei <info@babaei.net>
# $FreeBSD$

PORTNAME=	wt
PORTVERSION=	3.3.6
PORTREVISION=	3
CATEGORIES=	www

MAINTAINER=	info@babaei.net
COMMENT=	Widget-centric C++ library for developing web applications

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/LICENSE

LIB_DEPENDS+=	libpng.so:graphics/png \
		libboost_system.so:devel/boost-libs \
		libGraphicsMagick.so:graphics/GraphicsMagick

USE_GITHUB=	yes
GH_ACCOUNT=	kdeforche
USE_LDCONFIG=	yes
USE_XORG+=x11
USES=		cmake:outsource pkgconfig ssl
CMAKE_ARGS+=	-DCONFIGDIR:STRING=${LOCALBASE}/etc/wt \
	-DGM_PREFIX:STRING=${LOCALBASE} \
	-DPNG_PREFIX:STRING=${LOCALBASE} \
	-DSSL_PREFIX:STRING=/usr \
	-DZLIB_PREFIX:STRING=/usr \
	-DCONNECTOR_ISAPI:BOOL=OFF \
	-DWEBUSER:STRING=www \
	-DWEBGROUP:STRING=www \
	-DWT_WRASTERIMAGE_IMPLEMENTATION:STRING=GraphicsMagick \
	-DENABLE_SSL:BOOL=ON

NO_OPTIONS_SORT=	yes
OPTIONS_DEFINE=	\
	DOXYGEN \
	EXAMPLES \
	TESTS \
	RESOURCES \
	CMAKE_MODULE \
	CPP11 \
	HARU \
	PANGO \
	EXT \
	QT4 \
	LIBWTTEST \
	OPENGL
OPTIONS_DEFAULT=	\
	TESTS \
	RESOURCES \
	CMAKE_MODULE \
	CPP11 \
	HARU \
	PANGO \
	OPENGL \
	LIBWTTEST
OPTIONS_GROUP=	CONNECTOR DBO WSTRING
OPTIONS_SUB=	yes

EXAMPLES_DESC=		Install examples (implies SQLITE3 and WTHTTP)
TESTS_DESC=		Build Wt tests
RESOURCES_DESC=		Install resources directory
CMAKE_MODULE_DESC=	Install FindWt.cmake in systemwide cmake dir
CPP11_DESC=		Compile Wt in C++11 mode (Clang or GCC 4.6+)
HARU_DESC=		Enable Haru Free PDF Library
EXT_DESC=		Build Wt Ext library with JavaScript-only widgets
LIBWTTEST_DESC=		Build Wt::Test for automated (integration/unit) tests

OPTIONS_GROUP_CONNECTOR=	FCGI WTHTTP
OPTIONS_DEFAULT +=	FCGI WTHTTP
CONNECTOR_DESC=		Connector
FCGI_DESC=		Build FastCGI connector
WTHTTP_DESC=		Build Wt stand-alone httpd connector

OPTIONS_GROUP_DBO=	SQLITE3 POSTGRES FIREBIRD MYSQL
OPTIONS_DEFAULT +=	SQLITE3
DBO_DESC=		Wt::DBO
SQLITE3_DESC=		Build Wt with SQLite 3 support
POSTGRES_DESC=		Build Wt with PostgreSQL support
FIREBIRD_DESC=		Build Wt with Firebird support
MYSQL_DESC=		Build Wt with MariaDB or MySQL support

OPTIONS_GROUP_WSTRING=	NO_STD_LOCALE NO_STD_WSTRING
WSTRING_DESC=		Wt::WString
NO_STD_LOCALE_DESC=	Build for a system without std::locale support
NO_STD_WSTRING_DESC=	Build for a system without std::wstring support

EXAMPLES_I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	-DENABLE_POSTGRES:BOOL=ON
POSTGRES_CMAKE_OFF=	-DENABLE_POSTGRES:BOOL=OFF
QT4_CMAKE_ON=		-DENABLE_QT4:BOOL=ON
QT4_CMAKE_OFF=		-DENABLE_QT4:BOOL=OFF
RESOURCES_CMAKE_ON=	-DINSTALL_RESOURCES:BOOL=ON
RESOURCES_CMAKE_OFF=	-DINSTALL_RESOURCES:BOOL=OFF
SQLITE_CMAKE_ON=	-DENABLE_SQLITE:BOOL=ON
SQLITE_CMAKE_OFF=	-DENABLE_SQLITE:BOOL=OFF
TESTS_CMAKE_ON=		-DBUILD_TESTS:BOOL=ON
TESTS_CMAKE_OFF=	-DBUILD_TESTS:BOOL=OFF
WTHTTP_CMAKE_ON=	-DCONNECTOR_HTTP:BOOL=ON
WTHTTP_CMAKE_OFF=	-DCONNECTOR_HTTP:BOOL=OFF

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOXYGEN}
BUILD_DEPENDS+=	asciidoc:textproc/asciidoc \
		doxygen:devel/doxygen
.endif

.if ${PORT_OPTIONS:MEXAMPLES}
CMAKE_ARGS+=	-DBUILD_EXAMPLES:BOOL=ON -DINSTALL_EXAMPLES:BOOL=ON
.if ${PORT_OPTIONS:MSQLITE3} \
	|| ${PORT_OPTIONS:MPOSTGRES} \
	|| ${PORT_OPTIONS:MFIREBIRD} \
	|| ${PORT_OPTIONS:MMYSQL}
PLIST_SUB+=	DBO_EXAMPLES=""
.if ${PORT_OPTIONS:MSQLITE3}
.else
PLIST_SUB+=	DBO_SQLITE3_EXAMPLES=""
.endif
PLIST_SUB+=	DBO_SQLITE3_EXAMPLES="@comment "
.else
PLIST_SUB+=	DBO_EXAMPLES="@comment "
PLIST_SUB+=	DBO_SQLITE3_EXAMPLES="@comment "
.endif
.if ${PORT_OPTIONS:MQT4}
PLIST_SUB+=	QT4_EXAMPLES=""
.else
PLIST_SUB+=	QT4_EXAMPLES="@comment "
.endif
.else
CMAKE_ARGS+=	-DBUILD_EXAMPLES:BOOL=OFF -DINSTALL_EXAMPLES:BOOL=OFF
PLIST_SUB+=	DBO_EXAMPLES="@comment "
PLIST_SUB+=	DBO_SQLITE3_EXAMPLES="@comment "
PLIST_SUB+=	QT4_EXAMPLES="@comment "
.endif

.if ${PORT_OPTIONS:MCPP11}
USES+=		compiler:c++11-lib
CMAKE_ARGS+=	-DWT_CPP_11_MODE:STRING=-std=c++0x
.endif

.if ${PORT_OPTIONS:MHARU}
LIB_DEPENDS+=	libhpdf.so:print/libharu
CMAKE_ARGS+=	-DHARU_PREFIX:STRING=${LOCALBASE}
.endif

.if ${PORT_OPTIONS:MPANGO}
USE_GNOME+=	pango
.endif

.if ${PORT_OPTIONS:MQT4}
USE_QT4=	corelib moc_build
.endif

.if ${PORT_OPTIONS:MOPENGL}
USE_GL=		gl glew
.endif

.if ${PORT_OPTIONS:MFCGI}
LIB_DEPENDS+=	libfcgi.so:www/fcgi \
		libfcgi++.so:www/fcgi

CMAKE_ARGS+=	-DFCGI_PREFIX:STRING=${LOCALBASE}
.endif

.if ${PORT_OPTIONS:MSQLITE3} \
	|| ${PORT_OPTIONS:MPOSTGRES} \
	|| ${PORT_OPTIONS:MFIREBIRD} \
	|| ${PORT_OPTIONS:MMYSQL}
CMAKE_ARGS+=	-DENABLE_LIBWTDBO:BOOL=ON
PLIST_SUB+=	DBO=""
.else
CMAKE_ARGS+=	-DENABLE_LIBWTDBO:BOOL=OFF
PLIST_SUB+=	DBO="@comment "
.endif

.if ${PORT_OPTIONS:MSQLITE3}
USES+=		sqlite:3
CMAKE_ARGS+=	-DSQLITE3_PREFIX:STRING=${LOCALBASE}
.endif

.if ${PORT_OPTIONS:MPOSTGRES}
USE_PGSQL=	yes
CMAKE_ARGS+=	-DPOSTGRES_PREFIX:STRING=${LOCALBASE}
.endif

.if ${PORT_OPTIONS:MFIREBIRD}
USE_FIREBIRD=	yes
CMAKE_AGS+=	-DFIREBIRD_PREFIX:STRING=${LOCALBASE}
.endif

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=	yes
CMAKE_ARGS+=	-DMYSQL_PREFIX:STRING=${LOCALBASE}
.endif

post-install:
	@${RM} ${STAGEDIR}${ETCDIR}/wt_config.xml
	@${MKDIR} ${STAGEDIR}${ETCDIR}
	@${CP} -p ${BUILD_WRKSRC}/wt_config.xml \
		${STAGEDIR}${ETCDIR}/wt_config.xml.sample

.include <bsd.port.mk>
OpenPOWER on IntegriCloud