From 671887596b0acdfa0ad0f12159fcffbcaf89dfef Mon Sep 17 00:00:00 2001 From: Max Khon Date: Sat, 28 Jun 2003 08:02:23 +0000 Subject: Allow client to be run from any directory. Submitted by: MAINTAINER --- games/quake2lnx/Makefile | 6 +++++- games/quake2lnx/files/patch-qcommon::files.c | 14 ++++++++++++++ games/quake2lnx/pkg-message | 15 +++++++-------- 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 games/quake2lnx/files/patch-qcommon::files.c diff --git a/games/quake2lnx/Makefile b/games/quake2lnx/Makefile index 0d2bf56138a8..ed42bc466dcc 100644 --- a/games/quake2lnx/Makefile +++ b/games/quake2lnx/Makefile @@ -25,6 +25,7 @@ MAINTAINER= danfe@regency.nsu.ru COMMENT= Cleaned up copy of the original Quake II source code USE_GMAKE= yes +USE_REINPLACE= yes .include @@ -240,6 +241,9 @@ pre-everything:: TGTDIR= ${WRKSRC}/release${ARCH} +post-patch: + @${REINPLACE_CMD} -e 's|%%%%BASEDIR%%%%|${DATADIR}|' ${WRKSRC}/src/qcommon/files.c + do-build: @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} \ ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} build_release) @@ -274,6 +278,6 @@ do-install: .endif post-install: - @${SED} -e 's#$${PREFIX}#${PREFIX}#g' ${PKGMESSAGE} + @${SED} -e 's|$${DATADIR}|${DATADIR}|g' ${PKGMESSAGE} .include diff --git a/games/quake2lnx/files/patch-qcommon::files.c b/games/quake2lnx/files/patch-qcommon::files.c new file mode 100644 index 000000000000..a9af2f9de20b --- /dev/null +++ b/games/quake2lnx/files/patch-qcommon::files.c @@ -0,0 +1,14 @@ +--- qcommon/files.c.orig Wed Oct 9 03:54:25 2002 ++++ qcommon/files.c Sat Jun 28 12:30:57 2003 +@@ -898,7 +898,11 @@ + // basedir + // allows the game to run from outside the data tree + // ++#ifdef DEDICATED_ONLY + fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET); ++#else ++ fs_basedir = Cvar_Get ("basedir", "%%%%BASEDIR%%%%", CVAR_NOSET); ++#endif + + // + // cddir diff --git a/games/quake2lnx/pkg-message b/games/quake2lnx/pkg-message index c9aed33cea09..3b8e61e983ef 100644 --- a/games/quake2lnx/pkg-message +++ b/games/quake2lnx/pkg-message @@ -1,13 +1,12 @@ =================================================== Install additional mission paks and mods in - ${PREFIX}/share/quake2lnx/ directory and be - sure to run executable binary from there as - well (that is, [sdl]quake2). You also must - own full registered version of Quake II, or - rebuild the port with -DWITH_SHAREWARE_DATA - defined to install demo version data files. - Note that you don't need full version to be - able to run dedicated server. + ${DATADIR}/ directory. + + You must also own full (registered) version + of Quake II, or rebuild the port with "make + -DWITH_SHAREWARE_DATA" to install demo ver- + sion data files. Note that you do not need + full version to run dedicated server. =================================================== -- cgit v1.2.3