aboutsummaryrefslogtreecommitdiffstats
path: root/games/frogatto/Makefile
blob: 1e974621533e93de66de6d3bbed64b7b59dd105e (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
# New ports collection makefile for:    Frogatto & Friends
# Date created:             14 Jul 2010
# Whom:                 Alexey Dokuchaev <danfe@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   frogatto
PORTVERSION=    1.1.1
PORTREVISION=   3
CATEGORIES= games
MASTER_SITES=   http://www.frogatto.com/files/

MAINTAINER= fiziologus@gmail.com
COMMENT=    An old-school 2D classic adventure platformer game

NO_PACKAGE= Package will be 144M, set FORCE_PACKAGE if you really want it

LIB_DEPENDS=    boost_thread.4:${PORTSDIR}/devel/boost-libs \
        png15:${PORTSDIR}/graphics/png

USE_BZIP2=  yes
USE_GMAKE=  yes
ALL_TARGET= game server
USE_GL=     glew
USE_SDL=    image mixer ttf

PLIST_FILES=    bin/${PORTNAME} bin/${PORTNAME}-server

post-patch:
# Sanitize Makefile: honor CC/CXX and C[XX]FLAGS, trim `-mt' suffix from boost
# libraries, remove superfluous libraries when linking server executable (add
# missing -pthread instead), etc.
    @${REINPLACE_CMD} -E -e 's,= (ccache )?gcc,:= $$(CC) $$(CFLAGS),' \
        -e 's,= (ccache )?g\+\+,:= $$(CXX) $$(CXXFLAGS),' \
        -e 's, -O2,, ; s, -g,, ; s, -L/usr/lib,, ; s, -L/sw/lib,,' \
        -e '/server/s,`.*mixer,-L${LOCALBASE}/lib ${PTHREAD_LIBS},' \
        -e 's,-mt,,g' ${WRKSRC}/Makefile
# Point to the right location where to look for resources on FreeBSD
    @${REINPLACE_CMD} -e 's,HAVE_CONFIG_H,__FreeBSD__,' \
        -e 's,DATADIR,"${DATADIR}",' ${WRKSRC}/src/filesystem.cpp
    @${REINPLACE_CMD} -E 's,(music|sounds)/,${DATADIR}/&,' \
        ${WRKSRC}/src/sound.cpp
    @${REINPLACE_CMD} -e '/\/locale\//s,\.,${PREFIX}/share,' \
        ${WRKSRC}/src/i18n.cpp

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/game ${PREFIX}/bin/${PORTNAME}
    ${INSTALL_PROGRAM} ${WRKSRC}/server ${PREFIX}/bin/${PORTNAME}-server
    cd ${WRKSRC} && ${COPYTREE_SHARE} "data images music sounds" \
        ${DATADIR}
    cd ${WRKSRC} && ${COPYTREE_SHARE} "locale" ${PREFIX}/share
# Fix permissions on DATADIR after COPYTREE_SHARE (cpio(1) defaults to 700
# if target directory (${DATADIR}) does not exist)
    @${CHMOD} 755 ${DATADIR}
# Dynamically generate part of the PLIST for NLS files and game resources
# (lots of them)
    @${FIND} ${PREFIX}/share/locale -name ${PORTNAME}.mo | \
        ${SED} 's,^${PREFIX}/,,' | ${SORT} >> ${TMPPLIST}
    @${FIND} ${DATADIR} -not -type d | \
        ${SED} 's,^${PREFIX}/,,' | ${SORT} >> ${TMPPLIST}
    @${FIND} ${DATADIR} -type d | \
        ${SED} 's,^${PREFIX}/,@dirrm ,' | ${SORT} -r >> ${TMPPLIST}

.include <bsd.port.mk>