summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-07-23 00:57:02 +0000
committerRoy Marples <uberlord@gentoo.org>2006-07-23 00:57:02 +0000
commit3bb7e868925dd1e78fbe4e0508dd47be030da005 (patch)
tree007c05483690135bce29b3179fe9ad39b605fcd9 /games-rpg
parentAdd ~x86-fbsd keyword. (diff)
downloadgentoo-2-3bb7e868925dd1e78fbe4e0508dd47be030da005.tar.gz
gentoo-2-3bb7e868925dd1e78fbe4e0508dd47be030da005.tar.bz2
gentoo-2-3bb7e868925dd1e78fbe4e0508dd47be030da005.zip
Added patches to fix fonts and clean compile against all portage OpenAL
versions. (Portage version: 2.1.1_pre3-r3)
Diffstat (limited to 'games-rpg')
-rw-r--r--games-rpg/eternal-lands/ChangeLog10
-rw-r--r--games-rpg/eternal-lands/eternal-lands-1.3.0-r2.ebuild123
-rw-r--r--games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r26
-rw-r--r--games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch36
-rw-r--r--games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch197
5 files changed, 371 insertions, 1 deletions
diff --git a/games-rpg/eternal-lands/ChangeLog b/games-rpg/eternal-lands/ChangeLog
index f7d6de469406..ffdbe24419a2 100644
--- a/games-rpg/eternal-lands/ChangeLog
+++ b/games-rpg/eternal-lands/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for games-rpg/eternal-lands
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/ChangeLog,v 1.23 2006/07/21 18:02:45 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/ChangeLog,v 1.24 2006/07/23 00:57:02 uberlord Exp $
+
+*eternal-lands-1.3.0-r2 (23 Jul 2006)
+
+ 23 Jul 2006; Roy Marples <uberlord@gentoo.org>
+ +files/eternal-lands-1.3.0-font.patch,
+ +files/eternal-lands-1.3.0-openal.patch, +eternal-lands-1.3.0-r2.ebuild:
+ Added patches to fix fonts and clean compile against all portage OpenAL
+ versions.
21 Jul 2006; Michael Sterrett <mr_bones_@gentoo.org>
eternal-lands-1.3.0-r1.ebuild:
diff --git a/games-rpg/eternal-lands/eternal-lands-1.3.0-r2.ebuild b/games-rpg/eternal-lands/eternal-lands-1.3.0-r2.ebuild
new file mode 100644
index 000000000000..eaa884c134e1
--- /dev/null
+++ b/games-rpg/eternal-lands/eternal-lands-1.3.0-r2.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/eternal-lands-1.3.0-r2.ebuild,v 1.1 2006/07/23 00:57:02 uberlord Exp $
+
+inherit eutils games
+
+MY_PV="${PV//_/}"
+MY_PV="${MY_PV//./}"
+S="${WORKDIR}/elc"
+DESCRIPTION="An online MMORPG written in C and SDL"
+HOMEPAGE="http://www.eternal-lands.com"
+SRC_URI="mirror://gentoo/elc_${MY_PV}.tar.bz2
+ mirror://gentoo/eternal-lands.png"
+
+# NOTE: Sometimes you'll have to roll your own elc tarball from their CVS
+# tree as they don't always release one.
+# If they do then use this in SRC_URI instead
+# ftp://ftp.berlios.de/pub/elc/elc_${MY_PV}.tgz
+
+LICENSE="eternal_lands"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+RDEPEND="
+ || ( (
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libXext )
+ virtual/x11 )
+ virtual/opengl
+ >=media-libs/libsdl-1.2.5
+ >=media-libs/sdl-net-1.2.5
+ ~media-libs/openal-0.0.8
+ media-libs/freealut
+ media-libs/libvorbis
+ >=dev-libs/libxml2-2.6.7
+ || ( =media-libs/cal3d-0.10.0 =media-libs/cal3d-0.11.0 )
+ >=media-libs/libpng-1.2.8
+ ~games-rpg/${PN}-data-${PV}"
+
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ sys-apps/findutils
+ doc? ( >=app-doc/doxygen-1.3.8
+ >=media-gfx/graphviz-1.10 )"
+
+src_unpack() {
+ OPTIONS="OPTIONS=-DDATA_DIR="\\\\\"${GAMES_DATADIR}/${PN}/\\\\\"""
+ S_CLIENT="${WORKDIR}/elc"
+ BROWSER="konqueror"
+
+ unpack ${A}
+ cd "${S}"
+
+ # Remove CVS entries
+ find . -type d -name CVS -exec rm -rf {} \; 2>/dev/null
+
+ # Create updated files with correct perms and allow dir creation
+ epatch "${FILESDIR}/${P}-update-createdir.patch"
+
+ # Get counters working
+ epatch "${FILESDIR}/${P}-counters.patch"
+
+ # Clean compile with all OpenAL versions
+ epatch "${FILESDIR}/${P}-openal.patch"
+
+ # Fix fonts
+ epatch "${FILESDIR}/${P}-font.patch"
+
+ use amd64 && OPTIONS="${OPTIONS} -DX86_64"
+ sed \
+ -e "s@CFLAGS=\$(PLATFORM) \$(CWARN) -O -ggdb -pipe@CFLAGS=${CFLAGS} @g"\
+ -e "s@CXXFLAGS=\$(PLATFORM) \$(CXXWARN) -O -ggdb -pipe@CXXFLAGS=${CXXFLAGS} @g"\
+ -e "s@OPTIONS=@${OPTIONS} @g" \
+ -e 's/lopenal/lopenal -l alut/' \
+ Makefile.linux > Makefile \
+ || die "sed failed"
+ sed -i \
+ -e 's/#browser/browser/g' \
+ -e "s/browser = mozilla/#browser = ${BROWSER}/g" \
+ -e "s@#data_dir = /usr/local/games/el/@#data_dir = ${GAMES_DATADIR}/${PN}/@g" \
+ el.ini || die "sed failed"
+}
+
+src_compile() {
+ emake || die "emake failed"
+ if use doc; then
+ emake docs || die "Failed to create documentation, try with USE=-doc"
+ mv ./docs/html/ ../client || die "Failed to move documentation directory"
+ fi
+}
+
+src_install() {
+ newgamesbin el.x86.linux.bin el || die "newgamesbin failed"
+ doicon "${DISTDIR}/eternal-lands.png"
+ make_desktop_entry el "Eternal Lands"
+
+ insopts -m 0660
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins *.ini *.txt commands.lst || die "doins failed"
+
+ if use doc ; then
+ dohtml -r client/*
+ fi
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ einfo "Auto Update is now enabled in Eternal Lands"
+ ewarn "If an update occurs then the client will suddenly exit"
+ einfo "Updates only happen when the game first loads"
+ einfo "Please don't report this behaviour as a bug"
+
+ # Ensure that the files are writable by the game group for auto
+ # updating.
+ chmod -R g+rw "${ROOT}/${GAMES_DATADIR}/${PN}"
+
+ # Make sure new files stay in games group
+ find "${ROOT}/${GAMES_DATADIR}/${PN}" -type d -exec chmod g+sx {} \;
+}
diff --git a/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r2 b/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r2
new file mode 100644
index 000000000000..2be8e9ed82f7
--- /dev/null
+++ b/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0-r2
@@ -0,0 +1,6 @@
+MD5 f83902ed603926a9611ace5914a3fdc0 elc_130.tar.bz2 849004
+RMD160 e5dc66b2db5203a13707170046874392e1908a06 elc_130.tar.bz2 849004
+SHA256 ffcd5779a0516e5ec3f6c1add718653284689023a92fcb9dfa3917076d8be140 elc_130.tar.bz2 849004
+MD5 059df8128b11b19a76b54e9907072f00 eternal-lands.png 9955
+RMD160 2f9c8acd96214577cf8b8027f0d20fb1fe7574ff eternal-lands.png 9955
+SHA256 dd7d45cd9948fe7875ebd0bfcd1925d9b34e7606a223faf61d37a6dd2cd433fb eternal-lands.png 9955
diff --git a/games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch
new file mode 100644
index 000000000000..f8b3e5584545
--- /dev/null
+++ b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-font.patch
@@ -0,0 +1,36 @@
+===================================================================
+RCS file: /cvsroot/elc/elc/font.c,v
+retrieving revision 1.69
+retrieving revision 1.70
+diff -u -r1.69 -r1.70
+--- elc/elc/font.c 2006/05/23 07:25:03 1.69
++++ elc/elc/font.c 2006/07/19 02:11:23 1.70
+@@ -995,22 +995,25 @@
+ poor_man=0;
+ use_mipmaps=0;
+
+-#ifndef FONTS_FIX
+ fonts[0]->texture_id = load_texture_cache ("./textures/font.bmp", 0);
++#ifndef FONTS_FIX
+ fonts[1]->texture_id = load_texture_cache ("./textures/fontv.bmp", 0);
+ fonts[2]->texture_id = load_texture_cache ("./textures/font2.bmp", 0);
+ fonts[3]->texture_id = load_texture_cache ("./textures/font3.bmp", 0);
+ #else
++ // Force the selection of the base font.
++ add_multi_option("chat_font", "Type 1");
++ add_multi_option("name_font", "Type 1");
+ // Find what font's exist and load them
+ dp = opendir ("./textures/");
+ if (dp == NULL) {
+ return 0;
+ }
+- i = 0;
++ i = 1;
+ while ((ep = readdir (dp)) && i < FONTS_ARRAY_SIZE) {
+ strcpy(file, "");
+ strcpy(file, ep->d_name);
+- if (!strncasecmp(file, "font", 4) && !strcasecmp(file+strlen(file) - 4, ".bmp") && strncasecmp(file+strlen(file) - 10, "_alpha", 6) && strlen(file) + 11 <= 60) {
++ if (!strncasecmp(file, "font", 4) && !strcasecmp(file+strlen(file) - 4, ".bmp") && strncasecmp(file+strlen(file) - 10, "_alpha", 6) && strlen(file) + 11 <= 60 && strlen(file) > 8) {
+ // Get the filename, remove the .bmp and add _alpha.bmp to a copy, then replace the .bmp
+ file[strlen(file) - 4] = 0;
+ snprintf(str, sizeof(str), "./textures/%s", file);
diff --git a/games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch
new file mode 100644
index 000000000000..f23d12b17b83
--- /dev/null
+++ b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-openal.patch
@@ -0,0 +1,197 @@
+diff -u -b -B -r1.83 sound.c
+--- sound.c 20 Jun 2006 15:05:46 -0000 1.83
++++ sound.c 24 Jun 2006 14:42:29 -0000
+@@ -308,6 +309,66 @@
+ #endif //NO_MUSIC
+ }
+
++int loadWAVfile(char *filename, ALenum *al_format, ALvoid **al_data, ALsizei *al_size, ALuint *al_frequency) {
++ FILE *fp;
++
++ fp = fopen(filename,"rb");
++ if (fp) {
++ char id[4];
++ Uint32 size;
++ Uint16 format_tag, channels, block_align, bits_per_sample;
++ Uint32 format_length, sample_rate, avg_bytes_sec, data_size;
++ fread(id, 1, 4, fp);
++ if (!strncmp(id, "RIFF",4)) {
++ fread(&size, 4, 1, fp);
++ fread(id, 1, 4, fp);
++ if (!strncmp(id,"WAVE",4)) {
++ fread(id, 1, 4, fp);
++ fread(&format_length, 4,1,fp);
++ fread(&format_tag, 2, 1, fp);
++ fread(&channels, 2, 1,fp); //1 mono, 2 stereo
++ channels=SDL_SwapLE16(channels);
++ fread(&sample_rate, 4, 1, fp); //like 44100, 22050, etc...
++ sample_rate=SDL_SwapLE32(sample_rate);
++ fread(&avg_bytes_sec, 4, 1, fp); //unused
++ fread(&block_align, 2, 1, fp); //unused
++ fread(&bits_per_sample, 2, 1, fp); //8 bit or 16 bit
++ bits_per_sample=SDL_SwapLE16(bits_per_sample);
++ fread(id, 1, 4, fp);
++ fread(&data_size, 4, 1, fp);
++ data_size=SDL_SwapLE32(data_size);
++ *al_data = (ALvoid *) malloc (data_size);
++ fread(*al_data, 1, data_size, fp);
++ *al_size = data_size;
++ *al_frequency = sample_rate;
++ if(channels == 1) {
++ if(bits_per_sample == 8)
++ *al_format = AL_FORMAT_MONO8;
++ else
++ *al_format = AL_FORMAT_MONO16;
++ } else {
++ if(bits_per_sample == 8)
++ *al_format = AL_FORMAT_STEREO8;
++ else
++ *al_format = AL_FORMAT_STEREO16;
++ }
++ return 1;
++ }
++ else {
++ LOG_ERROR("LoadWAVFile(%s): RIFF file but not a wave file\n",filename);
++ return 0;
++ }
++ }
++ else {
++ LOG_ERROR("LoadWAVFile(%s): not a RIFF file\n",filename);
++ return 0;
++ }
++ } else {
++ LOG_ERROR("LoadWAVFile(%s): can't open file\n",filename);
++ return 0;
++ }
++}
++
+ #ifndef NEW_SOUND
+ ALuint get_loaded_buffer(int i)
+ {
+@@ -315,26 +376,9 @@
+ ALsizei size,freq;
+ ALenum format;
+ ALvoid *data;
+- ALboolean loop;
+- FILE *fin;
+
+ if(!alIsBuffer(sound_buffer[i]))
+ {
+- // XXX FIXME (Grum): You have got to be kidding me...
+- // alutLoadWAVFile doesn't provide any way to check if loading
+- // a file succeeded. Well, at least, let's check if the file
+- // actually exists...
+- // Maybe use alutLoadWAV? But that doesn't seem to exist on
+- // OS/X...
+- fin = fopen (sound_files[i], "r");
+- if (fin == NULL)
+- {
+- LOG_ERROR(snd_wav_load_error, sound_files[i]);
+- return 0;
+- }
+- // okay, the file exists and is readable, close it
+- fclose (fin);
+-
+ alGenBuffers(1, sound_buffer+i);
+
+ if((error=alGetError()) != AL_NO_ERROR)
+@@ -344,14 +388,13 @@
+ have_music=0;
+ }
+
+-#ifdef OSX
+- // OS X alutLoadWAVFile doesn't have a loop option... Oh well :-)
+- alutLoadWAVFile (sound_files[i], &format, &data, &size, &freq);
+-#else
+- alutLoadWAVFile (sound_files[i], &format, &data, &size, &freq, &loop);
+-#endif
++ if(loadWAVfile(sound_files[i], &format, &data, &size, &freq)) {
+ alBufferData(sound_buffer[i],format,data,size,freq);
+- alutUnloadWAV(format,data,size,freq);
++ free(data);
++ } else {
++ alDeleteBuffers(1,sound_buffer+i);
++ return 0;
++ }
+ }
+ return sound_buffer[i];
+ }
+@@ -372,27 +415,10 @@
+ if (!pSample->loaded_status)
+ {//this file is not currently loaded
+
+- //try to open the file
+-#ifndef OSX
+- alutLoadWAVFile(szPath,&pSample->format,&data,&pSample->size,&pSample->freq,&loop);
+-#else
+- alutLoadWAVFile(szPath,&pSample->format,&data,&pSample->size,&pSample->freq);
+-#endif
+- if(!data)
+- {//couldn't load the file
+- #ifdef ELC
+- LOG_ERROR("%s: %s",snd_buff_error, "NO SOUND DATA");
+- #else
+- printf("ensure_sample_loaded : alutLoadWAVFile(%s) = %s\n",
+- szPath, "NO SOUND DATA");
+- #endif
+- return 1;
+- }
+-
+- //create a buffer
+ alGenBuffers(1, pBuffer);
++
+ if((error=alGetError()) != AL_NO_ERROR)
+- {//couldn't generate a buffer
++ {
+ #ifdef ELC
+ LOG_ERROR("%s: %s",snd_buff_error, alGetString(error));
+ #else
+@@ -401,15 +427,16 @@
+ *pBuffer=0;
+ return 2;
+ }
+- //send this data to the buffer
++
++ if(loadWAVFile(szPath,&pSample->format,&data,&pSample->size,&pSample->freq)) {
+ alBufferData(*pBuffer,pSample->format,data,pSample->size,pSample->freq);
+- if((error=alGetError()) != AL_NO_ERROR)
+- {
+- #ifdef ELC
++ //send this data to the buffer
++ if((error=alGetError()) != AL_NO_ERROR) {
++#ifdef ELC
+ LOG_ERROR("%s: %s",snd_buff_error, alGetString(error));
+- #else
++#else
+ printf("ensure_sample_loaded ['%s',#d]: alBufferData(%s) = %s\n",szPath, index, alGetString(error));
+- #endif
++#endif
+ alDeleteBuffers(1, pBuffer);
+ return 3;
+ }
+@@ -417,13 +444,21 @@
+ alGetBufferi(*pBuffer,AL_BITS,&pSample->bits);
+ alGetBufferi(*pBuffer,AL_CHANNELS,&pSample->channels);
+ pSample->length = (pSample->size*1000) / ((pSample->bits >> 3)*pSample->channels*pSample->freq);
+-
+- //get rid of the temporary data
+- alutUnloadWAV(pSample->format,data,pSample->size,pSample->freq);
+- }
++ free(data);
+
+ pSample->loaded_status = 1;
+ return 0;
++ } else {//couldn't load the file
++#ifdef ELC
++ LOG_ERROR("%s: %s",snd_buff_error, "NO SOUND DATA");
++#else
++ printf("ensure_sample_loaded : loadWAVFile(%s) = %s\n",
++ szPath, "NO SOUND DATA");
++#endif
++ return 1;
++ }
++
++ }
+ }
+ #endif //NEW_SOUND
+