freebsd-ports/games/quakeforge/Makefile
Joe Marcus Clarke 9e5632dd66 Apply a big libtool patch to allow porters to use the libtool installed by
the libtoolX ports instead of the one included with each port.  Ports that
set USE_LIBTOOL_VER=X will now use the ports version of libtool instead of
the included version.  To restore previous behavior, use the new macro,
USE_INC_LIBTOOL_VER.  Both macros accept the same argument: a libtool version.

For example, to use the ports version of libtool-1.5, add the following to
your Makefile:

USE_LIBTOOL_VER=        15

To use the included version of libtool with extra hacks provided by
libtool-1.5, add the following to your Makefile:

USE_INC_LIBTOOL_VER=    15

With this change, ports that had to add additional libtool hacks to prevent
.la files from being installed or to fix certain threading issues can now
delete those hacks (after appropriate testing, of course).

PR:		63944
Based on work by:eik and marcus
Approved by:	ade (autotools maintainer)
Tested by:	kris on pointyhat
Bound to be hidden problems:	You bet
2004-07-09 17:43:11 +00:00

220 lines
5.7 KiB
Makefile

# 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_INC_LIBTOOL_VER=13
USE_GMAKE= yes
USE_XLIB= yes
USE_REINPLACE= yes
INSTALLS_SHLIB= yes
WANT_SDL= yes
.include <bsd.port.pre.mk>
.if ${ARCH} == "sparc64"
BROKEN= "Does not compile on sparc64"
.endif
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 ${HAVE_SDL:Msdl}!=""
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= sdl
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>