1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-05 06:27:37 +00:00

Further work on my beloved port:

- Rework the way we handle BASEDIR/LIBDIR, keeping ability to set basedir
  from command line.  Only ref_*.so files path left hardcoded
- Tiny fix for dedicated server build (Makefile typo)
- Most importantly, help Quake II always find libGL.so (no more LD_PRELOAD
  magic).  Bump PORTREVISION for that [*]
- Restore my nifty comments in pkg-plist

References:	http://utah-glx.sourceforge.net/faq.html#AEN262 [*]
This commit is contained in:
Alexey Dokuchaev 2006-03-21 16:24:32 +00:00
parent aa6b35679a
commit 29a8fa28da
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=157893
5 changed files with 35 additions and 16 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= quake2lnx
PORTVERSION= 0.16.2
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= games
MASTER_SITES= http://offload1.icculus.org/quake2/files/:icc \
http://www.icculus.org/quake2/files/:icc \
@ -48,7 +48,6 @@ OPTIONS= X11 "Build X11 software driver" on \
DATADIR= ${Q2DIR}
ALL_TARGET= build_release
MAKE_ENV= LIBDIR="${LIBDIR}"
PLIST_SUB+= LIBDIR="${LIBDIR:S/${PREFIX}\///}"
@ -240,6 +239,13 @@ post-extract:
${TAIL} +${${mp:U}_OFF} ${mp}src320.shar | ${SH})
.endfor
post-patch: .SILENT
${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}| ; \
s|%%LIBDIR%%|${LIBDIR}|' ${WRKSRC}/src/qcommon/files.c \
${WRKSRC}/src/linux/vid_so.c
${REINPLACE_CMD} -e 's|dllname, RTLD_LAZY|& \| RTLD_GLOBAL|' \
${WRKSRC}/src/linux/qgl_linux.c
do-install:
.for tgt in ${EXE_TARGETS}
${INSTALL_PROGRAM} ${TGTDIR}/${tgt} ${PREFIX}/bin

View File

@ -1,5 +1,5 @@
--- Makefile.orig Fri Sep 24 19:06:52 2004
+++ Makefile Fri Oct 7 17:37:25 2005
--- Makefile.orig Sat Sep 25 05:06:52 2004
+++ Makefile Tue Mar 21 19:18:24 2006
@@ -12,30 +12,30 @@
# (Note: not all options are available for all platforms).
# quake2 (uses OSS for sound, cdrom ioctls for cd audio) is automatically built.
@ -122,7 +122,7 @@
NULL_DIR=$(MOUNT_DIR)/null
-BASE_CFLAGS=-Wall -pipe -Dstricmp=strcasecmp
+BASE_CFLAGS=-pipe -Dstricmp=strcasecmp -DDATADIR='\"${DATADIR}\"' -DLIBDIR='\"${LIBDIR}\"' $(CFLAGS)
+BASE_CFLAGS=-pipe -Dstricmp=strcasecmp $(CFLAGS)
ifeq ($(HAVE_IPV6),YES)
BASE_CFLAGS+= -DHAVE_IPV6
ifeq ($(OSTYPE),FreeBSD)
@ -419,6 +419,15 @@
endif
$(BUILDDIR)/quake2 : $(QUAKE2_OBJS) $(QUAKE2_LNX_OBJS) $(QUAKE2_AS_OBJS)
@@ -719,7 +571,7 @@
$(DO_DED_CC)
$(BUILDDIR)/ded/q_shared.o : $(GAME_DIR)/q_shared.c
- $(DO_DED_DEBUG_CC)
+ $(DO_DED_CC)
$(BUILDDIR)/ded/pmove.o : $(COMMON_DIR)/pmove.c
$(DO_DED_CC)
@@ -821,7 +673,7 @@
$(BUILDDIR)/game/q_shared.o \
$(BUILDDIR)/game/m_flash.o

View File

@ -1,5 +1,5 @@
--- src/linux/vid_so.c.orig Fri Sep 24 19:11:44 2004
+++ src/linux/vid_so.c Tue Sep 27 19:28:29 2005
--- src/linux/vid_so.c.orig Tue Mar 21 19:43:33 2006
+++ src/linux/vid_so.c Tue Mar 21 19:47:12 2006
@@ -216,7 +216,6 @@
refimport_t ri;
GetRefAPI_t GetRefAPI;
@ -15,7 +15,7 @@
- path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
-
- snprintf (fn, MAX_OSPATH, "%s/%s", path, name );
+ snprintf (fn, MAX_OSPATH, LIBDIR"/%s", name );
+ snprintf (fn, MAX_OSPATH, "%%LIBDIR%%/%s", name );
if (stat(fn, &st) == -1) {
Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno));
@ -28,7 +28,7 @@
- path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
- snprintf (fn, MAX_OSPATH, "%s/ref_%s.so", path, ref );
+ snprintf (fn, MAX_OSPATH, LIBDIR"/ref_%s.so", ref );
+ snprintf (fn, MAX_OSPATH, "%%LIBDIR%%/ref_%s.so", ref );
if (stat(fn, &st) == 0)
return true;

View File

@ -1,12 +1,11 @@
--- src/qcommon/files.c.orig Sun Jan 2 00:38:12 2005
+++ src/qcommon/files.c Tue Sep 27 18:25:41 2005
@@ -912,7 +912,8 @@
//
--- src/qcommon/files.c.orig Tue Mar 21 19:36:01 2006
+++ src/qcommon/files.c Tue Mar 21 19:41:27 2006
@@ -913,6 +913,8 @@
// add baseq2 to search path
//
- FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_basedir->string) );
+ FS_AddGameDirectory(LIBDIR"/"BASEDIRNAME);
+ FS_AddGameDirectory(DATADIR"/"BASEDIRNAME);
FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_basedir->string) );
+ FS_AddGameDirectory ("%%LIBDIR%%/"BASEDIRNAME);
+ FS_AddGameDirectory ("%%DATADIR%%/"BASEDIRNAME);
//
// then add a '.quake2/baseq2' directory in home directory by default

View File

@ -1,6 +1,8 @@
@comment === EXECUTABLES ===
%%SERVER%%bin/q2ded
%%CLIENT%%bin/quake2
%%SDLCLIENT%%bin/sdlquake2
@comment === RENDERERS ===
%%GAME%%%%LIBDIR%%/baseq2/game.so
%%CTF%%%%LIBDIR%%/ctf/game.so
%%ROGUE%%%%LIBDIR%%/rogue/game.so
@ -11,10 +13,12 @@
%%AA%%%%LIBDIR%%/ref_softaa.so
%%SDL%%%%LIBDIR%%/ref_softsdl.so
%%X11%%%%LIBDIR%%/ref_softx.so
@comment === DOCS ===
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/README.320
%%PORTDOCS%%%%DOCSDIR%%/joystick.txt
%%PORTDOCS%%%%DOCSDIR%%/quake2.3dfxgl
@comment === DATA ===
%%QMAX%%%%DATADIR%%/baseq2/maxpak.pak
%%RETEX%%%%DATADIR%%/baseq2/pak10.pak
%%RETEX%%%%DATADIR%%/baseq2/pak11.pak
@ -24,6 +28,7 @@
%%RETEX%%%%DATADIR%%/baseq2/pak16.pak
%%RETEX%%%%DATADIR%%/baseq2/pak17.pak
%%RETEX%%%%DATADIR%%/baseq2/pak19.pak
@comment === CLEANUP ===
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%CTF%%@dirrm %%LIBDIR%%/ctf
%%GAME%%@dirrm %%LIBDIR%%/baseq2