libsdl2: added a recipe for version 2.0.3

This commit is contained in:
Jerome Duval
2014-08-30 14:01:01 +00:00
parent a632ac7c32
commit 53fc7a4c94
2 changed files with 224 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
SUMMARY="Simple Direct Media Layer 2.0"
DESCRIPTION="
Simple DirectMedia Layer is a cross-platform development library designed to \
provide low level access to audio, keyboard, mouse, joystick, and graphics \
hardware via OpenGL and Direct3D. It is used by video playback software, \
emulators, and popular games.
"
HOMEPAGE="http://www.libsdl.org/"
SRC_URI="http://www.libsdl.org/release/SDL2-$portVersion.tar.gz"
CHECKSUM_SHA256="a5a69a6abf80bcce713fa873607735fe712f44276a7f048d60a61bb2f6b3c90c"
REVISION="1"
LICENSE="Zlib"
COPYRIGHT="1997-2014 Sam Lantinga"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
libsdl2$secondaryArchSuffix = $portVersion compat >= 2.0
lib:libSDL2$secondaryArchSuffix = 0.2.1 compat >= 0
lib:libSDL2_2.0$secondaryArchSuffix = 0.2.1 compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libGL$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
devel:libGL$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:libtool
cmd:aclocal
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:which
cmd:pkg_config$secondaryArchSuffix
cmd:gettext
"
SOURCE_DIR="SDL2-$portVersion"
PATCHES="libsdl2-$portVersion.patchset"
PATCH()
{
if [ $effectiveTargetArchitecture != "x86_gcc2" ]; then
sed -i 's/lstdc++.r4/lstdc++/' configure.in
fi
}
BUILD()
{
autoreconf -fi
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
# devel package
prepareInstalledDevelLibs \
libSDL2 \
libSDL2main \
libSDL2_test \
libSDL2-2.0
fixPkgconfig
fixDevelopLibDirReferences $binDir/sdl2-config
packageEntries devel \
$developDir $binDir/sdl2-config $dataDir
}
# ----- devel package -------------------------------------
PROVIDES_devel="
libsdl2${secondaryArchSuffix}_devel = $portVersion compat >= 2.0
cmd:sdl2_config$secondaryArchSuffix = $portVersion compat >= 2.0
devel:libSDL2$secondaryArchSuffix = 0.2.1 compat >= 0
devel:libSDL2main$secondaryArchSuffix = 0.2.1 compat >= 0
devel:libSDL2_test$secondaryArchSuffix = 0.2.1 compat >= 0
devel:libSDL2_2.0$secondaryArchSuffix = 0.2.1 compat >= 0
"
REQUIRES_devel="
libsdl2$secondaryArchSuffix == $portVersion base
"

View File

@@ -0,0 +1,127 @@
From 93052ac5a195d2c3631ca454630766c6d0ea6f74 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 29 Aug 2014 15:24:11 +0000
Subject: haiku patch
diff --git a/configure.in b/configure.in
index 3d8a2de..c556a55 100644
--- a/configure.in
+++ b/configure.in
@@ -276,7 +276,7 @@ if test x$enable_libc = xyes; then
AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
AC_CHECK_FUNCS(iconv)
- AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
+ AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], [], [Description])], ,[#include <signal.h>])
fi
dnl AC_CHECK_SIZEOF(void*)
@@ -1427,7 +1427,7 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma
],[
],[
have_const_param_XextAddDisplay=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY)
+ AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY], [], [Description])
])
AC_MSG_RESULT($have_const_param_XextAddDisplay)
@@ -1439,7 +1439,7 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma
],[
],[
have_const_param_xdata32=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32)
+ AC_DEFINE([SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32], [], [Description])
])
AC_MSG_RESULT($have_const_param_xdata32)
@@ -1457,7 +1457,7 @@ XGetEventData(display, cookie);
XFreeEventData(display, cookie);
],[
have_XGenericEvent=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS)
+ AC_DEFINE([SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS], [], [Description])
])
AC_MSG_RESULT($have_XGenericEvent)
@@ -1557,7 +1557,7 @@ int event_type = XI_TouchBegin;
XITouchClassInfo *t;
],[
have_xinput2_multitouch=yes
- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH)
+ AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], [], [Description])
SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch"
])
AC_MSG_RESULT($have_xinput2_multitouch)
@@ -2281,7 +2281,7 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]])
sem_timedwait(NULL, NULL);
],[
have_sem_timedwait=yes
- AC_DEFINE(HAVE_SEM_TIMEDWAIT)
+ AC_DEFINE([HAVE_SEM_TIMEDWAIT], [], [Description])
])
AC_MSG_RESULT($have_sem_timedwait)
fi
@@ -2936,7 +2936,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
fi
# The Haiku platform requires special setup.
SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES"
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding -lstdc++.r4"
;;
arm*-apple-darwin*)
# iOS - We are not writing anything to confdefs.h because you have to replace
diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c
index b570b2a..80dfa1c 100644
--- a/src/thread/pthread/SDL_systhread.c
+++ b/src/thread/pthread/SDL_systhread.c
@@ -52,7 +52,7 @@
#endif
#ifdef __HAIKU__
-#include <be/kernel/OS.h>
+#include <kernel/OS.h>
#endif
#include "SDL_assert.h"
diff --git a/src/video/haiku/SDL_BWin.h b/src/video/haiku/SDL_BWin.h
index e6de5b0..e8aeabf 100644
--- a/src/video/haiku/SDL_BWin.h
+++ b/src/video/haiku/SDL_BWin.h
@@ -38,9 +38,9 @@ extern "C" {
#include <stdio.h>
#include <AppKit.h>
#include <InterfaceKit.h>
-#include <be/game/DirectWindow.h>
+#include <game/DirectWindow.h>
#if SDL_VIDEO_OPENGL
-#include <be/opengl/GLView.h>
+#include <opengl/GLView.h>
#endif
#include "SDL_events.h"
#include "../../main/haiku/SDL_BApp.h"
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
index 245cec1..52ee67a 100644
--- a/src/video/haiku/SDL_bopengl.cc
+++ b/src/video/haiku/SDL_bopengl.cc
@@ -56,7 +56,7 @@ int BE_GL_LoadLibrary(_THIS, const char *path)
if( get_image_symbol(info.id, "glBegin", B_SYMBOL_TYPE_ANY,
&location) == B_OK) {
- _this->gl_config.dll_handle = (void *) info.id;
+ _this->gl_config.dll_handle = (void *)(addr_t) info.id;
_this->gl_config.driver_loaded = 1;
SDL_strlcpy(_this->gl_config.driver_path, "libGL.so",
SDL_arraysize(_this->gl_config.driver_path));
@@ -71,7 +71,7 @@ void *BE_GL_GetProcAddress(_THIS, const char *proc)
void *location = NULL;
status_t err;
if ((err =
- get_image_symbol((image_id) _this->gl_config.dll_handle,
+ get_image_symbol((image_id)(addr_t) _this->gl_config.dll_handle,
proc, B_SYMBOL_TYPE_ANY,
&location)) == B_OK) {
return location;
--
1.8.3.4