aboutsummaryrefslogtreecommitdiff
path: root/games/quakeforge/Makefile
blob: 3d5f44b6fbfc2f3fe63aa7c17c16aff19f0b05cc (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# New ports collection makefile for:	QuakeForge
# Date created:		4 January 2000
# Whom:			darius@dons.net.au
#
# $FreeBSD$
#

PORTNAME=	QuakeForge
PORTVERSION=	0.5.4
PORTREVISION=	2
CATEGORIES=	games
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:S/$/:qf/} \
		ftp://ftp.idsoftware.com/idstuff/quakeworld/unix/:qw
MASTER_SITE_SUBDIR=	quake/:qf
DISTNAME=	quakeforge-${PORTVERSION}
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:qf ${PROGFILE}:qw
EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
.if !defined(NO_WAD)
MASTER_SITES+=	http://www.libsdl.org/projects/quake/data/:wad
DISTFILES+=	${WADFILE}:wad
.endif
.if !defined(NO_SKINS)
MASTER_SITES+=	ftp://ftp.idsoftware.com/idstuff/quakeworld/skins/:skins
DISTFILES+=	${SKINFILES:S/$/:skins/}
.endif

MAINTAINER=	q@uni.de
COMMENT=	Cleaned up copy of the GPLd Quake 1 source code

WADFILE=	quakesw-1.0.6.tar.gz
PROGFILE=	qwsv-2.30-glibc-i386-unknown-linux2.0.tar.gz
SKINFILES=	skinbase.zip qw_skins.zip

USE_LIBTOOL=	yes
USE_GMAKE=	yes
USE_XLIB=	yes
USE_REINPLACE=	yes
INSTALLS_SHLIB=	yes

.include <bsd.port.pre.mk>

CONFIGURE_ARGS+=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL} \
		--with-global-cfg=${PREFIX}/etc/quakeforge.conf \
		--with-sharepath=${PREFIX}/share/quakeforge \
		--disable-optimize

CONFIGURE_TARGET=

BUILD_DEPENDS=	bison:${PORTSDIR}/devel/bison

.if defined(WITH_OPTIMIZED_CFLAGS) && !defined(WITHOUT_OPTIMIZED_CFLAGS)
CFLAGS+=	-O3 -funroll-loops -fomit-frame-pointer -fno-common \
		-fexpensive-optimizations -fstrict-aliasing
.if ${ARCH} != "alpha"
CFLAGS+=	-ffast-math
.endif
.endif

.if exists(${LOCALBASE}/lib/libSDL-1.1.so.5)
WITH_SDL=	yes
.endif

.if exists(${LOCALBASE}/lib/libvga.so.1)
WITH_SVGALIB=	yes
.endif

.if exists(${X11BASE}/lib/libxmms.so.4)
WITH_XMMS=	yes
.endif

.if exists(${LOCALBASE}/lib/libvorbis.so.3)
WITH_VORBIS=	yes
.endif

.if defined(WITHOUT_SERVERS)
CONFIGURE_ARGS+=--without-servers
PLIST_SUB+=	SERVER:="@comment "
.else
PLIST_SUB+=	SERVER:=""
.endif

.if defined(WITHOUT_TOOLS)
CONFIGURE_ARGS+=--without-tools
PLIST_SUB+=	TOOL:="@comment "
.else
PLIST_SUB+=	TOOL:=""
MAN1=	pak.1 qfcc.1 qflight.1 qfvis.1
.endif

.if defined(WITHOUT_CLIENTS)
CONFIGURE_ARGS+=--without-clients
PLIST_SUB+=	CLIENT:="@comment "
WITHOUT_XMMS=	yes
WITHOUT_SVGALIB=	yes
WITHOUT_SDL=	yes
WITHOUT_VORBIS=	yes
.else
PLIST_SUB+=	CLIENT:=""
.endif

.if !defined(WITHOUT_SVGALIB) && defined(WITH_SVGALIB)
LIB_DEPENDS+=	vga.1:${PORTSDIR}/graphics/svgalib
CONFIGURE_ARGS+=--with-svga=${LOCALBASE}
PLIST_SUB+=	SVGA:=""
.else
CONFIGURE_ARGS+=--without-svga
PLIST_SUB+=	SVGA:="@comment "
.endif

.if !defined(WITHOUT_VORBIS) && defined(WITH_VORBIS)
LIB_DEPENDS+=	vorbis.3:${PORTSDIR}/audio/libvorbis
CONFIGURE_ARGS+=--with-ogg=${LOCALBASE} --with-vorbis=${LOCALBASE}
PLIST_SUB+=	VORBIS:=""
.else
CONFIGURE_ARGS+=--disable-vorbis --without-ogg --without-ogg-libraries \
		--without-ogg-includes	--disable-oggtest
PLIST_SUB+=	VORBIS:="@comment "
.endif

.if !defined(WITHOUT_XMMS) && defined(WITH_XMMS)
LIB_DEPENDS+=	xmms.4:${PORTSDIR}/multimedia/xmms
CONFIGURE_ARGS+=--with-xmms-prefix=${X11BASE}
PLIST_SUB+=	XMMS:=""
.else
CONFIGURE_ARGS+=--disable-xmms
PLIST_SUB+=	XMMS:="@comment "
.endif

.if !defined(WITHOUT_SDL) && defined(WITH_SDL)
USE_SDL=	yes
CONFIGURE_ARGS+=--with-sdl=${LOCALBASE}
PLIST_SUB+=	SDL:=""
.else
CONFIGURE_ARGS+=--disable-sdl --disable-sdltest
PLIST_SUB+=	SDL:="@comment "
.endif

.if !defined(NO_WAD)
PLIST_SUB+=	WAD:=""
.else
PLIST_SUB+=	WAD:="@comment "
.endif

.if !defined(NO_SKINS)
PLIST_SUB+=	SKIN:=""
BUILD_DEPENDS+=	unzip:${PORTSDIR}/archivers/unzip
.else
PLIST_SUB+=	SKIN:="@comment "
.endif

pre-everything::
.if !defined(NO_WAD)
	@${ECHO_MSG} "Define NO_WAD to stop from using shareware version!"
.endif
.if !defined(NO_SKINS)
	@${ECHO_MSG} "Define NO_SKINS to stop from installing skins"
.endif
.if !defined(WITH_OPTIMIZED_CFLAGS)
	@${ECHO_MSG} "Define WITH_OPTIMIZED_CFLAGS to optimize for speed"
.endif
.if !defined(WITH_SVGALIB)
	@${ECHO_MSG} "Define WITH_SVGALIB to use svgalib"
.endif
.if !defined(WITH_VORBIS)
	@${ECHO_MSG} "Define WITH_VORBIS to use Ogg Vorbis"
.endif
.if !defined(WITH_XMMS)
	@${ECHO_MSG} "Define WITH_XMMS to use XMMS"
.endif
.if !defined(WITH_SDL)
	@${ECHO_MSG} "Define WITH_SDL to use SDL"
.endif
.if !defined(WITHOUT_TOOLS)
	@${ECHO_MSG} "Define WITHOUT_TOOLS to disable building of additional tools"
.endif
.if !defined(WITHOUT_SERVERS)
	@${ECHO_MSG} "Define WITHOUT_SERVERS to disable building of the servers"
.endif
.if !defined(WITHOUT_CLIENTS)
	@${ECHO_MSG} "Define WITHOUT_CLIENTS to disable building of the clients"
.endif

post-patch:
	@${REINPLACE_CMD} -e 's/-lpthread/${PTHREAD_LIBS}/g' ${WRKSRC}/configure

do-install:
	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
.if !defined(NO_WAD)
	${MKDIR} ${PREFIX}/share/quakeforge/id1 && \
	${TAR} xzf ${DISTDIR}/${WADFILE} -C ${PREFIX}/share/quakeforge --no-same-owner id1/pak0.pak
.endif
.if !defined(WITHOUT_SERVERS)
	${TAR} xzf ${DISTDIR}/${PROGFILE} -C ${PREFIX}/share/quakeforge qw/
.endif
.if !defined(NO_SKINS)
.for file in ${SKINFILES}
	unzip -n ${DISTDIR}/${file} -d ${PREFIX}/share/quakeforge/qw/skins
.endfor
	@cd ${PREFIX}/share/quakeforge/qw/skins && ./fixskins.sh *
.endif
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}/config ${DOCSDIR}/data/docs ${DOCSDIR}/ideas
	cd ${WRKSRC}/doc && \
		${INSTALL_MAN} *.txt *.q1 *.q2 *.ico *.gif *.fig *.h CodingStyle ${DOCSDIR} && \
		${INSTALL_MAN} config/*.cfg ${DOCSDIR}/config && \
		${INSTALL_MAN} data/*.txt ${DOCSDIR}/data && \
		${INSTALL_MAN} data/docs/* ${DOCSDIR}/data/docs && \
		${INSTALL_MAN} ideas/*.txt ${DOCSDIR}/ideas
.endif

post-install:
	@${SED} -e 's#$${PREFIX}#${PREFIX}#g' ${PKGMESSAGE}

.include <bsd.port.post.mk>