Updated SDL2 to use dlopen instead of load_add_on, as discussed on haikuports ML (#841)

* FIXED SDL2 2.0.4 patchset. SDL2 was no longer handling any events.

* Added recipe for SDL2 2.0.5

* Updated SDL to use dlopen instead of load_add_on for loading dynamic
libraries
This resolves issues with SDL2_mixer not finding required 3rd party
libs, such as libvorso.3

* Removed trailing whitespace
This commit is contained in:
ksterker
2016-10-31 04:19:18 +01:00
committed by waddlesplash
parent 2b592ebe85
commit e8ab4a7952
2 changed files with 79 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ software, emulators, and popular games."
HOMEPAGE="http://www.libsdl.org/"
COPYRIGHT="1997-2016 Sam Lantinga"
LICENSE="Zlib"
REVISION="1"
REVISION="2"
SOURCE_URI="http://www.libsdl.org/release/SDL2-$portVersion.tar.gz"
CHECKSUM_SHA256="442038cf55965969f2ff06d976031813de643af9c9edc9e331bd761c242e8785"
SOURCE_DIR="SDL2-$portVersion"
@@ -24,6 +24,7 @@ REQUIRES="
haiku$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libltdl$secondaryArchSuffix
"
PROVIDES_devel="
@@ -42,6 +43,7 @@ BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libgl$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libltdl$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:autoconf

View File

@@ -241,3 +241,79 @@ index 36c2a1a..4676c58 100644
--
2.8.0
diff -r fbf9b0e3589a configure
--- a/configure Sat Oct 22 17:53:03 2016 -0700
+++ b/configure Wed Oct 26 20:14:55 2016 +0200
@@ -23490,6 +23490,7 @@
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
+ CheckDLOPEN
CheckHaikuVideo
CheckHaikuGL
CheckPTHREAD
@@ -23518,14 +23519,6 @@
SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
have_timers=yes
fi
- # Set up files for the shared object loading library
- if test x$enable_loadso = xyes; then
-
-$as_echo "#define SDL_LOADSO_HAIKU 1" >>confdefs.h
-
- SOURCES="$SOURCES $srcdir/src/loadso/haiku/*.c"
- have_loadso=yes
- fi
# Set up files for the system power library
if test x$enable_power = xyes; then
diff -r fbf9b0e3589a configure.in
--- a/configure.in Sat Oct 22 17:53:03 2016 -0700
+++ b/configure.in Wed Oct 26 20:14:55 2016 +0200
@@ -3229,6 +3229,7 @@
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
+ CheckDLOPEN
CheckHaikuVideo
CheckHaikuGL
CheckPTHREAD
@@ -3251,12 +3252,6 @@
SOURCES="$SOURCES $srcdir/src/timer/haiku/*.c"
have_timers=yes
fi
- # Set up files for the shared object loading library
- if test x$enable_loadso = xyes; then
- AC_DEFINE(SDL_LOADSO_HAIKU, 1, [ ])
- SOURCES="$SOURCES $srcdir/src/loadso/haiku/*.c"
- have_loadso=yes
- fi
# Set up files for the system power library
if test x$enable_power = xyes; then
AC_DEFINE(SDL_POWER_HAIKU, 1, [ ])
diff -r fbf9b0e3589a src/dynapi/SDL_dynapi.c
--- a/src/dynapi/SDL_dynapi.c Sat Oct 22 17:53:03 2016 -0700
+++ b/src/dynapi/SDL_dynapi.c Wed Oct 26 20:14:55 2016 +0200
@@ -216,21 +216,7 @@
return retval;
}
-#elif defined(__HAIKU__)
-#include <os/kernel/image.h>
-static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym)
-{
- image_id lib = load_add_on(fname);
- void *retval = NULL;
- if (lib >= 0) {
- if (get_image_symbol(lib, sym, B_SYMBOL_TYPE_TEXT, &retval) != B_NO_ERROR) {
- unload_add_on(lib);
- retval = NULL;
- }
- }
- return retval;
-}
-#elif defined(unix) || defined(__unix__) || defined(__APPLE__)
+#elif defined(unix) || defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
#include <dlfcn.h>
static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym)
{