summaryrefslogtreecommitdiff
path: root/games/r1q2/Makefile
blob: a1dca0401099d29cd25f894118cdd4501ca471e9 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# New ports collection makefile for:	r1q2
# Date created:				16 May 2006
# Whom:					alepulver
#
# $FreeBSD$
#

PORTNAME=	r1q2
PORTVERSION=	6557
PORTREVISION=	3
CATEGORIES=	games
MASTER_SITES=	http://www.r1ch.net/stuff/r1q2/src/
DISTNAME=	${PORTNAME}-b${PORTVERSION}-src

PATCH_SITES=	${MASTER_SITE_LOCAL}
PATCH_SITE_SUBDIR=	alepulver
PATCHFILES=	r1q2_diff.gz
PATCH_DIST_STRIP=	-p1

MAINTAINER=	alepulver@FreeBSD.org
COMMENT=	Enhaced Quake II client/server focusing on stability

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

USE_ZIP=	yes
USE_GCC=	3.2+
USE_GMAKE=	yes
NO_WRKSUBDIR=	yes

OPTIONS=	CLIENT "Build OpenGL client" on \
		DEDICATED "Build dedicated server" on \
		GAME "Build a main game .so file" off \
		GLX "Build OpenGL renderer" on \
		HTTP "Enable HTTP download support" on \
		OPENAL "Enable OpenAL support" on \
		OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
		SDL "Build SDL client" on \
		SDLGL "Build SDL OpenGL renderer" on

ALL_TARGET=	release

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

LIBDIR=		${PREFIX}/lib/${PORTNAME}

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

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_CLIENT) || !defined(WITHOUT_GLX)
USE_GL=		yes
.endif

.if !defined(WITHOUT_SDL) && !defined(WITHOUT_SDLGL)
USE_SDL=	sdl
.endif

.if !defined(WITHOUT_GLX) || !defined(WITHOUT_SDLGL)
LIB_DEPENDS+=	jpeg.9:${PORTSDIR}/graphics/jpeg \
		png.5:${PORTSDIR}/graphics/png
.endif

.if !defined(WITHOUT_CLIENT)
MAKE_ENV+=	BUILD_CLIENT=YES
PLIST_SUB+=	CLIENT=""
R1Q2_BIN+=	r1q2
.else
PLIST_SUB+=	CLIENT="@comment "
.endif

.if !defined(WITHOUT_DEDICATED)
MAKE_ENV+=	BUILD_DEDICATED=YES
PLIST_SUB+=	DEDICATED=""
R1Q2_BIN+=	r1q2ded
.else
PLIST_SUB+=	DEDICATED="@comment "
.endif

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

.if !defined(WITHOUT_GLX)
MAKE_ENV+=	BUILD_GLX=YES
PLIST_SUB+=	GLX=""
R1Q2_REF+=	r1gl
.else
PLIST_SUB+=	GLX="@comment "
.endif

.if !defined(WITHOUT_HTTP)
LIB_DEPENDS+=	curl.3:${PORTSDIR}/ftp/curl
MAKE_ENV+=	WITH_HTTP_DOWNLOAD_SUPPORT=YES
.endif

.if !defined(WITHOUT_OPENAL)
LIB_DEPENDS+=	openal.0:${PORTSDIR}/audio/openal
MAKE_ENV+=	WITH_OPENAL_SUPPORT=YES
.endif

.if !defined(WITHOUT_OPTIMIZED_CFLAGS)
MAKE_ENV+=	OPTIMIZED_CFLAGS=YES
.endif

.if !defined(WITHOUT_SDL)
MAKE_ENV+=	BUILD_SDL=YES
PLIST_SUB+=	SDL=""
R1Q2_BIN+=	r1q2-sdl
.else
PLIST_SUB+=	SDL="@comment "
.endif

.if !defined(WITHOUT_SDLGL)
MAKE_ENV+=	BUILD_SDLGL=YES
PLIST_SUB+=	SDLGL=""
R1Q2_REF+=	r1sdl
.else
PLIST_SUB+=	SDLGL="@comment "
.endif

.if ${OSVERSION} < 500000
post-patch:
	@${REINPLACE_CMD} -e 's|<stdint\.h>|<inttypes.h>|' \
		${WRKSRC}/game/q_shared.h
.endif

do-install:
.for f in ${R1Q2_BIN}
	${INSTALL_PROGRAM} ${WRKSRC}/quake2/${f} ${PREFIX}/bin
.endfor
	${MKDIR} ${LIBDIR}/baseq2
.for f in ${R1Q2_REF}
	${INSTALL_PROGRAM} ${WRKSRC}/quake2/ref_${f}.so ${LIBDIR}
.endfor
.if defined(WITH_GAME)
	${INSTALL_PROGRAM} ${WRKSRC}/quake2/baseq2/game.so ${LIBDIR}/baseq2
.endif
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/readme.txt ${WRKSRC}/r1q2.txt ${DOCSDIR}
.endif

.include <bsd.port.post.mk>