1 # Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
8 MAINTAINER= amdmi3@FreeBSD.org
9 COMMENT= Near-infinite-world block sandbox game
12 LICENSE_FILE= ${WRKSRC}/doc/lgpl-2.1.txt
14 LIB_DEPENDS= libsqlite3.so:databases/sqlite3 \
20 USES= cmake compiler:c11 iconv:wchar_t
21 CMAKE_ARGS= -DCUSTOM_MANDIR="${PREFIX}/man" \
22 -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc"
24 LDFLAGS_i386= -Wl,-znotext
29 OPTIONS_DEFINE= CURL SOUND FREETYPE NCURSES LUAJIT \
32 OPTIONS_GROUP= DATABASE
34 COMP_DESC= Software components
35 OPTIONS_MULTI_COMP= CLIENT SERVER
37 DATABASE_DESC= Database support
38 OPTIONS_GROUP_DATABASE= PGSQL LEVELDB REDIS SPATIAL
40 OPTIONS_DEFAULT= CLIENT SERVER \
41 CURL SOUND FREETYPE NCURSES LUAJIT
42 OPTIONS_EXCLUDE_powerpc64= LUAJIT
45 CLIENT_DESC= Build client
46 CLIENT_CMAKE_BOOL= BUILD_CLIENT
47 CLIENT_LIB_DEPENDS= libpng.so:graphics/png \
48 libIrrlicht.so:x11-toolkits/irrlicht
49 CLIENT_USES= gl jpeg xorg
50 CLIENT_USE= GL=gl XORG=x11,xext,xxf86vm
51 SERVER_DESC= Build server
52 SERVER_CMAKE_BOOL= BUILD_SERVER
54 CURL_DESC= Enable cURL support for fetching media
55 CURL_CMAKE_BOOL= ENABLE_CURL
56 CURL_LIB_DEPENDS= libcurl.so:ftp/curl
57 SOUND_DESC= Enable sound
58 SOUND_CMAKE_BOOL= ENABLE_SOUND
59 FREETYPE_DESC= Support for TrueType fonts with unicode
60 FREETYPE_CMAKE_BOOL= ENABLE_FREETYPE
61 FREETYPE_LIB_DEPENDS= libfreetype.so:print/freetype2
62 NCURSES_DESC= Enable ncurses console
63 NCURSES_CMAKE_BOOL= ENABLE_CURSES
66 LUAJIT_DESC= LuaJIT support
67 LUAJIT_CMAKE_BOOL= ENABLE_LUAJIT REQUIRE_LUAJIT
68 LUAJIT_LIB_DEPENDS= libluajit-5.1.so:lang/luajit
71 PGSQL_CMAKE_BOOL= ENABLE_POSTGRESQL
72 LEVELDB_DESC= Enable LevelDB backend
73 LEVELDB_CMAKE_BOOL= ENABLE_LEVELDB
74 LEVELDB_LIB_DEPENDS= libleveldb.so:databases/leveldb
75 REDIS_DESC= Enable Redis backend
76 REDIS_CMAKE_BOOL= ENABLE_REDIS
77 REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis
78 SPATIAL_DESC= Enable SpatialIndex AreaStore backend
79 SPATIAL_LIB_DEPENDS= libspatialindex.so:devel/spatialindex
80 SPATIAL_CMAKE_BOOL= ENABLE_SPATIAL
82 NLS_CMAKE_BOOL= ENABLE_GETTEXT
84 NLS_LDFLAGS= -L${LOCALBASE}/lib
86 .include <bsd.port.options.mk>
88 .if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
90 LIB_DEPENDS+= libvorbis.so:audio/libvorbis \
91 libogg.so:audio/libogg
94 .if ${PORT_OPTIONS:MSERVER}
95 USE_RC_SUBR= ${PORTNAME}
100 # hacky way to not bring irrlicht and X11 depends for server only
101 .if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
102 BUILD_DEPENDS+= ${NONEXISTENT}:x11-toolkits/irrlicht:patch
103 IRRLICHT_INCLUDE_DIR= `${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include
104 CMAKE_ARGS+= -DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"
105 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-irrlichtdepend
109 # make sure no bundled gmp is used
110 @${RM} -rf ${WRKSRC}/lib/gmp
111 # bundled jsoncpp is OK, see comment in cmake/Modules/FindJson.cmake
112 # (not sure if it affects FreeBSD, but too lazy to investigate)
113 # bundled lua is OK, there's no option to use system one
116 @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
117 ${WRKSRC}/cmake/Modules/*.cmake
119 .include <bsd.port.mk>