Update games/hexalate to version 1.1.6
[dports.git] / games / minetest / Makefile
1 # Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       minetest
5 PORTVERSION=    5.2.0
6 CATEGORIES=     games
7
8 MAINTAINER=     amdmi3@FreeBSD.org
9 COMMENT=        Near-infinite-world block sandbox game
10
11 LICENSE=        LGPL21+
12 LICENSE_FILE=   ${WRKSRC}/doc/lgpl-2.1.txt
13
14 LIB_DEPENDS=    libsqlite3.so:databases/sqlite3 \
15                 libgmp.so:math/gmp
16
17 USE_GITHUB=     yes
18 GH_ACCOUNT=     minetest
19
20 USES=           cmake compiler:c11 iconv:wchar_t
21 CMAKE_ARGS=     -DCUSTOM_MANDIR="${PREFIX}/man" \
22                 -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc"
23
24 LDFLAGS_i386=   -Wl,-znotext
25
26 PORTDATA=       *
27 PORTDOCS=       *
28
29 OPTIONS_DEFINE= CURL SOUND FREETYPE NCURSES LUAJIT \
30                 DOCS EXAMPLES NLS
31 OPTIONS_MULTI=  COMP
32 OPTIONS_GROUP=  DATABASE
33
34 COMP_DESC=              Software components
35 OPTIONS_MULTI_COMP=     CLIENT SERVER
36
37 DATABASE_DESC=          Database support
38 OPTIONS_GROUP_DATABASE= PGSQL LEVELDB REDIS SPATIAL
39
40 OPTIONS_DEFAULT=        CLIENT SERVER \
41                         CURL SOUND FREETYPE NCURSES LUAJIT
42 OPTIONS_EXCLUDE_powerpc64=      LUAJIT
43 OPTIONS_SUB=            yes
44
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
53
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
64 NCURSES_USES=           ncurses
65
66 LUAJIT_DESC=            LuaJIT support
67 LUAJIT_CMAKE_BOOL=      ENABLE_LUAJIT REQUIRE_LUAJIT
68 LUAJIT_LIB_DEPENDS=     libluajit-5.1.so:lang/luajit
69
70 PGSQL_USES=             pgsql
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
81
82 NLS_CMAKE_BOOL=         ENABLE_GETTEXT
83 NLS_USES=               gettext
84 NLS_LDFLAGS=            -L${LOCALBASE}/lib
85
86 .include <bsd.port.options.mk>
87
88 .if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
89 USES+=          openal
90 LIB_DEPENDS+=   libvorbis.so:audio/libvorbis \
91                 libogg.so:audio/libogg
92 .endif
93
94 .if ${PORT_OPTIONS:MSERVER}
95 USE_RC_SUBR=    ${PORTNAME}
96 USERS=          ${PORTNAME}
97 GROUPS=         ${PORTNAME}
98 .endif
99
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
106 .endif
107
108 post-extract:
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
114
115 post-patch:
116         @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
117                 ${WRKSRC}/cmake/Modules/*.cmake
118
119 .include <bsd.port.mk>