aboutsummaryrefslogtreecommitdiffstats
path: root/games/minetest/Makefile
blob: 36630b052e2d1cb3123ab0ba309ead844de0edc5 (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
# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
# $FreeBSD$

PORTNAME=   minetest
PORTVERSION=    0.4.4
CATEGORIES= games

MAINTAINER= amdmi3@FreeBSD.org
COMMENT=    An Infiniminer/Minecraft inspired game

LIB_DEPENDS=    Irrlicht:${PORTSDIR}/x11-toolkits/irrlicht \
        sqlite3:${PORTSDIR}/databases/sqlite3

LICENSE=    LGPL21

USE_GITHUB= yes
GH_ACCOUNT= celeron55
GH_TAGNAME= 0.4.4
GH_COMMIT=  ab06fca

USES=       cmake
CMAKE_ARGS= -DCUSTOM_MANDIR="${PREFIX}/man" \
        -DCUSTOM_EXAMPLE_CONF_DIR="${EXAMPLESDIR}"
MAKE_JOBS_SAFE= yes

PORTDOCS=   *
PORTEXAMPLES=   *

MAN6=       minetest.6 minetestserver.6

OPTIONS_DEFINE= CLIENT SERVER SOUND NLS DOCS EXAMPLES
OPTIONS_DEFAULT=CLIENT SERVER SOUND NLS DOCS EXAMPLES
CLIENT_DESC=    Build client
SERVER_DESC=    Build server
SOUND_DESC= Enable sound

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MNLS}
CMAKE_ARGS+=    -DENABLE_GETTEXT:BOOL=YES
USES+=      gettext
LDFLAGS+=   -L${LOCALBASE}/lib
PLIST_SUB+= NLS=""
.else
CMAKE_ARGS+=    -DENABLE_GETTEXT:BOOL=NO
PLIST_SUB+= NLS="@comment "
.endif

.if ${PORT_OPTIONS:MCLIENT}
USE_GL=     gl
LIB_DEPENDS+=   jpeg:${PORTSDIR}/graphics/jpeg \
        png15:${PORTSDIR}/graphics/png
CMAKE_ARGS+=    -DBUILD_CLIENT=1
PLIST_SUB+= CLIENT=""
.else
CMAKE_ARGS+=    -DBUILD_CLIENT=0
PLIST_SUB+= CLIENT="@comment "
.endif

.if ${PORT_OPTIONS:MSERVER}
CMAKE_ARGS+=    -DBUILD_SERVER=1
PLIST_SUB+= SERVER=""
.else
CMAKE_ARGS+=    -DBUILD_SERVER=0
PLIST_SUB+= SERVER="@comment "
.endif

.if ${PORT_OPTIONS:MSOUND}
USE_OPENAL= yes
LIB_DEPENDS+=   vorbis:${PORTSDIR}/audio/libvorbis
.else
CMAKE_ARGS+=    -DENABLE_SOUND:BOOL=OFF
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
        ${WRKSRC}/cmake/Modules/FindIrrlicht.cmake
    @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|' \
        ${WRKSRC}/src/CMakeLists.txt
#   @${REINPLACE_CMD} -e 's|share/man|man|; /EXAMPLE_CONF_DIR/ s|..DOCDIR.|"${EXAMPLESDIR}"|' \
#       ${WRKSRC}/CMakeLists.txt
.if ! ${PORT_OPTIONS:MDOCS}
    @${REINPLACE_CMD} -e '/install.*DESTINATION.*DOCDIR/I d' ${WRKSRC}/CMakeLists.txt
.endif
.if ! ${PORT_OPTIONS:MEXAMPLES}
    @${REINPLACE_CMD} -e '/install.*DESTINATION.*EXAMPLE_CONF_DIR/I d' ${WRKSRC}/CMakeLists.txt
.endif

.include <bsd.port.mk>