# ChangeLog for games-fps/quake2-icculus
-# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.10 2004/11/27 15:46:27 wolf31o2 Exp $
+# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.11 2005/01/03 23:52:32 vapier Exp $
+
+*quake2-icculus-0.16 (03 Jan 2005)
+
+ 03 Jan 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/0.16-Makefile-gentoo-opts.patch, +files/0.16-gentoo-path.patch,
+ +files/0.16-rogue-nan.patch, +quake2-icculus-0.16.ebuild:
+ Version bump. Also update the gentoo path patch to fix game .so searching
+ #42389 and video .so searching #60752.
*quake2-icculus-0.15-r2 (27 Nov 2004)
Hash: SHA1
MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158
-MD5 c0a49046e3c3c6e2e811e8942d612042 ChangeLog 1923
-MD5 4629ea4966dc9abe936b00c3e94d9142 quake2-icculus-0.15-r2.ebuild 5334
-MD5 2219e82edb75f4e2a9fa232afc365c5d files/0.15-Makefile-gcc3.patch 787
-MD5 ad5de2e8c5c06b69b3b5a2dd926a758f files/0.15-Makefile-optflags.patch 260
+MD5 76f7823250576f7a3162d81e32eb8e9d ChangeLog 2258
+MD5 8f6b3287fa0cd22f48ef314aeedd4039 quake2-icculus-0.16.ebuild 4271
+MD5 f288af0e2522875c78b0962df03705b4 quake2-icculus-0.15-r2.ebuild 5332
+MD5 c5a30b68d4f251a28b005d64f9d52482 files/0.16-gentoo-path.patch 3493
MD5 fa58facee98afc741e1928b77be65065 files/README-postinstall 2695
-MD5 d767ab81dded19a075fc660fdd3f83fd files/0.15-Makefile-noopts.patch 766
-MD5 44cf8825897944b4bec1d7169ca0b441 files/0.15-gentoo-path.patch 1708
+MD5 5b009d6ae138bf55ab1d37db69326724 files/digest-quake2-icculus-0.16 248
+MD5 183390437d587db8cb815bfc1ac2ecbb files/0.16-Makefile-gentoo-opts.patch 249
+MD5 a9abc17ddbcfc3e70d9b57276eaccfba files/0.16-rogue-nan.patch 242
MD5 c95a6c91b14235134b9ac58fdee7c5eb files/digest-quake2-icculus-0.15-r2 248
MD5 120a7c909d5da60c01928a64b62c56a3 files/0.15-Makefile-amd64.patch 2905
+MD5 2219e82edb75f4e2a9fa232afc365c5d files/0.15-Makefile-gcc3.patch 787
+MD5 d767ab81dded19a075fc660fdd3f83fd files/0.15-Makefile-noopts.patch 766
+MD5 ad5de2e8c5c06b69b3b5a2dd926a758f files/0.15-Makefile-optflags.patch 260
MD5 8f9b425244542bcbc17b3b3864869b0c files/0.15-amd64.patch 358
+MD5 44cf8825897944b4bec1d7169ca0b441 files/0.15-gentoo-path.patch 1708
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.10 (GNU/Linux)
-iD8DBQFB2OzvroRuSHgZdywRArXLAJ955u16Kq2Tb/TRER+mgkELzGpb4ACfSqhd
-InianCv403gKYf8CkSdAKYc=
-=mWOf
+iD8DBQFB2drWroRuSHgZdywRAmAWAJ970WJ8Ck4HUDm7ptrpAAVcz1pAzwCfVpR1
+YeMcQAHKUgbKpw3VAujwiwI=
+=Z/26
-----END PGP SIGNATURE-----
--- /dev/null
+--- Makefile.orig 2005-01-03 02:02:43.817859176 -0500
++++ Makefile 2005-01-03 02:02:45.050671760 -0500
+@@ -149,6 +149,7 @@
+ endif
+
+ DEBUG_CFLAGS=$(BASE_CFLAGS) -g
++RELEASE_CFLAGS=$(BASE_CFLAGS) $(OPTCFLAGS)
+
+ ifeq ($(OSTYPE),FreeBSD)
+ LDFLAGS=-lm
--- /dev/null
+--- src/qcommon/files.c.orig 2004-01-02 01:55:47.219787792 -0500
++++ src/qcommon/files.c 2004-01-02 01:55:55.622510384 -0500
+@@ -0,0 +0,1 @@
++#include "../linux/gentoo-paths.h"
+@@ -60,6 +60,7 @@
+
+ char fs_gamedir[MAX_OSPATH];
+ cvar_t *fs_basedir;
++cvar_t *fs_libdir;
+ cvar_t *fs_cddir;
+ cvar_t *fs_gamedirvar;
+
+@@ -696,6 +696,7 @@
+ if (fs_cddir->string[0])
+ FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
+ FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
++ FS_AddGameDirectory (va("%s/%s", fs_libdir->string, dir) );
+ FS_AddHomeAsGameDirectory(dir);
+ }
+ }
+@@ -898,7 +899,8 @@
+ // basedir <path>
+ // allows the game to run from outside the data tree
+ //
+- fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
++ fs_basedir = Cvar_Get ("basedir", GENTOO_DATADIR, CVAR_NOSET);
++ fs_libdir = Cvar_Get ("libdir", GENTOO_LIBDIR, CVAR_NOSET);
+
+ //
+ // cddir <path>
+@@ -913,6 +915,7 @@
+ // add baseq2 to search path
+ //
+ FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_basedir->string) );
++ FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_libdir->string) );
+
+ //
+ // then add a '.quake2/baseq2' directory in home directory by default
+--- src/linux/vid_so.c.orig 2004-01-02 10:37:46.527355832 -0500
++++ src/linux/vid_so.c 2004-01-02 10:39:23.890554376 -0500
+@@ -0,0 +0,1 @@
++#include "gentoo-paths.h"
+@@ -231,13 +232,17 @@
+ //regain root
+ seteuid(saved_euid);
+
+- path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
++ path = Cvar_Get ("basedir", GENTOO_DATADIR, CVAR_NOSET)->string;
+
+ snprintf (fn, MAX_OSPATH, "%s/%s", path, name );
+
+ if (stat(fn, &st) == -1) {
+- Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno));
+- return false;
++ path = Cvar_Get ("libdir", GENTOO_LIBDIR, CVAR_NOSET)->string;
++ snprintf (fn, MAX_OSPATH, "%s/%s", path, name );
++ if (stat(fn, &st) == -1) {
++ Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno));
++ return false;
++ }
+ }
+
+ // permission checking
+@@ -498,13 +498,19 @@
+ char *path;
+ struct stat st;
+
+- path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
++ path = Cvar_Get ("basedir", GENTOO_DATADIR, CVAR_NOSET)->string;
+ snprintf (fn, MAX_OSPATH, "%s/ref_%s.so", path, ref );
+
+ if (stat(fn, &st) == 0)
+ return true;
+- else
+- return false;
++ else {
++ path = Cvar_Get ("libdir", GENTOO_LIBDIR, CVAR_NOSET)->string;
++ snprintf (fn, MAX_OSPATH, "%s/ref_%s.so", path, ref );
++ if (stat(fn, &st) == 0)
++ return true;
++ else
++ return false;
++ }
+ }
+
+ /*****************************************************************************/
+--- src/linux/qgl_linux.c.orig 2005-01-03 18:12:07.504634768 -0500
++++ src/linux/qgl_linux.c 2005-01-03 18:13:47.662408472 -0500
+@@ -0,0 +0,1 @@
++#include "../linux/gentoo-paths.h"
+@@ -3006,13 +3006,17 @@
+ // dllname, dlerror());
+
+ // try basedir next
+- path = ri.Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
++ path = ri.Cvar_Get ("basedir", GENTOO_DATADIR, CVAR_NOSET)->string;
+
+ snprintf (fn, MAX_OSPATH, "%s/%s", path, dllname );
+
+ if ( ( glw_state.OpenGLLib = dlopen( fn, RTLD_LAZY ) ) == 0 ) {
+- ri.Con_Printf( PRINT_ALL, "%s\n", dlerror() );
+- return false;
++ path = ri.Cvar_Get ("libdir", GENTOO_LIBDIR, CVAR_NOSET)->string;
++ snprintf (fn, MAX_OSPATH, "%s/%s", path, dllname );
++ if ( ( glw_state.OpenGLLib = dlopen( fn, RTLD_LAZY ) ) == 0 ) {
++ ri.Con_Printf( PRINT_ALL, "%s\n", dlerror() );
++ return false;
++ }
+ }
+ Com_Printf ("Using %s for OpenGL...", fn);
+ } else {
--- /dev/null
+--- src/rogue/g_local.h.orig 2005-01-03 02:16:03.233329552 -0500
++++ src/rogue/g_local.h 2005-01-03 02:16:03.244327880 -0500
+@@ -24,3 +24,3 @@
+ #ifndef _WIN32
+-#include <nan.h>
++#include <bits/nan.h>
+ #define min(a,b) ((a) < (b) ? (a) : (b))
--- /dev/null
+MD5 e01b8842535415a76198f5fbb8a8ebf7 quake2-r0.16.tar.gz 1525908
+MD5 04d3f1fb7fb4dada7175a41f4595c7eb maxpak.pak 3282742
+MD5 7d5e052839c9e629bad0a6570aa70554 roguesrc320.shar.Z 626769
+MD5 41fc4ecc4f25c068e7d1f488bd4a1e1a xatrixsrc320.shar.Z 455917
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.15-r2.ebuild,v 1.1 2004/11/27 15:46:27 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.15-r2.ebuild,v 1.2 2005/01/03 23:52:32 vapier Exp $
inherit eutils gcc games
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.16.ebuild,v 1.1 2005/01/03 23:52:32 vapier Exp $
+
+inherit eutils games
+
+MY_P="quake2-r${PV}"
+DESCRIPTION="The icculus.org linux port of iD's quake2 engine"
+HOMEPAGE="http://icculus.org/quake2/"
+SRC_URI="http://icculus.org/quake2/files/${MY_P}.tar.gz
+ !noqmax? ( http://icculus.org/quake2/files/maxpak.pak )
+ rogue? ( ftp://ftp.idsoftware.com/idstuff/quake2/source/roguesrc320.shar.Z )
+ xatrix? ( ftp://ftp.idsoftware.com/idstuff/quake2/source/xatrixsrc320.shar.Z )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ppc sparc x86"
+IUSE="arts svga sdl aalib dedicated opengl noqmax rogue xatrix ipv6"
+
+# default to X11 if svga/opengl/sdl/aalib/dedicated are not in USE
+RDEPEND="virtual/libc
+ opengl? ( virtual/opengl )
+ svga? ( media-libs/svgalib )
+ sdl? ( media-libs/libsdl )
+ aalib? ( media-libs/aalib )
+ !svga? ( !opengl? ( !sdl? ( !aalib? ( !dedicated? ( virtual/x11 ) ) ) ) )
+ arts? ( kde-base/arts )"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4
+ app-arch/sharutils"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+ cd ${S}
+ epatch "${FILESDIR}"/${PV}-Makefile-gentoo-opts.patch
+ epatch "${FILESDIR}"/${PV}-gentoo-path.patch
+ cat << EOF > src/linux/gentoo-paths.h
+#define GENTOO_DATADIR "${GAMES_DATADIR}/quake2-data"
+#ifdef QMAX
+#define GENTOO_LIBDIR "${GAMES_LIBDIR}/${PN}-qmax"
+#else
+#define GENTOO_LIBDIR "${GAMES_LIBDIR}/${PN}"
+#endif
+EOF
+
+ # Now we deal with the silly rogue / xatrix addons ... this is ugly :/
+ ln -s $(which echo) "${T}"/more
+ for g in rogue xatrix ; do
+ use ${g} || continue
+ mkdir -p "${S}"/src/${g}
+ cd "${S}"/src/${g}
+ local shar=${g}src320.shar
+ unpack ${shar}.Z
+ sed -i \
+ -e 's:^read ans:ans=yes :' ${shar} \
+ || die "sed ${shar} failed"
+ echo ">>> Unpacking ${shar} to ${PWD}"
+ env PATH="${T}:${PATH}" unshar ${shar} || die "unpacking ${shar} failed"
+ rm ${shar}
+ done
+ use rogue && epatch ${FILESDIR}/${PV}-rogue-nan.patch
+}
+
+yesno() {
+ for f in "$@" ; do
+ if ! useq $f ; then
+ echo NO
+ return 1
+ fi
+ done
+ echo YES
+ return 0
+}
+
+src_compile() {
+ BUILD_X11=$(yesno X)
+ use sdl || use opengl || use svga || use aalib || BUILD_X11=YES
+
+ # xatrix fails to build
+ # rogue fails to build
+ for BUILD_QMAX in YES NO ; do
+ use noqmax && [ "${BUILD_QMAX}" == "YES" ] && continue
+ make clean || die "cleaning failed"
+ emake -j1 build_release \
+ BUILD_SDLQUAKE2=$(yesno sdl) \
+ BUILD_SVGA=$(yesno svga) \
+ BUILD_X11=${BUILD_X11} \
+ BUILD_GLX=$(yesno opengl) \
+ BUILD_SDL=$(yesno sdl) \
+ BUILD_SDLGL=$(yesno sdl opengl) \
+ BUILD_CTFDLL=YES \
+ BUILD_XATRIX=$(yesno xatrix) \
+ BUILD_ROGUE=$(yesno rogue) \
+ BUILD_JOYSTICK=$(yesno joystick) \
+ BUILD_DEDICATED=YES \
+ BUILD_AA=$(yesno aalib) \
+ BUILD_QMAX=${BUILD_QMAX} \
+ HAVE_IPV6=$(yesno ipv6) \
+ BUILD_ARTS=$(yesno arts) \
+ SDLDIR=/usr/lib \
+ OPTCFLAGS="${CFLAGS}" \
+ || die "make failed"
+ # now we save the build dir ... except for the object files ...
+ rm release*/*/*.o
+ mv release* my-rel-${BUILD_QMAX}
+ cd my-rel-${BUILD_QMAX}
+ rm -rf ref_{gl,soft} ded game client ctf/*.o
+ mkdir baseq2
+ mv game*.so baseq2/
+ cd ..
+ done
+}
+
+src_install() {
+ local q2dir=${GAMES_LIBDIR}/${PN}
+ local q2maxdir=${GAMES_LIBDIR}/${PN}-qmax
+
+ dodoc readme.txt README TODO ${FILESDIR}/README-postinstall
+
+ # regular q2 files
+ dodir ${q2dir}
+ cp -rf my-rel-NO/* ${D}/${q2dir}/
+ dogamesbin ${D}/${q2dir}/{quake2,q2ded}
+ rm ${D}/${q2dir}/{quake2,q2ded}
+ use sdl && dogamesbin ${D}/${q2dir}/sdlquake2 && rm ${D}/${q2dir}/sdlquake2
+
+ # q2max files
+ if ! use noqmax ; then
+ dodir ${q2maxdir}
+ cp -rf my-rel-YES/* ${D}/${q2maxdir}/
+ newgamesbin ${D}/${q2maxdir}/quake2 quake2-qmax
+ newgamesbin ${D}/${q2maxdir}/q2ded q2ded-qmax
+ rm ${D}/${q2maxdir}/{quake2,q2ded}
+ use sdl && newgamesbin ${D}/${q2maxdir}/sdlquake2 sdlquake2-qmax && rm ${D}/${q2maxdir}/sdlquake2
+
+ insinto ${q2maxdir}/baseq2
+ doins ${DISTDIR}/maxpak.pak
+ fi
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ einfo "Go read /usr/share/doc/${PF}/README-postinstall.gz right now!"
+ einfo "It's important- This install is just the engine, you still need"
+ einfo "the data paks. Go read."
+}