From d7e59f63c118354c92b823f728accb4f69602c74 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sun, 18 Aug 2013 22:58:09 -0500 Subject: [PATCH] libsdl2: Add SDL2 port. Marked unstable * Small number of changes to get it building * Very unstable, but getting there. * split sdl 2.0 from libsdl to libsdl2. The reasoning behind this is that libsdl uses -lsdl, while libsdl 2.x uses -lsdl2. (SDL2 breaks a lot of binary compat I guess) * Remove old sdl2 bep's in libsdl.. these never worked well. * libsdl 2.0.0 seems to build with gcc2 and gcc4 (yay) * libsdl 2.0.0 patch pushed upstream in SDL bug #2046 * Thanks to the gsoc students for their hard work! --- media-libs/libsdl/libsdl-2.0-hg-cmake.bep | 28 ------------------- .../libsdl2-2.0.0.bep} | 15 +++++----- .../libsdl2/patches/libsdl2-2.0.0.patch | 26 +++++++++++++++++ 3 files changed, 34 insertions(+), 35 deletions(-) delete mode 100644 media-libs/libsdl/libsdl-2.0-hg-cmake.bep rename media-libs/{libsdl/libsdl-2.0-hg.bep => libsdl2/libsdl2-2.0.0.bep} (62%) create mode 100644 media-libs/libsdl2/patches/libsdl2-2.0.0.patch diff --git a/media-libs/libsdl/libsdl-2.0-hg-cmake.bep b/media-libs/libsdl/libsdl-2.0-hg-cmake.bep deleted file mode 100644 index 5ff197a01..000000000 --- a/media-libs/libsdl/libsdl-2.0-hg-cmake.bep +++ /dev/null @@ -1,28 +0,0 @@ -DESCRIPTION="Simple Direct Media Layer" -HOMEPAGE="http://www.libsdl.org/" -SRC_URI="hg+http://hg.libsdl.org/SDL" -#CHECKSUM_MD5="e52086d1b508fa0b76c52ee30b55bec4" -REVISION="1" -STATUS_HAIKU="unstable" -DEPEND="" -BUILD { - cd libsdl-2.0-hg-cmake -# MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man -# LIBDIR=`finddir B_COMMON_LIB_DIRECTORY` -# DATADIR=`finddir B_COMMON_DATA_DIRECTORY` -# mkdir build_haiku -# cd build_haiku -# ../configure --prefix=`finddir B_COMMON_DIRECTORY` \ -# --libdir=$LIBDIR \ -# --mandir=$MANDIR \ -# --datadir=$DATADIR - cmake . - make -} - -INSTALL { - cd libsdl-2.0-hg-cmake - make install -} -LICENSE="Zlib" -COPYRIGHT="1997-2013 Sam Lantinga" diff --git a/media-libs/libsdl/libsdl-2.0-hg.bep b/media-libs/libsdl2/libsdl2-2.0.0.bep similarity index 62% rename from media-libs/libsdl/libsdl-2.0-hg.bep rename to media-libs/libsdl2/libsdl2-2.0.0.bep index 502f3163f..6175dca16 100644 --- a/media-libs/libsdl/libsdl-2.0-hg.bep +++ b/media-libs/libsdl2/libsdl2-2.0.0.bep @@ -1,12 +1,12 @@ -DESCRIPTION="Simple Direct Media Layer" +DESCRIPTION="Simple Direct Media Layer 2" HOMEPAGE="http://www.libsdl.org/" -SRC_URI="hg+http://hg.libsdl.org/SDL" -#CHECKSUM_MD5="e52086d1b508fa0b76c52ee30b55bec4" +SRC_URI="http://www.libsdl.org/release/SDL2-2.0.0.tar.gz" +CHECKSUM_MD5="beec89afb6edcc6f0abc4114f2e6bcf7" REVISION="1" STATUS_HAIKU="unstable" -DEPEND="" +DEPEND="pkgconfig >= 0.9.0" BUILD { - cd libsdl-2.0-hg + cd SDL2-2.0.0 MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man LIBDIR=`finddir B_COMMON_LIB_DIRECTORY` DATADIR=`finddir B_COMMON_DATA_DIRECTORY` @@ -15,12 +15,13 @@ BUILD { ../configure --prefix=`finddir B_COMMON_DIRECTORY` \ --libdir=$LIBDIR \ --mandir=$MANDIR \ - --datadir=$DATADIR + --datadir=$DATADIR \ + --enable-shared make } INSTALL { - cd libsdl-2.0-hg/build_haiku + cd SDL2-2.0.0/build_haiku make install } LICENSE="Zlib" diff --git a/media-libs/libsdl2/patches/libsdl2-2.0.0.patch b/media-libs/libsdl2/patches/libsdl2-2.0.0.patch new file mode 100644 index 000000000..51471a4ba --- /dev/null +++ b/media-libs/libsdl2/patches/libsdl2-2.0.0.patch @@ -0,0 +1,26 @@ +diff -Naur SDL2-2.0.0/include/begin_code.h SDL2-2.0.0-haiku/include/begin_code.h +--- SDL2-2.0.0/include/begin_code.h 2013-08-11 21:57:54.011796480 -0500 ++++ SDL2-2.0.0-haiku/include/begin_code.h 2013-08-18 21:04:46.580386816 -0500 +@@ -36,7 +36,9 @@ + /* Some compilers use a special export keyword */ + #ifndef DECLSPEC + # if defined(__BEOS__) || defined(__HAIKU__) +-# if defined(__GNUC__) ++# if defined(__GNUC__) && __GNUC__ >= 4 ++# define DECLSPEC __attribute__ ((visibility("default"))) ++# elif defined(__GNUC__) && __GNUC__ >= 2 + # define DECLSPEC __declspec(dllexport) + # else + # define DECLSPEC __declspec(export) +diff -Naur SDL2-2.0.0/src/main/beos/SDL_BApp.h SDL2-2.0.0-haiku/src/main/beos/SDL_BApp.h +--- SDL2-2.0.0/src/main/beos/SDL_BApp.h 2013-08-11 21:57:54.058982400 -0500 ++++ SDL2-2.0.0-haiku/src/main/beos/SDL_BApp.h 2013-08-18 21:05:04.364642304 -0500 +@@ -371,7 +371,7 @@ + + + /* Members */ +- vector _window_map; /* Keeps track of SDL_Windows by index-id*/ ++ std::vector _window_map; /* Keeps track of SDL_Windows by index-id*/ + + display_mode *_saved_mode; + BGLView *_current_context;