# Distributed under the terms of the GNU General Public License v2
# $Header: $
-EAPI="3"
+EAPI=3
inherit games scons-utils
DESCRIPTION="Descent Rebirth - enhanced Descent 2 engine"
HOMEPAGE="http://www.dxx-rebirth.com/"
SRC_URI="mirror://sourceforge/dxx-rebirth/${PN}_v${PV}-src.tar.gz
- linguas_de? ( http://www.dxx-rebirth.com/download/dxx/res/d2xr-briefings-ger.zip )
- music? ( http://www.dxx-rebirth.com/download/dxx/res/d2xr-sc55-music.zip )"
+ linguas_de? ( http://www.dxx-rebirth.com/download/dxx/res/d2xr-briefings-ger.zip )
+ music_awe32? ( http://www.dxx-rebirth.com/download/dxx/res/d2xr-awe32enh-music.zip )
+ music_opl3? ( http://www.dxx-rebirth.com/download/dxx/res/d2xr-opl3-music.zip )
+ music_sc55? ( http://www.dxx-rebirth.com/download/dxx/res/d2xr-sc55-music.zip )"
LICENSE="D1X GPL-2 as-is"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE="debug ipv6 linguas_de music opengl"
+IUSE="debug editor ipv6 linguas_de music_awe32 music_opl3 music_sc55 opengl"
DEPEND="dev-games/physfs[hog,mvl,zip]
media-libs/libsdl
- media-libs/sdl-mixer"
+ media-libs/sdl-mixer[vorbis]"
RDEPEND="${DEPEND}
- virtual/opengl
- virtual/glu"
+ opengl? ( virtual/opengl virtual/glu )"
S=${WORKDIR}/${PN}_v${PV}-src
src_unpack() {
+ # We need unpack only sources. Keep zipped mods intact!
unpack ${PN}_v${PV}-src.tar.gz
}
-src_prepare() {
- epatch "${FILESDIR}"/${P}-printf-fix.patch
-}
-
src_compile() {
scons ${MAKEOPTS} \
sharepath="${GAMES_DATADIR}/d2x" \
sdlmixer=1 \
+ use_tracker=1 \
+ use_udp=1 \
$(use_scons debug) \
- $(use_scons !opengl sdl_only) \
+ $(use_scons editor) \
+ $(use_scons opengl) \
$(use_scons ipv6)
}
src_install() {
- edos2unix INSTALL.txt README.txt
- dodoc INSTALL.txt README.txt
+ edos2unix {INSTALL,README}.txt
+ dodoc {INSTALL,README}.txt
insinto "${GAMES_DATADIR}/d2x"
- use linguas_de && doins "${DISTDIR}"/d2xr-briefings-ger.zip
- use music && doins "${DISTDIR}"/d2xr-sc55-music.zip
+ use linguas_de && doins "${DISTDIR}"/d2xr-briefings-ger.zip
+ use music_awe32 && doins "${DISTDIR}"/d2xr-awe32enh-music.zip
+ use music_opl3 && doins "${DISTDIR}"/d2xr-opl3-music.zip
+ use music_sc55 && doins "${DISTDIR}"/d2xr-sc55-music.zip
doicon ${PN}.xpm
- if use opengl ; then
- newgamesbin d2x-rebirth-gl d2x-rebirth
- else
- newgamesbin d2x-rebirth-sdl d2x-rebirth
- fi
+ dogamesbin d2x-rebirth
make_desktop_entry d2x-rebirth "Descent 2 Rebirth" ${PN}
prepgamesdirs
}
+++ /dev/null
-=== modified file 'arch/sdl/jukebox.c'
---- arch/sdl/jukebox.c 2010-09-26 13:15:20 +0000
-+++ arch/sdl/jukebox.c 2010-10-14 14:46:20 +0000
-@@ -164,7 +164,7 @@
- if (PHYSFS_isDirectory(GameCfg.CMLevelMusicPath)) // it's a child of Sharepath, build full path
- {
- PHYSFSX_getRealPath(GameCfg.CMLevelMusicPath,abspath);
-- snprintf(GameCfg.CMLevelMusicPath,sizeof(char)*PATH_MAX,abspath);
-+ snprintf(GameCfg.CMLevelMusicPath,sizeof(char)*PATH_MAX,"%s",abspath);
- }
- }
-
-
-=== modified file 'include/cfile.h'
---- include/cfile.h 2010-09-25 03:35:23 +0000
-+++ include/cfile.h 2010-10-14 14:46:20 +0000
-@@ -45,7 +45,7 @@
- {
- char hogname2[PATH_MAX], pathname[PATH_MAX];
-
-- snprintf(hogname2, strlen(hogname)+1, hogname);
-+ snprintf(hogname2, strlen(hogname)+1, "%s", hogname);
- PHYSFSEXT_locateCorrectCase(hogname2);
-
- if (!PHYSFSX_getRealPath(hogname2, pathname))
-@@ -58,7 +58,7 @@
- {
- char hogname2[PATH_MAX], pathname[PATH_MAX];
-
-- snprintf(hogname2, strlen(hogname)+1, hogname);
-+ snprintf(hogname2, strlen(hogname)+1, "%s", hogname);
- PHYSFSEXT_locateCorrectCase(hogname2);
-
- if (!PHYSFSX_getRealPath(hogname2, pathname))
-@@ -74,7 +74,7 @@
- char hogname2[PATH_MAX];
- int size;
-
-- snprintf(hogname2, strlen(hogname)+1, hogname);
-+ snprintf(hogname2, strlen(hogname)+1, "%s", hogname);
- PHYSFSEXT_locateCorrectCase(hogname2);
-
- fp = PHYSFS_openRead(hogname2);
-
-=== modified file 'main/console.c'
---- main/console.c 2010-02-08 14:28:12 +0000
-+++ main/console.c 2010-10-14 14:46:20 +0000
-@@ -82,7 +82,7 @@
- con_add_buffer_line(priority, buffer);
-
- /* Print output to stdout */
-- printf(buffer);
-+ printf("%s",buffer);
-
- /* Print output to gamelog.txt */
- if (gamelog_fp)
-
-=== modified file 'main/hud.c'
---- main/hud.c 2010-08-03 15:03:56 +0000
-+++ main/hud.c 2010-10-14 14:46:20 +0000
-@@ -154,7 +154,7 @@
- {
- HUD_nmessages++;
- }
-- snprintf(HUD_messages[HUD_nmessages-1].message, sizeof(char)*HUD_MESSAGE_LENGTH, message);
-+ snprintf(HUD_messages[HUD_nmessages-1].message, sizeof(char)*HUD_MESSAGE_LENGTH, "%s", message);
- if (HUD_nmessages-HUD_MAX_NUM_DISP < 0)
- HUD_messages[HUD_nmessages-1].time = F1_0*3; // one message - display 3 secs
- else
-
-=== modified file 'main/menu.c'
---- main/menu.c 2010-10-14 09:50:11 +0000
-+++ main/menu.c 2010-10-14 14:46:20 +0000
-@@ -1606,9 +1606,9 @@
- char old_CMLevelMusicPath[PATH_MAX+1], old_CMMiscMusic0[PATH_MAX+1];
-
- memset(old_CMLevelMusicPath, 0, sizeof(char)*(PATH_MAX+1));
-- snprintf(old_CMLevelMusicPath, strlen(GameCfg.CMLevelMusicPath)+1, GameCfg.CMLevelMusicPath);
-+ snprintf(old_CMLevelMusicPath, strlen(GameCfg.CMLevelMusicPath)+1, "%s", GameCfg.CMLevelMusicPath);
- memset(old_CMMiscMusic0, 0, sizeof(char)*(PATH_MAX+1));
-- snprintf(old_CMMiscMusic0, strlen(GameCfg.CMMiscMusic[SONG_TITLE])+1, GameCfg.CMMiscMusic[SONG_TITLE]);
-+ snprintf(old_CMMiscMusic0, strlen(GameCfg.CMMiscMusic[SONG_TITLE])+1, "%s", GameCfg.CMMiscMusic[SONG_TITLE]);
-
- MALLOC(m, newmenu_item, SOUND_MENU_NITEMS);
- if (!m)
-
-=== modified file 'main/mission.c'
---- main/mission.c 2010-08-24 14:02:38 +0000
-+++ main/mission.c 2010-10-14 14:46:20 +0000
-@@ -716,19 +716,19 @@
- {
- char *tmp, *ptr;
- MALLOC(tmp, char, FILENAME_LEN);
-- snprintf(tmp, FILENAME_LEN, v);
-+ snprintf(tmp, FILENAME_LEN, "%s", v);
- if ((ptr = strrchr(tmp, '.'))) // if there's a filename extension, kill it. No one knows it's the right one.
- *ptr = '\0';
- strncat(tmp, ".tex", sizeof(char)*FILENAME_LEN); // apply tex-extenstion
- if (cfexist(tmp)) // check if this file exists ...
-- snprintf(Briefing_text_filename, FILENAME_LEN, tmp); // ... and apply ...
-+ snprintf(Briefing_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ...
- else // ... otherwise ...
- {
- if ((ptr = strrchr(tmp, '.')))
- *ptr = '\0';
- strncat(tmp, ".txb", sizeof(char)*FILENAME_LEN); // apply txb extension
- if (cfexist(tmp)) // check if this file exists ...
-- snprintf(Briefing_text_filename, FILENAME_LEN, tmp); // ... and apply ...
-+ snprintf(Briefing_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ...
- }
- d_free(tmp);
- }
-@@ -741,19 +741,19 @@
- {
- char *tmp, *ptr;
- MALLOC(tmp, char, FILENAME_LEN);
-- snprintf(tmp, FILENAME_LEN, v);
-+ snprintf(tmp, FILENAME_LEN, "%s", v);
- if ((ptr = strrchr(tmp, '.'))) // if there's a filename extension, kill it. No one knows it's the right one.
- *ptr = '\0';
- strncat(tmp, ".tex", sizeof(char)*FILENAME_LEN); // apply tex-extenstion
- if (cfexist(tmp)) // check if this file exists ...
-- snprintf(Briefing_text_filename, FILENAME_LEN, tmp); // ... and apply ...
-+ snprintf(Briefing_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ...
- else // ... otherwise ...
- {
- if ((ptr = strrchr(tmp, '.')))
- *ptr = '\0';
- strncat(tmp, ".txb", sizeof(char)*FILENAME_LEN); // apply txb extension
- if (cfexist(tmp)) // check if this file exists ...
-- snprintf(Ending_text_filename, FILENAME_LEN, tmp); // ... and apply ...
-+ snprintf(Ending_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ...
- }
- d_free(tmp);
- }
-
-=== modified file 'main/net_ipx.c'
---- main/net_ipx.c 2010-09-01 17:01:51 +0000
-+++ main/net_ipx.c 2010-10-14 14:46:20 +0000
-@@ -5824,7 +5824,7 @@
- if(!netgame->mission_title)
- info+=sprintf(info,"Descent2: CounterStrike");
- else
-- info+=sprintf(info,netgame->mission_title);
-+ info+=sprintf(info,"%s",netgame->mission_title);
-
- info+=sprintf (info," - Lvl %i",netgame->levelnum);
- info+=sprintf (info,"\n\nDifficulty: %s",MENU_DIFFICULTY_TEXT(netgame->difficulty));
-
-=== modified file 'main/net_udp.c'
---- main/net_udp.c 2010-09-01 17:01:51 +0000
-+++ main/net_udp.c 2010-10-14 14:46:20 +0000
-@@ -5183,7 +5183,7 @@
- if(!netgame->mission_title)
- info+=sprintf(info,"Descent2: CounterStrike");
- else
-- info+=sprintf(info,netgame->mission_title);
-+ info+=sprintf(info,"%s",netgame->mission_title);
-
- info+=sprintf (info," - Lvl %i",netgame->levelnum);
- info+=sprintf (info,"\n\nDifficulty: %s",MENU_DIFFICULTY_TEXT(netgame->difficulty));
-
-=== modified file 'main/scores.c'
---- main/scores.c 2010-07-31 12:09:38 +0000
-+++ main/scores.c 2010-10-14 14:46:20 +0000
-@@ -91,7 +91,7 @@
- int i;
-
- // No error message needed, code will work without a scores file
-- sprintf( scores->cool_saying, COOL_SAYING );
-+ sprintf( scores->cool_saying, "%s", COOL_SAYING );
- sprintf( scores->stats[0].name, "Parallax" );
- sprintf( scores->stats[1].name, "Matt" );
- sprintf( scores->stats[2].name, "Mike" );
-
-=== modified file 'misc/physfsx.c'
---- misc/physfsx.c 2010-09-25 13:55:22 +0000
-+++ misc/physfsx.c 2010-10-14 14:46:20 +0000
-@@ -304,7 +304,7 @@
- filename++;
- }
-
-- snprintf(filename2, strlen(filename)+1, filename);
-+ snprintf(filename2, strlen(filename)+1, "%s", filename);
- PHYSFSEXT_locateCorrectCase(filename2);
-
- fp = PHYSFS_openRead(filename2);
-