summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Swanson2019-09-18 15:33:38 -0700
committerMike Swanson2019-09-18 15:33:38 -0700
commit02fc8fdc7c722f108516f47dc9c03aac4a2f1758 (patch)
tree11efe5134cd0642b33c8785bb83b2a993618fdd7
parent233a6624aeff17f5919e1b3d76e16006c875e30d (diff)
downloadaur-02fc8fdc7c722f108516f47dc9c03aac4a2f1758.tar.gz
Include a fix for recent SDL versions
-rw-r--r--.SRCINFO6
-rw-r--r--0001-Fix-crashes-under-SDL-2.0.9-for-Linux.patch81
-rw-r--r--PKGBUILD8
3 files changed, 89 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 457c72b4ea95..1d674307107f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Sat Mar 17 20:55:25 UTC 2018
pkgbase = eternity-engine
pkgdesc = An advanced Doom port with vanilla compatibility
pkgver = 4.00.00
- pkgrel = 1
+ pkgrel = 2
url = http://eternity.youfailit.net/
arch = i686
arch = x86_64
@@ -14,7 +12,9 @@ pkgbase = eternity-engine
depends = sdl2_net
depends = zlib
source = https://github.com/team-eternity/eternity/archive/4.00.00.tar.gz
+ source = 0001-Fix-crashes-under-SDL-2.0.9-for-Linux.patch
sha512sums = 1d78e8db65d8d2da4bea00944304ec4d6bbfab90d6ef913c1e1d64f7cbf6162284f5861e3356c501731ab3b8708e8310286f16e8430aeb50d79cfc2bd8ff7a9f
+ sha512sums = 1eeeefe1dd2fba0a1cb8799dc6eaaaa8989b84d0c79107ba792387fbba14a5453eb23aa83b3635f86e137dd305abf5c7f21fe1a761daaca955fc07bedcf87228
pkgname = eternity-engine
diff --git a/0001-Fix-crashes-under-SDL-2.0.9-for-Linux.patch b/0001-Fix-crashes-under-SDL-2.0.9-for-Linux.patch
new file mode 100644
index 000000000000..7099bd776f7f
--- /dev/null
+++ b/0001-Fix-crashes-under-SDL-2.0.9-for-Linux.patch
@@ -0,0 +1,81 @@
+From 574447e0806322f8def7f82bb9110253f0e9da27 Mon Sep 17 00:00:00 2001
+From: Max Waine <bobishmax@hotmail.com>
+Date: Mon, 18 Feb 2019 13:58:07 +0000
+Subject: [PATCH] Fix crashes under SDL 2.0.9 for Linux
+
+Achieved by changing how mixbuffer_size is calculated.
+---
+ source/sdl/i_sdlsound.cpp | 43 ++++++---------------------------------
+ 1 file changed, 6 insertions(+), 37 deletions(-)
+
+diff --git a/source/sdl/i_sdlsound.cpp b/source/sdl/i_sdlsound.cpp
+index 11b2008a..6eec181e 100644
+--- a/source/sdl/i_sdlsound.cpp
++++ b/source/sdl/i_sdlsound.cpp
+@@ -742,32 +742,6 @@ static void I_SDLCacheSound(sfxinfo_t *sound)
+ S_CacheDigitalSoundLump(sound);
+ }
+
+-static void I_SDLDummyCallback(void *, Uint8 *, int) {}
+-
+-//
+-// I_SDLTestSoundBufferSize
+-//
+-// This shouldn't be necessary except for really bad API design.
+-//
+-static Uint32 I_SDLTestSoundBufferSize()
+-{
+- Uint32 ret = 0;
+- SDL_AudioSpec want, have;
+- want.freq = snd_samplerate;
+- want.format = MIX_DEFAULT_FORMAT;
+- want.channels = 2;
+- want.samples = audio_buffers;
+- want.callback = I_SDLDummyCallback;
+-
+- if(SDL_OpenAudio(&want, &have) >= 0)
+- {
+- ret = have.size;
+- SDL_CloseAudio();
+- }
+-
+- return ret;
+-}
+-
+ //
+ // I_SDLInitSound
+ //
+@@ -787,16 +761,11 @@ static int I_SDLInitSound()
+ if(!I_IsSoundBufferSizePowerOf2(audio_buffers))
+ audio_buffers = I_MakeSoundBufferSize(audio_buffers);
+
+- // Figure out mix buffer sizes
+- mixbuffer_size = I_SDLTestSoundBufferSize() / SAMPLESIZE;
+- if(!mixbuffer_size)
+- {
+- printf("Couldn't determine sound mixing buffer size.\n");
+- nosfxparm = true;
+- nomusicparm = true;
+- return 0;
+- }
+-
++ // Figure out mix buffer sizes by dividing the results of SDL_audio.c's
++ // SDL_CalculateAudioSpec size calculation by SAMPLESIZE. The 2 is number of channels.
++ mixbuffer_size = ((SDL_AUDIO_BITSIZE(MIX_DEFAULT_FORMAT) / 8) * 2 * audio_buffers) /
++ SAMPLESIZE;
++
+ if(Mix_OpenAudio(snd_samplerate, MIX_DEFAULT_FORMAT, 2, audio_buffers) < 0)
+ {
+ printf("Couldn't open audio with desired format.\n");
+@@ -804,7 +773,7 @@ static int I_SDLInitSound()
+ nomusicparm = true;
+ return 0;
+ }
+-
++
+ // haleyjd 10/02/08: this must be done as early as possible.
+ I_SetChannels();
+
+--
+2.23.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 920af7429c8a..aedba23b69db 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,15 +2,17 @@
pkgname=eternity-engine
pkgver=4.00.00
-pkgrel=1
+pkgrel=2
pkgdesc="An advanced Doom port with vanilla compatibility"
url="http://eternity.youfailit.net/"
arch=('i686' 'x86_64')
license=('GPL3')
depends=('sdl2' 'sdl2_mixer' 'sdl2_net' 'zlib')
makedepends=('cmake')
-source=(https://github.com/team-eternity/eternity/archive/${pkgver}.tar.gz)
-sha512sums=('1d78e8db65d8d2da4bea00944304ec4d6bbfab90d6ef913c1e1d64f7cbf6162284f5861e3356c501731ab3b8708e8310286f16e8430aeb50d79cfc2bd8ff7a9f')
+source=(https://github.com/team-eternity/eternity/archive/${pkgver}.tar.gz
+ 0001-Fix-crashes-under-SDL-2.0.9-for-Linux.patch)
+sha512sums=('1d78e8db65d8d2da4bea00944304ec4d6bbfab90d6ef913c1e1d64f7cbf6162284f5861e3356c501731ab3b8708e8310286f16e8430aeb50d79cfc2bd8ff7a9f'
+ '1eeeefe1dd2fba0a1cb8799dc6eaaaa8989b84d0c79107ba792387fbba14a5453eb23aa83b3635f86e137dd305abf5c7f21fe1a761daaca955fc07bedcf87228')
prepare() {
cd "eternity-${pkgver}"