aboutsummaryrefslogtreecommitdiff
path: root/games/wesnoth-devel/Makefile
blob: 481c2976c25aa4d62c917026eff5a7c9c70269d3 (plain) (blame)
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
# New ports collection makefile for:	wesnoth-devel
# Date created:			7 September 2008
# Whom:				Philip Paeps <philip@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	wesnoth
PORTVERSION=	1.7.15
CATEGORIES=	games
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} \
		http://www.wesnoth.org/files/
PKGNAMESUFFIX=	-devel

MAINTAINER=	philip@FreeBSD.org
COMMENT=	A fantasy turn-based strategy game

LIB_DEPENDS=	boost_thread.4:${PORTSDIR}/devel/boost-libs

CONFLICTS=	wesnoth-[0-9]*

USE_GCC=	4.2+
USE_SDL=	image mixer net ttf
USE_GNOME=	desktopfileutils gnometarget pango
USE_GMAKE=	yes
MAKE_JOBS_SAFE=	yes
WANT_GNOME=	yes
USE_BZIP2=	yes
USE_LUA=	5.1
USE_AUTOTOOLS=	aclocal:110 autoheader:262 automake:110 autoconf:262
ACLOCAL_ARGS=	-Im4
AUTOMAKE_ARGS=	--add-missing --copy
CONFIGURE_ARGS=	--localstatedir=/var \
		--with-icondir=${PREFIX}/share/pixmaps \
		--with-libiconv-prefix=${LOCALBASE} \
		--with-libintl-prefix=${LOCALBASE} \
		--with-localedir=${PREFIX}/share/locale

MANLANG_GAME=	gl sk zh_TW
MANLANG=	"" cs de en_GB es et fi fr hu it ja lt pl pt_BR sr \
		sr@latin tr zh_CN

MAN6=		wesnoth.6

PORTDOCS=	*
PORTDATA=	*

OPTIONS=	BWMON	 "Enable bandwidth monitoring for server" Off \
		CAMPAIGN "Enable campaign server"	On \
		EDITOR	 "Enable map editor"		On \
		FRIBIDI	 "Enable bidirectional support"	On \
		LOWMEM	 "Reduce memory usage (disables animations)" Off \
		NLS	 "Enable localization"		On \
		NOTIFY	 "Enable desktop notifications"	On \
		POOLALLOC "Use wesnoth own memory allocator" Off \
		PYTHON	 "Enable python developer tools" On \
		RAWSOCKETS "Use raw receiving sockets in multiplayer" Off \
		SERVER	 "Enable server"		On \
		TESTS	 "Enable unit tests"		Off \
		TINYGUI	 "Enable tiny gui (down to 320x200)" Off \
		TOOLS	 "Enable extra tools for artists and translators" On

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 700000
BROKEN=		does not compile
.endif

# workaround: compress and add to plist disobedient man pages
.for manlang in ${MANLANG_GAME}
MAN6_${manlang:U}=	wesnoth.6

.if defined(NO_MANCOMPRESS)
PLIST_FILES+=	man/${manlang}/man6/wesnoth.6
.else
PLIST_FILES+=	man/${manlang}/man6/wesnoth.6.gz
.endif
.endfor

.if defined(WITH_DEBUG)
CONFIGURE_ARGS+=	--enable-debug
.endif

.if defined(WITH_PROFILE)
CONFIGURE_ARGS+=	--enable-profile
.endif

# XXX: breaks compilation because of -Werror
.if !defined(WITH_STRICT)
CONFIGURE_ARGS+=	--disable-strict-compilation
.endif

.if defined(WITHOUT_BWMON)
CONFIGURE_ARGS+=	--disable-bandwidth-monitor
.else
CONFIGURE_ARGS+=	--enable-bandwidth-monitor
.endif

.if defined(WITHOUT_CAMPAIGN)
CONFIGURE_ARGS+=	--disable-campaign-server
PLIST_SUB+=		CAMPAIGN="@comment "
.else
CONFIGURE_ARGS+=	--enable-campaign-server
PLIST_SUB+=		CAMPAIGN=""
.endif

.if defined(WITHOUT_EDITOR)
CONFIGURE_ARGS+=	--disable-editor
PLIST_SUB+=		EDITOR="@comment "
.else
CONFIGURE_ARGS+=	--enable-editor
PLIST_SUB+=		EDITOR=""
.endif

.if defined(WITHOUT_FRIBIDI)
CONFIGURE_ARGS+=	--without-fribidi
.else
CONFIGURE_ARGS+=	--with-fribidi
LIB_DEPENDS+=		fribidi.3:${PORTSDIR}/converters/fribidi
.endif

.if defined(WITHOUT_LOWMEM)
CONFIGURE_ARGS+=	--disable-lowmem
.else
CONFIGURE_ARGS+=	--enable-lowmem
.endif

.if defined(WITHOUT_NOTIFY)
CONFIGURE_ARGS+=	--disable-notifications
.else
CONFIGURE_ARGS+=	--enable-notifications --enable-dbus
LIB_DEPENDS+=		dbus-1.3:${PORTSDIR}/devel/dbus
.endif

.if defined(WITHOUT_NLS)
CONFIGURE_ARGS+=	--disable-nls
PLIST_SUB+=		NLS="@comment "
.else
USE_GETTEXT=		yes
CONFIGURE_ARGS+=	--enable-nls
PLIST_SUB+=		NLS=""
.endif

.if defined(WITHOUT_POOLALLOC)
CONFIGURE_ARGS+=	--disable-pool-alloc
.else
CONFIGURE_ARGS+=	--enable-pool-alloc
.endif

.if defined(WITHOUT_PYTHON)
CONFIGURE_ARGS+=	--disable-python-install
PLIST_SUB+=		PYTHON="@comment "
.else
USE_PYTHON=		yes
CONFIGURE_ENV+=		PYTHON_PREFIX=${PREFIX} \
			PYTHON_VERSION=${PYTHON_VERSION:S/python//}
CONFIGURE_ARGS+=	--enable-python-install
PLIST_SUB+=		PYTHON=""
.include "${PORTSDIR}/Mk/bsd.python.mk"
.endif

.if defined(WITHOUT_RAWSOCKETS)
CONFIGURE_ARGS+=	--disable-raw-sockets
.else
CONFIGURE_ARGS+=	--enable-raw-sockets
.endif

.if defined(WITHOUT_SERVER)
CONFIGURE_ARGS+=	--disable-server
PLIST_SUB+=		SERVER="@comment "
.else
CONFIGURE_ARGS+=	--enable-server
MAN6+=			wesnothd.6
PLIST_SUB+=		SERVER=""
.endif

.if defined(WITHOUT_TESTS)
CONFIGURE_ARGS+=	--disable-tests
PLIST_SUB+=		TESTS="@comment "
.else
CONFIGURE_ARGS+=	--enable-tests
PLIST_SUB+=		TESTS=""
.endif

.if defined(WITHOUT_TINYGUI)
CONFIGURE_ARGS+=	--disable-tinygui
.else
BUILD_DEPENDS+=		convert:${PORTSDIR}/graphics/ImageMagick
CONFIGURE_ARGS+=	--enable-tinygui
.endif

.if defined(WITHOUT_TOOLS)
CONFIGURE_ARGS+=	--disable-tools
PLIST_SUB+=		TOOLS="@comment "
.else
CONFIGURE_ARGS+=	--enable-tools
PLIST_SUB+=		TOOLS=""
.endif

.if (defined(WITH_CAMPAIGN) || defined(WITH_SERVER) || defined(WITH_TOOLS)) && defined(WITHOUT_NLS)
BROKEN=		you need NLS support for `campaignd' or `wesnothd' or tools to link against gettext
.endif

.if defined(NOPORTDOCS) || defined(NOPORTDATA)
BROKEN=		NOPORT(DOCS|DATA) is not supported
.endif

post-install:	.SILENT
	-update-desktop-database

.if !defined(NO_MANCOMPRESS)
.	for manlang in ${MANLANG_GAME}
		${GZIP_CMD} ${PREFIX}/man/${manlang}/man6/wesnoth.6
.	endfor
.endif

.include <bsd.port.post.mk>