summaryrefslogtreecommitdiff
path: root/games/freeciv/Makefile
blob: f42877f56007d70d757562167f994bce7e521c9d (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
# Created by: ada@bsd.org
# $FreeBSD$

PORTNAME=	freeciv
PORTVERSION=	2.4.2
PORTREVISION=	2
CATEGORIES=	games
MASTER_SITES=	SF/freeciv/Freeciv%20${PORTVERSION:R}/${PORTVERSION}

MAINTAINER=	johans@FreeBSD.org
COMMENT=	Free turn-based multiplayer strategy

RUN_DEPENDS=	hicolor-icon-theme>=0:${PORTSDIR}/misc/hicolor-icon-theme
LIB_DEPENDS=	libcurl.so:${PORTSDIR}/ftp/curl

USES=		gettext gmake iconv libtool pkgconfig tar:bzip2
USE_SQLITE=	yes
USE_PYTHON=	yes
USE_AUTOTOOLS=	libltdl
GNU_CONFIGURE=	yes
LDFLAGS+=	-L${LOCALBASE}/lib
CPPFLAGS+=	-I${LOCALBASE}/include
CONFIGURE_ARGS=	${ICONV_CONFIGURE_ARG} --program-transform-name= \
		--enable-aimodules --enable-shared \
		--enable-fcdb=sqlite3

OPTIONS_DEFINE?=	NLS X11 SDL MYSQL IPV6
OPTIONS_DEFAULT?=	NLS X11 IPV6
OPTIONS_SUB=		yes
SDL_CONFIGURE_ON=	--enable-client=gtk,sdl
SDL_USE=		SDL=sdl,image,ttf
MYSQL_CONFIGURE_ON=	--enable-fcdb=mysql --with-mysql-prefix=${LOCALBASE}
MYSQL_USE=		MYSQL=yes
IPV6_CONFIGURE_EANBALE=	ipv6
NLS_USES=		gettext

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSDL} && empty(PORT_OPTIONS:MX11)
IGNORE=		cannot use SDL without X11: re-run make config
.endif

.if ${PORT_OPTIONS:MX11}
LIB_DEPENDS+=	libtiff.so:${PORTSDIR}/graphics/tiff \
		libpng15.so:${PORTSDIR}/graphics/png \
		libggz.so:${PORTSDIR}/games/libggz \
		libggz-gtk.so:${PORTSDIR}/games/ggz-gtk-client \
		libggzcore.so:${PORTSDIR}/games/ggz-client-libs \
		libggzmod.so:${PORTSDIR}/games/ggz-client-libs
USE_XORG=	xpm
USE_SDL+=	mixer
USE_GNOME=	gtk20
INSTALLS_ICONS=	yes
. if ! ${PORT_OPTIONS:MSDL}
CONFIGURE_ARGS+=--enable-client=gtk
. endif
CONFLICTS=	freeciv-nox11-[0-9]*
PLIST_SUB+=	GTK=""
.else
CONFIGURE_ARGS+=--enable-client=no
CONFLICTS=	freeciv-[0-9]*
PLIST_SUB+=	GTK="@comment "
.endif

post-patch:
	@${FIND} ${WRKSRC} -name Makefile.in|${XARGS} ${REINPLACE_CMD} -e \
		'/pkgdatadir/s|[(]datadir)/@PACKAGE@|(prefix)/${DATADIR_REL}|'
	@${REINPLACE_CMD} 's/minor=99/minor=0/' ${WRKSRC}/configure

post-install:
.if ${PORT_OPTIONS:MX11}
	@${INSTALL_DATA} ${WRKSRC}/data/civclient.dsc ${STAGEDIR}${DATADIR}/
	@cd ${STAGEDIR}/${PREFIX}/bin && ${LN} -s freeciv-gtk2 freeciv-client
.endif
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libfreeciv*.so

.include <bsd.port.mk>