aboutsummaryrefslogtreecommitdiffstats
path: root/games/widelands/Makefile
blob: af560601f9558cb518f5f32cb5a898b9fe6d4e6d (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
# Ports collection makefile for:        widelands
# Date created:                         8 April 2007
# Whom:                                 Bartosz Fabianowski <freebsd@chillt.de>
#
# $FreeBSD$
#

PORTNAME=   widelands
DISTVERSION=    build10
PORTREVISION=   2
CATEGORIES= games
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME=   ${PORTNAME}-${DISTVERSION}-source

MAINTAINER= freebsd@chillt.de
COMMENT=    Realtime strategy game inspired by Settlers II

LIB_DEPENDS=    png.5:${PORTSDIR}/graphics/png

WRKSRC=     ${WRKDIR}/widelands
PLIST=      ${WRKDIR}/pkg-plist
USE_BZIP2=  yes
USE_PYTHON_BUILD=   2.4+
USE_GETTEXT=    yes
USE_SDL=    mixer image net ttf

SCONS_ARGS= CXXFLAGS="${CXXFLAGS}" LINKFLAGS="${LDFLAGS}" \
        CPPPATH=${LOCALBASE}/include LIBPATH=${LOCALBASE}/lib \
        CC="${CC}" CXX="${CXX}" \
        install_prefix=${PREFIX} bindir=bin datadir=share/widelands

post-patch:
    @${REINPLACE_CMD} -e 's|, True||' ${WRKSRC}/worlds/SConscript
    @${RM} -f ${WRKSRC}/worlds/SConscript.bak

do-build:
    @cd ${WRKSRC} && \
        (cd utils && ${TAR} xf scons-local-0.96.1.tar.gz) && \
        ${PYTHON_CMD} utils/scons.py ${SCONS_ARGS}

pre-install:
    @${RM} -f ${PLIST}
    @${ECHO_CMD} bin/widelands > ${PLIST}
    @for f in COPYING CREDITS ChangeLog README developers editor_readme ; do \
        ${ECHO_CMD} %%DATADIR%%/doc/$$f >> ${PLIST} ; \
    done
    @cd ${WRKSRC} && for d in campaigns maps ; do \
        ${LS} -1d $$d/*.wmf | ${SORT} | ${SED} -e 's|^|%%DATADIR%%/|' >> ${PLIST} ; \
    done
    @cd ${WRKSRC} && for d in fonts game_server music pics sound tribes worlds ; do \
        ${FIND} $$d -type f \! -name SConscript | ${SORT} | ${SED} -e 's|^|%%DATADIR%%/|' >> ${PLIST} ; \
    done
    @for d in doc campaigns maps ; do \
        ${ECHO_CMD} "@dirrm %%DATADIR%%/$$d" >> ${PLIST} ; \
    done
    @cd ${WRKSRC} && for d in fonts game_server music pics sound tribes worlds ; do \
        ${FIND} $$d -type d | ${SORT} -r | ${SED} -e 's|^|@dirrm %%DATADIR%%/|' >> ${PLIST} ; \
    done
    @${ECHO_CMD} "@dirrm %%DATADIR%%" >> ${PLIST}

do-install:
    @cd ${WRKSRC} && ${PYTHON_CMD} utils/scons.py ${SCONS_ARGS} install

.include <bsd.port.mk>