aboutsummaryrefslogtreecommitdiffstats
path: root/games/sdlquake2/Makefile
blob: beae0fe9c8c70c0a759404334916c2a2ff3c8d71 (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
# New ports collection makefile for:    sdlquake2
# Date created:             5 May 2006
# Whom:                 alepulver
#
# $FreeBSD$
#

PORTNAME=   sdlquake2
PORTVERSION=    0.1.4
PORTREVISION=   8
CATEGORIES= games
MASTER_SITES=   http://koti.mbnet.fi/~turol/sdlquake2/

MAINTAINER= ports@FreeBSD.org
COMMENT=    Combination of R1Q2 and R1GL with SDL code from Quake2Forge

LIB_DEPENDS=    execinfo.1:${PORTSDIR}/devel/libexecinfo

USE_BZIP2=  yes
USE_GMAKE=  yes

OPTIONS=    CLIENT "Build client" on \
        DEDICATED "Build dedicated server" on \
        GAME "Build a main game .so file" off

LIBDIR=     ${PREFIX}/lib/${PORTNAME}
MAKE_ENV=   LIBDIR="${LIBDIR}"
PLIST_SUB=  LIBDIR=${LIBDIR:S/${PREFIX}\///}

.include "${.CURDIR}/../quake2-data/Makefile.include"

.include <bsd.port.pre.mk>

.if defined(WITH_CLIENT)
LIB_DEPENDS+=   jpeg.11:${PORTSDIR}/graphics/jpeg \
        png.6:${PORTSDIR}/graphics/png
USE_GL=     yes
USE_SDL=    sdl
MAKE_ENV+=  BUILD_CLIENT=YES
PLIST_SUB+= CLIENT=""
.else
PLIST_SUB+= CLIENT="@comment "
.endif

.if defined(WITH_DEDICATED)
MAKE_ENV+=  BUILD_DEDICATED=YES
PLIST_SUB+= DEDICATED=""
.else
PLIST_SUB+= DEDICATED="@comment "
.endif

.if defined(WITH_GAME)
MAKE_ENV+=  BUILD_GAME=YES
PLIST_SUB+= GAME=""
.else
PLIST_SUB+= GAME="@comment "
.endif

post-patch:
# Resolve name collision with jpeg-8
    ${REINPLACE_CMD} -e 's|jpeg_mem_src|local_jpeg_mem_src|' \
        ${WRKSRC}/gl_image.c

do-install:
    ${MKDIR} ${LIBDIR}/baseq2
.if defined(WITH_CLIENT)
    ${INSTALL_PROGRAM} ${WRKSRC}/quake2 ${PREFIX}/bin/${PORTNAME}
    ${INSTALL_PROGRAM} ${WRKSRC}/ref_sdlgl.so ${LIBDIR}
.endif
.if defined(WITH_DEDICATED)
    ${INSTALL_PROGRAM} ${WRKSRC}/q2ded ${PREFIX}/bin/${PORTNAME}-ded
.endif
.if defined(WITH_GAME)
    ${INSTALL_PROGRAM} ${WRKSRC}/baseq2/game.so ${LIBDIR}/baseq2
.endif

post-install:
    @${ECHO_CMD}
    @${CAT} ${PKGMESSAGE}
    @${ECHO_CMD}

.include <bsd.port.post.mk>