Clean up the way we pass custom settings to the build system.
authorMike Frysinger <vapier@gentoo.org>
Mon, 29 Aug 2005 23:03:33 +0000 (23:03 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 29 Aug 2005 23:03:33 +0000 (23:03 +0000)
Package-Manager: portage-2.0.51.22-r2

games-fps/quake2-icculus/ChangeLog
games-fps/quake2-icculus/Manifest
games-fps/quake2-icculus/files/0.16-Makefile-gentoo-opts.patch [deleted file]
games-fps/quake2-icculus/files/0.16-gentoo-path.patch [deleted file]
games-fps/quake2-icculus/files/quake2-icculus-0.16.1-gentoo-paths.patch [new file with mode: 0644]
games-fps/quake2-icculus/quake2-icculus-0.16.1.ebuild

index 24bc7d2885a818b7674a3f3fe67a902bf9cc7a23..e6f0b36cb1b6618002b94446fb60121098d0cfe6 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for games-fps/quake2-icculus
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.14 2005/05/29 22:51:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.15 2005/08/29 23:03:33 vapier Exp $
+
+  29 Aug 2005; Mike Frysinger <vapier@gentoo.org>
+  -files/0.16-Makefile-gentoo-opts.patch, -files/0.16-gentoo-path.patch,
+  +files/quake2-icculus-0.16.1-gentoo-paths.patch,
+  quake2-icculus-0.16.1.ebuild:
+  Clean up the way we pass custom settings to the build system.
 
   29 May 2005; Mike Frysinger <vapier@gentoo.org>
   quake2-icculus-0.16.1.ebuild:
index 3c5bdf39f8eb2b6e5c63bd0b9e526e6ce3cface4..d904c4c2c0683a5eaadada7e9913eda7787a7141 100644 (file)
@@ -1,10 +1,19 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 dd678649c88314ba496e0aa6c1c906af quake2-icculus-0.16.1.ebuild 4361
 MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158
-MD5 59b204345881dc25e0a6868adfdb63f6 ChangeLog 2776
-MD5 f35a0cad351744b00c8ccbd749e77af0 quake2-icculus-0.16.1.ebuild 4434
-MD5 4b84093c6bccf958d3ca1b865c3f9402 files/quake2.xpm 1234
-MD5 c5a30b68d4f251a28b005d64f9d52482 files/0.16-gentoo-path.patch 3493
-MD5 74cb73011282b923820f35f8450ba583 files/README-postinstall 3083
+MD5 55cea7ea481f28e6cd568947af611878 ChangeLog 3047
 MD5 799bccbb58711b8831aeaeaa3142b965 files/digest-quake2-icculus-0.16.1 250
-MD5 183390437d587db8cb815bfc1ac2ecbb files/0.16-Makefile-gentoo-opts.patch 249
 MD5 a9abc17ddbcfc3e70d9b57276eaccfba files/0.16-rogue-nan.patch 242
+MD5 8682ec5707f752292cbb93b93652e383 files/quake2-icculus-0.16.1-gentoo-paths.patch 6859
+MD5 74cb73011282b923820f35f8450ba583 files/README-postinstall 3083
 MD5 2df7805117c32223db23d0ae9c61881e files/quake2-icculus-0.16.1-amd64.patch 534
+MD5 4b84093c6bccf958d3ca1b865c3f9402 files/quake2.xpm 1234
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDE5RVgIKl8Uu19MoRAnQxAJ9MlEc6mCuL073aJcV0/0e+fLIauACeOXYP
+0IVzLPcSi7TbttqLbX7Ex34=
+=b2jq
+-----END PGP SIGNATURE-----
diff --git a/games-fps/quake2-icculus/files/0.16-Makefile-gentoo-opts.patch b/games-fps/quake2-icculus/files/0.16-Makefile-gentoo-opts.patch
deleted file mode 100644 (file)
index 2a588f0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- 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
diff --git a/games-fps/quake2-icculus/files/0.16-gentoo-path.patch b/games-fps/quake2-icculus/files/0.16-gentoo-path.patch
deleted file mode 100644 (file)
index fe20ae0..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
---- 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 {
diff --git a/games-fps/quake2-icculus/files/quake2-icculus-0.16.1-gentoo-paths.patch b/games-fps/quake2-icculus/files/quake2-icculus-0.16.1-gentoo-paths.patch
new file mode 100644 (file)
index 0000000..5602dfa
--- /dev/null
@@ -0,0 +1,212 @@
+Index: Makefile
+===================================================================
+RCS file: /cvs/cvsroot/quake2/Makefile,v
+retrieving revision 1.56
+diff -u -p -r1.56 Makefile
+--- Makefile   5 May 2005 22:23:34 -0000       1.56
++++ Makefile   29 Aug 2005 22:52:28 -0000
+@@ -74,35 +74,38 @@ endif
+ 
+ CC=gcc
+ 
++ifndef OPT_CFLAGS
+ ifeq ($(ARCH),axp)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
++OPT_CFLAGS=-ffast-math -funroll-loops \
+       -fomit-frame-pointer -fexpensive-optimizations
+ endif
+ 
+ ifeq ($(ARCH),ppc)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \
++OPT_CFLAGS=-O2 -ffast-math -funroll-loops \
+       -fomit-frame-pointer -fexpensive-optimizations
+ endif
+ 
+ ifeq ($(ARCH),sparc)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
++OPT_CFLAGS=-ffast-math -funroll-loops \
+       -fomit-frame-pointer -fexpensive-optimizations
+ endif
+ 
+ ifeq ($(ARCH),i386)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops -falign-loops=2 \
++OPT_CFLAGS=-O2 -ffast-math -funroll-loops -falign-loops=2 \
+       -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing
+ # compiler bugs with gcc 2.96 and 3.0.1 can cause bad builds with heavy opts.
+-#RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -m486 -ffast-math -funroll-loops \
++#OPT_CFLAGS=-O6 -m486 -ffast-math -funroll-loops \
+ #     -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
+ #     -malign-jumps=2 -malign-functions=2
+ endif
+ 
+ ifeq ($(ARCH),x86_64)
+ _LIB := 64
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \
++OPT_CFLAGS=-O2 -ffast-math -funroll-loops \
+       -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing
+ endif
++endif
++RELEASE_CFLAGS=$(BASE_CFLAGS) $(OPT_CFLAGS)
+ 
+ VERSION=3.21+r0.16
+ 
+@@ -133,6 +136,13 @@ else
+ NET_UDP=net_udp
+ endif
+ 
++ifdef DEFAULT_BASEDIR
++BASE_CFLAGS += -DDEFAULT_BASEDIR=\\\"$(DEFAULT_BASEDIR)\\\"
++endif
++ifdef DEFAULT_LIBDIR
++BASE_CFLAGS += -DDEFAULT_LIBDIR=\\\"$(DEFAULT_LIBDIR)\\\"
++endif
++
+ ifeq ($(strip $(BUILD_QMAX)),YES)
+       BASE_CFLAGS+=-DQMAX
+ endif
+Index: src/linux/qgl_linux.c
+===================================================================
+RCS file: /cvs/cvsroot/quake2/src/linux/qgl_linux.c,v
+retrieving revision 1.9
+diff -u -p -r1.9 qgl_linux.c
+--- src/linux/qgl_linux.c      25 Sep 2002 13:39:58 -0000      1.9
++++ src/linux/qgl_linux.c      29 Aug 2005 22:52:28 -0000
+@@ -3006,13 +3006,17 @@ qboolean QGL_Init( const char *dllname )
+ //                            dllname, dlerror());
+ 
+               // try basedir next
+-              path = ri.Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
++              path = ri.Cvar_Get ("basedir", DEFAULT_BASEDIR, 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", DEFAULT_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 {
+Index: src/linux/vid_so.c
+===================================================================
+RCS file: /cvs/cvsroot/quake2/src/linux/vid_so.c,v
+retrieving revision 1.10
+diff -u -p -r1.10 vid_so.c
+--- src/linux/vid_so.c 24 Sep 2004 22:11:44 -0000      1.10
++++ src/linux/vid_so.c 29 Aug 2005 22:52:28 -0000
+@@ -237,13 +237,17 @@ qboolean VID_LoadRefresh( char *name )
+       //regain root
+       seteuid(saved_euid);
+ 
+-      path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
++      path = Cvar_Get ("basedir", DEFAULT_BASEDIR, 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", DEFAULT_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
+@@ -493,13 +497,19 @@ qboolean VID_CheckRefExists (const char 
+       char    *path;
+       struct stat st;
+ 
+-      path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
++      path = Cvar_Get ("libdir", DEFAULT_LIBDIR, 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 ("basedir", DEFAULT_BASEDIR, CVAR_NOSET)->string;
++              snprintf (fn, MAX_OSPATH, "%s/ref_%s.so", path, ref );
++              if (stat(fn, &st) == 0)
++                      return true;
++              else
++                      return false;
++      }
+ }
+ 
+ /*****************************************************************************/
+Index: src/qcommon/files.c
+===================================================================
+RCS file: /cvs/cvsroot/quake2/src/qcommon/files.c,v
+retrieving revision 1.11
+diff -u -p -r1.11 files.c
+--- src/qcommon/files.c        2 Jan 2005 03:38:12 -0000       1.11
++++ src/qcommon/files.c        29 Aug 2005 22:52:29 -0000
+@@ -60,6 +60,7 @@ typedef struct pack_s
+ 
+ char  fs_gamedir[MAX_OSPATH];
+ cvar_t        *fs_basedir;
++cvar_t        *fs_libdir;
+ cvar_t        *fs_cddir;
+ cvar_t        *fs_gamedirvar;
+ 
+@@ -681,6 +682,7 @@ void FS_SetGamedir (char *dir)
+               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 +900,13 @@ void FS_InitFilesystem (void)
+       // basedir <path>
+       // allows the game to run from outside the data tree
+       //
+-      fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
++      fs_basedir = Cvar_Get ("basedir", DEFAULT_BASEDIR, CVAR_NOSET);
++
++      //
++      // libdir <path>
++      // allows the game to store binary files (not data) in a sep tree
++      //
++      fs_libdir = Cvar_Get ("libdir", DEFAULT_LIBDIR, CVAR_NOSET);
+ 
+       //
+       // cddir <path>
+@@ -913,6 +921,7 @@ void FS_InitFilesystem (void)
+       // 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
+Index: src/qcommon/qcommon.h
+===================================================================
+RCS file: /cvs/cvsroot/quake2/src/qcommon/qcommon.h,v
+retrieving revision 1.5
+diff -u -p -r1.5 qcommon.h
+--- src/qcommon/qcommon.h      12 Apr 2005 13:12:21 -0000      1.5
++++ src/qcommon/qcommon.h      29 Aug 2005 22:52:29 -0000
+@@ -74,6 +74,13 @@ Foundation, Inc., 59 Temple Place - Suit
+ 
+ #endif
+ 
++#ifndef DEFAULT_BASEDIR
++# define DEFAULT_BASEDIR "."
++#endif
++#ifndef DEFAULT_LIBDIR
++# define DEFAULT_LIBDIR DEFAULT_BASEDIR
++#endif
++
+ //============================================================================
+ 
+ typedef struct sizebuf_s
index 8b8b4b5b1bfc0576a835d2ebeed4c61e7a7bf541..3af3656e1bd26d231ed7c2b0dd5b9c40332d4392 100644 (file)
@@ -1,6 +1,6 @@
 # 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.1.ebuild,v 1.5 2005/05/29 22:51:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.16.1.ebuild,v 1.6 2005/08/29 23:03:33 vapier Exp $
 
 inherit eutils games
 
@@ -34,16 +34,7 @@ src_unpack() {
        cd "${S}"
        sed -i -e 's:BUILD_SOFTX:BUILD_X11:' Makefile
        epatch "${FILESDIR}"/${P}-amd64.patch # make sure this is still needed in future versions
-       epatch "${FILESDIR}"/0.16-Makefile-gentoo-opts.patch
-       epatch "${FILESDIR}"/0.16-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
+       epatch "${FILESDIR}"/${P}-gentoo-path.patch
 
        # Now we deal with the silly rogue / xatrix addons ... this is ugly :/
        ln -s $(which echo) "${T}"/more
@@ -80,8 +71,12 @@ yesno() {
 src_compile() {
        # xatrix fails to build
        # rogue fails to build
+       local libsuffix
        for BUILD_QMAX in YES NO ; do
                use noqmax && [[ ${BUILD_QMAX} == "YES" ]] && continue
+               [[ ${BUILD_QMAX} == "YES" ]] \
+                       && libsuffix=-qmax \
+                       || libsuffix=
                make clean || die "cleaning failed"
                emake -j1 build_release \
                        BUILD_SDLQUAKE2=$(yesno sdl) \
@@ -100,7 +95,9 @@ src_compile() {
                        HAVE_IPV6=$(yesno ipv6) \
                        BUILD_ARTS=$(yesno arts) \
                        SDLDIR=/usr/lib \
-                       OPTCFLAGS="${CFLAGS}" \
+                       DEFAULT_BASEDIR="${GAMES_DATADIR}/quake2-data" \
+                       DEFAULT_LIBDIR="${GAMES_LIBDIR}/${PN}${libsuffix}" \
+                       OPT_CFLAGS="${CFLAGS}" \
                        || die "make failed"
                # now we save the build dir ... except for the object files ...
                rm release*/*/*.o