summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2012-03-28 22:32:18 +0000
committerAlfredo Tupone <tupone@gentoo.org>2012-03-28 22:32:18 +0000
commit6d4dbfaf240a7d55239a631ff7af79969d37ba3f (patch)
treeffa3439257c7f3cfbfe3ab880b78c422d6f0334e /games-fps
parentDrop unused patches. (diff)
downloadhistorical-6d4dbfaf240a7d55239a631ff7af79969d37ba3f.tar.gz
historical-6d4dbfaf240a7d55239a631ff7af79969d37ba3f.tar.bz2
historical-6d4dbfaf240a7d55239a631ff7af79969d37ba3f.zip
Re-add alsa use flag. Patch from bug #158415
Package-Manager: portage-2.1.10.51/cvs/Linux i686
Diffstat (limited to 'games-fps')
-rw-r--r--games-fps/quake2-icculus/ChangeLog8
-rw-r--r--games-fps/quake2-icculus/Manifest13
-rw-r--r--games-fps/quake2-icculus/files/quake2-icculus-0.16.1-alsa.patch172
-rw-r--r--games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild12
4 files changed, 192 insertions, 13 deletions
diff --git a/games-fps/quake2-icculus/ChangeLog b/games-fps/quake2-icculus/ChangeLog
index 195ccb3ce1c6..4df46fbabb65 100644
--- a/games-fps/quake2-icculus/ChangeLog
+++ b/games-fps/quake2-icculus/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for games-fps/quake2-icculus
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.42 2011/07/27 10:24:01 tupone Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.43 2012/03/28 22:32:18 tupone Exp $
+
+ 28 Mar 2012; Tupone Alfredo <tupone@gentoo.org>
+ quake2-icculus-0.16.1-r1.ebuild, +files/quake2-icculus-0.16.1-alsa.patch:
+ Re-add alsa use flag. Patch from bug #158415 by Grzegorz {NineX} Krzystek
27 Jul 2011; Tupone Alfredo <tupone@gentoo.org>
quake2-icculus-0.16.1-r1.ebuild:
diff --git a/games-fps/quake2-icculus/Manifest b/games-fps/quake2-icculus/Manifest
index c05b451d96f2..33a2d9784ba9 100644
--- a/games-fps/quake2-icculus/Manifest
+++ b/games-fps/quake2-icculus/Manifest
@@ -4,6 +4,7 @@ Hash: SHA1
AUX 0.16-rogue-armor.patch 312 RMD160 3b3da747164b3f3f5e7c6d7eeae103856237a1a3 SHA1 941b80ef9fd7c921799b5a4c066003bee6f4ddc0 SHA256 8198edf3c33d04cfe1cbde0ac64174f85614b1952478c39ad5986736057145a2
AUX 0.16-rogue-nan.patch 242 RMD160 b95d2ff792831da963ae782cc0bca706b1ce62ce SHA1 dadb29e8644e228575c1397cbf36cacb1ea64032 SHA256 9de64221141c8e9e2c519504176029a57ad627ca9b68830e53d53db31f01a3c0
AUX README-postinstall 3083 RMD160 fc8094e39bf5ed779fdd4c5e2b911422e69d03da SHA1 2faf360f81683b78a47fab6a069325e9c24fda49 SHA256 90f8cce0737adf8a95afac11ca30911a59801659cb5ebf29943792586eed1a45
+AUX quake2-icculus-0.16.1-alsa.patch 4455 RMD160 8ab7af7a5a2c9b229ee8a91000c0483b03926007 SHA1 84cf9f3a3a277cceed516799c3b485c18f6ed44b SHA256 1beb982fa6ed920917fac92953ff3dda8437a8da3b55be7d2a41ca3019061cc4
AUX quake2-icculus-0.16.1-amd64.patch 534 RMD160 ad9193d1977ac2c0036e30022b198e5ff8b850dd SHA1 16776e9c7edf09e190393dd5c6646db1c4680bd1 SHA256 e95aeace865f089b6c1c9e0c362da407d1bd603147fb6886b9c13b37218c3a37
AUX quake2-icculus-0.16.1-gcc41.patch 364 RMD160 b85910d79a8e7e2cc71da21f5f22e331b94c0719 SHA1 3c80e62267223fbf83aa2f7ce73fcf6eba0297c9 SHA256 1010f97c15f202de682f56ac372cc342299f1e6c20e9072d8fa346a1469adf72
AUX quake2-icculus-0.16.1-gentoo-paths.patch 7688 RMD160 db521205c1d787fb31262d1710a57b7da50194a9 SHA1 dcf87cd07cade4b31251a63834819c131cfb81c2 SHA256 22d47f76fe1f06028088d2b7d9b1bc0bf1c91c559149859373af29f467ed2ea9
@@ -14,13 +15,13 @@ DIST maxpak.pak 3282742 RMD160 6b5223fee63dbb2c886e3c1e39d9e157d65f589f SHA1 eca
DIST quake2-r0.16.1.tar.gz 1525384 RMD160 dbbf9cad08ab381e0c2cd037e317104085455c23 SHA1 9226acadc896ddc9924c6b7f9b71857078af5dba SHA256 49f4d3d53772b6ffd7733506f5d121c7893bfd8884133bfc36a28039c0744642
DIST roguesrc320.shar.Z 626769 RMD160 767c5b1a7a1123370e9c924282656dfdcc6cebba SHA1 7c5cadde75f5353622552cd28501ce60ac83dca2 SHA256 ceefb2fd748961cb0bc3244220f3eb09d8f7b8ca2eb32cdf9b284727a2fdc919
DIST xatrixsrc320.shar.Z 455917 RMD160 357182dcd760a95b27942cdf807ba1242bcb1160 SHA1 ec67b6d2be623dd344c100869fc48bcbadea927a SHA256 94bf596cd85d38ea294b99ccb0ebb5e4b9776cca335001b3803e2d8407395589
-EBUILD quake2-icculus-0.16.1-r1.ebuild 5453 RMD160 5edf8327e7918278307238e43bbeb7f960962cbf SHA1 bc91a2f1b7f3208bce9480fdf70b7576dc875f3f SHA256 ceffc00b9c5b3c1c4e840c8c10486a1d8d5361cb025de1008a84862c59b98bd2
-MISC ChangeLog 7545 RMD160 874d4a211a356e1acc8c1a003007fc0f772665f7 SHA1 b929d65a6b6c69fed1214221119addf5f797d47a SHA256 7c9ecc4883035fade41d8c35db79087d75c027b359089b56674802d397581da2
+EBUILD quake2-icculus-0.16.1-r1.ebuild 5526 RMD160 f95a2789adb1d4815adeb13edf561f5767938aeb SHA1 e60e3f16a6bbefa720db1fecb52ac33d59397489 SHA256 697a5f65803939e1ca185fade1b01f39631fba56603a81ed72ff05d0ec9b7e43
+MISC ChangeLog 7748 RMD160 8629e15db7f6c6391831e4ab06b0fed5a8b4edda SHA1 5fe8217bc4cdce9aeb429ee8639f22877935f214 SHA256 ddf34a5c4407378df864ae4c047d5c9e98d7fe53974f496243a2341425a59b5c
MISC metadata.xml 513 RMD160 1dc52f937a6d3f1e62131171345cd429c4f080cf SHA1 01cfd49cdfd38befba81acae82c76c52edc38b31 SHA256 0608a118c068c5cb15473fc3ee2c6338b6a6330ee2063d1d2b6864c57a761e2c
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.18 (GNU/Linux)
-iEYEARECAAYFAk4v5ywACgkQIY77eQFFFC2AXACdF7k5KpnknRFHSTnc/eRB6w+a
-nt0An3L3WOpY+ctCo4S2XsX7qH5WD9/A
-=h0ZB
+iEYEARECAAYFAk9zkX0ACgkQIY77eQFFFC34swCfaqtARRBF7oXNlawlVtXShIci
++pQAoJ+u1f4NdDN8QzGNMZuomBvrR5gL
+=GIaw
-----END PGP SIGNATURE-----
diff --git a/games-fps/quake2-icculus/files/quake2-icculus-0.16.1-alsa.patch b/games-fps/quake2-icculus/files/quake2-icculus-0.16.1-alsa.patch
new file mode 100644
index 000000000000..bab60d3b8f42
--- /dev/null
+++ b/games-fps/quake2-icculus/files/quake2-icculus-0.16.1-alsa.patch
@@ -0,0 +1,172 @@
+--- src/linux/snd_alsa.c.old 2012-03-28 19:22:06.533174832 +0200
++++ src/linux/snd_alsa.c 2012-03-28 19:22:19.670009575 +0200
+@@ -22,13 +22,22 @@
+ $Id: quake2-icculus-0.16.1-alsa.patch,v 1.1 2012/03/28 22:32:18 tupone Exp $
+ */
+
+-#define BUFFER_SIZE 4096
++// quake2-r0.16.1/src/linux/snd_alsa.c 2010-08-29 09:58:50
++// Alsa Redux Patch
++#define BUFFER_SIZE 16384
+
+ #include <alsa/asoundlib.h>
+
+ #include "../client/client.h"
+ #include "../client/snd_loc.h"
+
++#define AFSize 4
++static int snd_inited=0;
++static snd_pcm_t *playback_handle;
++static int AlsaFrames;
++static int AlsaPos;
++
++/*
+ #define snd_buf BUFFER_SIZE
+
+ static int snd_inited;
+@@ -43,17 +52,58 @@
+ cvar_t *snddevice;
+
+ static int tryrates[] = { 44100, 22051, 11025, 8000 };
+-
++*/
+ qboolean SNDDMA_Init (void)
+ {
+- int i;
+- int err;
+- int buffersize;
+- int framesize;
+- int format;
++ int confirm;
++ int latency;
++ Com_Printf("Setting up ALSA driver .....\n");
+
+ if (snd_inited) { return 1; }
+-
++ int s_khz=(Cvar_Get("s_khz", "22", CVAR_ARCHIVE))->value;
++ if (s_khz <22 ){
++ Com_Printf("Low Performance 11KHz.\n");
++ Cvar_Set("s_mixahead","0.2");
++ dma.speed=11025;
++ AlsaFrames=2048;
++ latency=200000;
++ }else{
++ Com_Printf("High Quality 48KHz.\n");
++ Cvar_Set("s_mixahead","0.1");
++ dma.speed=48000;
++ AlsaFrames=4800;
++ latency=110000;}
++
++ dma.channels = 2;
++ dma.samplebits = 16;
++ AlsaPos = 0;
++ playback_handle = NULL;
++ confirm =
++snd_pcm_open(&playback_handle,"default",SND_PCM_STREAM_PLAYBACK,SND_PCM_NONBLOCK);
++ if (confirm < 0) {
++ Com_Printf("ALSA sound error: cannot open device \n");
++ return 0;}
++ confirm = snd_pcm_set_params(playback_handle,
++ SND_PCM_FORMAT_S16_LE,
++ SND_PCM_ACCESS_RW_INTERLEAVED,
++ dma.channels,
++ dma.speed,
++ 1,//soft resample
++ latency);
++ if (confirm < 0){
++ Com_Printf("Alsa error: %s\n", snd_strerror(confirm));
++ return 0;}
++ confirm = snd_pcm_prepare(playback_handle);
++ if (confirm < 0) {
++ Com_Printf("...failed.\n");
++ return 0;}
++
++ int rambuffer = (BUFFER_SIZE+AlsaFrames)*AFSize;
++ dma.buffer=malloc(rambuffer);
++ dma.samplepos = 0;
++ dma.samples = BUFFER_SIZE*dma.channels;
++ dma.submission_chunk = 16;
++ /*
+ sndbits = Cvar_Get("sndbits", "16", CVAR_ARCHIVE);
+ sndspeed = Cvar_Get("sndspeed", "0", CVAR_ARCHIVE);
+ sndchannels = Cvar_Get("sndchannels", "2", CVAR_ARCHIVE);
+@@ -159,7 +209,6 @@
+ return 0;
+ }
+
+- /*
+ buffer_size = snd_pcm_hw_params_get_buffer_size(hw_params);
+ frame_size = (snd_pcm_format_physical_width(format)*dma.channels)/8;
+
+@@ -172,7 +221,6 @@
+ }
+
+ snd_buf = buffer_size*frame_size;
+- */
+
+ //snd_buf = BUFFER_SIZE;
+
+@@ -183,7 +231,7 @@
+ dma.samples = snd_buf / (dma.samplebits/8);
+ dma.submission_chunk = 1;
+ dma.buffer = (char *)buffer;
+-
++ */
+ snd_inited = 1;
+ return 1;
+ }
+@@ -191,11 +239,25 @@
+ int
+ SNDDMA_GetDMAPos (void)
+ {
+- if(snd_inited)
+- return dma.samplepos;
+- else
+- Com_Printf ("Sound not inizialized\n");
+- return 0;
++ int timerpos;
++ int send;
++ int taken;
++ timerpos = snd_pcm_avail(playback_handle);
++ if (timerpos<0){// likely buffer underrun.
++ timerpos = snd_pcm_prepare(playback_handle);
++ timerpos=0;}
++
++ send=AlsaFrames-timerpos;
++ if ( (send+AlsaPos)>BUFFER_SIZE )
++ { memcpy (dma.buffer+BUFFER_SIZE*AFSize,
++ dma.buffer,AlsaFrames*AFSize);}
++ taken = snd_pcm_writei(playback_handle, dma.buffer+AlsaPos*AFSize, send);
++ if (taken<0) {taken=0;}
++
++ AlsaPos+=taken;
++ if (BUFFER_SIZE<=AlsaPos){AlsaPos -= BUFFER_SIZE;}
++ return AlsaPos*dma.channels;
++
+ }
+
+ void
+@@ -205,8 +267,8 @@
+ snd_pcm_drop(playback_handle);
+ snd_pcm_close(playback_handle);
+ snd_inited = 0;
++ free(dma.buffer);
+ }
+- free(dma.buffer);
+ dma.buffer = NULL;
+ }
+
+@@ -217,13 +279,6 @@
+ void
+ SNDDMA_Submit (void)
+ {
+- int written;
+-
+- if ((written = snd_pcm_writei(playback_handle, dma.buffer, snd_buf)) < 0) {
+- snd_pcm_prepare(playback_handle);
+- Com_Printf("alsa: buffer underrun\n");
+- }
+- dma.samplepos += written/(dma.samplebits/8);
+ }
+
+
diff --git a/games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild b/games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild
index cf3b284911c3..0186fcef5b33 100644
--- a/games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild
+++ b/games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 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-r1.ebuild,v 1.23 2011/07/27 10:24:01 tupone Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild,v 1.24 2012/03/28 22:32:18 tupone Exp $
EAPI=2
inherit eutils toolchain-funcs games
@@ -16,9 +16,10 @@ SRC_URI="http://icculus.org/quake2/files/${MY_P}.tar.gz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="ppc sparc x86 ~x86-fbsd"
-IUSE="aalib cdinstall dedicated demo ipv6 joystick opengl qmax rogue sdl svga X xatrix"
+IUSE="aalib alsa cdinstall dedicated demo ipv6 joystick opengl qmax rogue sdl svga X xatrix"
UIDEPEND="aalib? ( media-libs/aalib )
+ alsa? ( media-libs/alsa-lib )
opengl? ( virtual/opengl )
svga? ( media-libs/svgalib )
sdl? ( media-libs/libsdl[audio,joystick?,video] )
@@ -78,7 +79,8 @@ src_prepare() {
"${FILESDIR}"/${P}-amd64.patch \
"${FILESDIR}"/${P}-gentoo-paths.patch \
"${FILESDIR}"/${P}-ldflags.patch \
- "${FILESDIR}"/${P}-no-asm-io.patch #193107
+ "${FILESDIR}"/${P}-no-asm-io.patch \
+ "${FILESDIR}"/${P}-alsa.patch
if use xatrix ; then
epatch "${FILESDIR}/${P}"-gcc41.patch
@@ -128,7 +130,7 @@ src_compile() {
BUILD_QMAX=${BUILD_QMAX} \
HAVE_IPV6=$(yesno ipv6) \
BUILD_ARTS=NO \
- BUILD_ALSA=NO \
+ BUILD_ALSA=$(yesno alsa) \
SDLDIR=/usr/lib \
DEFAULT_BASEDIR="${GAMES_DATADIR}/quake2" \
DEFAULT_LIBDIR="$(games_get_libdir)/${PN}${libsuffix}" \