aboutsummaryrefslogtreecommitdiffstats
path: root/games/spring/Makefile
blob: 94900d1b98eb75c3cca037d5dc5d138ec48a0bd4 (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
# New ports collection makefile for:    spring
# Date created:     10 Jan 2008
# Whom:         Dmitry Marakasov <amdmi3@amdmi3.ru>
#
# $FreeBSD$
#

PORTNAME=   spring
PORTVERSION=    0.82.7.1
PORTREVISION=   1
CATEGORIES= games
MASTER_SITES=   SF/springrts/springrts/${PORTNAME}-${PORTVERSION}
DISTNAME=   ${PORTNAME}_${PORTVERSION}_src

MAINTAINER= amdmi3@FreeBSD.org
COMMENT=    A project aiming to create a new and versatile RTS Engine

LIB_DEPENDS=    freetype.9:${PORTSDIR}/print/freetype2 \
        boost_thread.4:${PORTSDIR}/devel/boost-libs \
        IL.2:${PORTSDIR}/graphics/devil \
        ogg.7:${PORTSDIR}/audio/libogg \
        vorbis.4:${PORTSDIR}/audio/libvorbis \
        execinfo.1:${PORTSDIR}/devel/libexecinfo
BUILD_DEPENDS=  7z:${PORTSDIR}/archivers/p7zip

ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON=  relies on x86 floating-point math

USE_SDL=    sdl
USE_OPENAL= al
USE_GL=     glew
USE_XORG=   x11 xcursor
USE_LDCONFIG=   yes
MAKE_JOBS_SAFE= yes

USE_CMAKE=  yes
CMAKE_ARGS= -DDATADIR:STRING="share/${PORTNAME}" \
        -DMARCH_FLAG:STRING= \
        -DAI_TYPES:STRING="NATIVE" \
        -DMANDIR:STRING="man" \
        -DCREATE_MAN_PAGES:BOOL=false

WRKSRC=     ${WRKDIR}/${PORTNAME}_${PORTVERSION}

PORTDOCS=   *

.include <bsd.port.pre.mk>

.if defined(WITH_SYNC_DEBUG)
CFLAGS=     # empty
CXXFLAGS=   # empty
CMAKE_ARGS+=    -DCMAKE_BUILD_TYPE=DEBUG2 -DTRACE_SYNC=true -DSYNCDEBUG=true
.endif

post-patch:
    @${REINPLACE_CMD} -E -e '/FIND_PACKAGE.*(Python|JNI)/ d' \
        ${WRKSRC}/tools/unitsync/CMakeLists.txt
    @${REINPLACE_CMD} -e 's|/etc/\(spring/datadir\)|${PREFIX}/\1|g; \
        /AddDirs.*GetBinaryPath/ d' \
        ${WRKSRC}/rts/System/FileSystem/DataDirLocater.cpp
    @${REINPLACE_CMD} -e 's|x1F3F|x0F3F|g' \
        ${WRKSRC}/rts/System/FPUCheck.h
    @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
        ${WRKSRC}/rts/build/cmake/*.cmake
    @${REINPLACE_CMD} -e 's|execinfo|${LOCALBASE}/lib/libexecinfo.so|' \
        ${WRKSRC}/rts/CMakeLists.txt
    @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
        ${WRKSRC}/rts/System/Platform/Misc.cpp

post-install:
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    cd ${WRKSRC}/doc && ${COPYTREE_SHARE} "userdocs DevGuide.html HowTo* \
        SelectionKeys.txt StartScriptFormat.txt changelog.txt" ${DOCSDIR}/
.endif
    @${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}

.include <bsd.port.post.mk>