From d010d0ebd6f1b966c4dd9db2cdfa9e2cd6857648 Mon Sep 17 00:00:00 2001 From: miqlas <5569059+extrowerk@users.noreply.github.com> Date: Sun, 24 Jun 2018 05:03:14 +0200 Subject: [PATCH] libSDL2: bump (#2731) * libSDL2: bump * https --- media-libs/libsdl2/libsdl2-2.0.8.recipe | 83 +++++++ .../libsdl2/patches/libsdl2-2.0.8.patchset | 208 ++++++++++++++++++ 2 files changed, 291 insertions(+) create mode 100644 media-libs/libsdl2/libsdl2-2.0.8.recipe create mode 100644 media-libs/libsdl2/patches/libsdl2-2.0.8.patchset diff --git a/media-libs/libsdl2/libsdl2-2.0.8.recipe b/media-libs/libsdl2/libsdl2-2.0.8.recipe new file mode 100644 index 000000000..16b2ea4f8 --- /dev/null +++ b/media-libs/libsdl2/libsdl2-2.0.8.recipe @@ -0,0 +1,83 @@ +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="https://www.libsdl.org/" +COPYRIGHT="1997-2018 Sam Lantinga" +LICENSE="Zlib" +REVISION="1" +SOURCE_URI="https://www.libsdl.org/release/SDL2-$portVersion.tar.gz" +CHECKSUM_SHA256="edc77c57308661d576e843344d8638e025a7818bff73f8fbfab09c3c5fd092ec" +SOURCE_DIR="SDL2-$portVersion" +PATCHES="libsdl2-$portVersion.patchset" + +ARCHITECTURES="x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + +PROVIDES=" + libsdl2$secondaryArchSuffix = $portVersion compat >= 2.0 + lib:libSDL2_2.0$secondaryArchSuffix = 0.7.0 compat >= 0 + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libglu$secondaryArchSuffix + lib:libltdl$secondaryArchSuffix + " + +PROVIDES_devel=" + libsdl2${secondaryArchSuffix}_devel = $portVersion compat >= 2.0 + cmd:sdl2_config$secondaryArchSuffix = $portVersion compat >= 2.0 + devel:libSDL2_2.0$secondaryArchSuffix = 0.7.0 compat >= 0 + devel:libSDL2_test$secondaryArchSuffix = 0.7.0 compat >= 0 + devel:libSDL2$secondaryArchSuffix = 0.7.0 compat >= 0 + devel:libSDL2main$secondaryArchSuffix = 0.7.0 compat >= 0 + " +REQUIRES_devel=" + libsdl2$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libgl$secondaryArchSuffix + devel:libglu$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:gcc$secondaryArchSuffix + cmd:gettext + cmd:ld$secondaryArchSuffix + cmd:libtool + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:which + " + +BUILD() +{ + autoreconf -fi + runConfigure ./configure + make $jobArgs +} + +INSTALL() +{ + make install + + rm $libDir/libSDL*.la + + # devel package + prepareInstalledDevelLibs \ + libSDL2 \ + libSDL2main \ + libSDL2_test \ + libSDL2-2.0 + + fixPkgconfig + fixDevelopLibDirReferences $binDir/sdl2-config + + packageEntries devel \ + $developDir $binDir/sdl2-config $dataDir $libDir/cmake +} diff --git a/media-libs/libsdl2/patches/libsdl2-2.0.8.patchset b/media-libs/libsdl2/patches/libsdl2-2.0.8.patchset new file mode 100644 index 000000000..87b5fedf5 --- /dev/null +++ b/media-libs/libsdl2/patches/libsdl2-2.0.8.patchset @@ -0,0 +1,208 @@ +From 5b995581729cb06e58f1d71cb286135951e5d2a5 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Fri, 29 Aug 2014 15:24:11 +0000 +Subject: haiku patch + + +diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc +index 6bf7a17..0b60466 100644 +--- a/src/video/haiku/SDL_bopengl.cc ++++ b/src/video/haiku/SDL_bopengl.cc +@@ -54,7 +54,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 *) (size_t) 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)); +@@ -69,7 +69,7 @@ void *BE_GL_GetProcAddress(_THIS, const char *proc) + void *location = NULL; + status_t err; + if ((err = +- get_image_symbol((image_id) (size_t) _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; +-- +2.15.1 + + +From 6cb2a822e56dcd960dd788b84fd7ea48e67caa2a Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Thu, 25 Feb 2016 20:23:41 +0000 +Subject: remove nacl, missing templates on Haiku + + +diff --git a/configure.in b/configure.in +index 5ac2130..fbfe2cc 100644 +--- a/configure.in ++++ b/configure.in +@@ -1530,33 +1530,6 @@ AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=ma + fi + } + +-dnl Check for Native Client stuff +-CheckNativeClient() +-{ +- AC_TRY_COMPILE([ +- #if !defined(__native_client__) +- #error "NO NACL" +- #endif +- ],[ +- ],[ +- AC_DEFINE(SDL_VIDEO_DRIVER_NACL, 1, [ ]) +- AC_DEFINE(SDL_AUDIO_DRIVER_NACL, 1, [ ]) +- AC_DEFINE(HAVE_POW, 1, [ ]) +- AC_DEFINE(HAVE_OPENGLES2, 1, [ ]) +- AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ]) +- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ]) +- +- SDL_LIBS="-lppapi_simple -lppapi_gles2 $SDL_LIBS" +- +- SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c" +- SOURCES="$SOURCES $srcdir/src/audio/nacl/*.c" +- SUMMARY_audio="${SUMMARY_audio} nacl" +- SOURCES="$SOURCES $srcdir/src/video/nacl/*.c" +- SUMMARY_video="${SUMMARY_video} nacl opengles2" +- ]) +-} +- +- + CheckRPI() + { + AC_ARG_ENABLE(video-rpi, +-- +2.15.1 + + +From f289ca347419e84ab5bce1e0f9992ea56289ed57 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sat, 30 Sep 2017 13:36:12 +0200 +Subject: fix AC_DEFINE + + +diff --git a/configure.in b/configure.in +index fbfe2cc..c77e630 100644 +--- a/configure.in ++++ b/configure.in +@@ -1829,7 +1829,7 @@ int event_type = XI_TouchBegin; + XITouchClassInfo *t; + ],[ + have_xinput2_multitouch=yes +- AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], 1, []) ++ AC_DEFINE([SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH], [], [Description]) + SUMMARY_video_x11="${SUMMARY_video_x11} xinput2_multitouch" + ]) + AC_MSG_RESULT($have_xinput2_multitouch) +-- +2.15.1 + + +From 289f0c1f881d64367c560e913f686cf45adaa567 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Fri, 2 Feb 2018 09:40:46 +0100 +Subject: Fix secondary arch build. + +Rather than trying to guess the name of libstdc++, run libtool in C++ +mode so it figures this out by itself. The previous way of detecting +libstdc++ would not allow for building a secondary architecture package. + +diff --git a/Makefile.in b/Makefile.in +index fe56652..47d9c82 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -143,13 +143,13 @@ update-revision: + .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d) + + $(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS) +- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) ++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CXX --mode=link $(CXX) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + + $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS) +- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir) ++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CXX --mode=link $(CXX) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir) + + $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS) +- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir) ++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CXX --mode=link $(CXX) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir) + + install: all install-bin install-hdrs install-lib install-data + install-bin: +diff --git a/configure.in b/configure.in +index c77e630..ffb09bb 100644 +--- a/configure.in ++++ b/configure.in +@@ -3595,9 +3595,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau + # The Haiku platform requires special setup. + SOURCES="$srcdir/src/main/haiku/*.cc $SOURCES" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" +- # Haiku's x86 spins use libstdc++.r4.so (for binary compat?), but +- # other spins, like x86-64, use a more standard "libstdc++.so.*" +- AC_CHECK_FILE("/boot/system/lib/libstdc++.r4.so", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++.r4", EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lstdc++") + ;; + arm*-apple-darwin*|*-ios-*) + ARCH=ios +-- +2.15.1 + + +From b15465c0835d6e998b6255a7654d14fb7b8b030d Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Fri, 2 Feb 2018 10:40:00 +0100 +Subject: Fix crash when opening window + +- _num_clips was not set in constructor, so a NULL _clips could be + mistakenly dereferenced. +- As _clips is accessible outside the class, it is not a good idea to + free/reallocate it. Try to limit this by reallocating only when it needs to + grow. + +diff --git a/src/video/haiku/SDL_BWin.h b/src/video/haiku/SDL_BWin.h +index a20147a..105ebb5 100644 +--- a/src/video/haiku/SDL_BWin.h ++++ b/src/video/haiku/SDL_BWin.h +@@ -86,6 +86,7 @@ class SDL_BWin:public BDirectWindow + _buffer_locker = new BLocker(); + _bitmap = NULL; + _clips = NULL; ++ _num_clips = 0; + + #ifdef DRAWTHREAD + _draw_thread_id = spawn_thread(BE_DrawThread, "drawing_thread", +@@ -179,13 +180,17 @@ class SDL_BWin:public BDirectWindow + _connected = true; + + case B_DIRECT_MODIFY: +- if(_clips) { +- free(_clips); +- _clips = NULL; ++ if (info->clip_list_count > _num_clips) ++ { ++ if(_clips) { ++ free(_clips); ++ _clips = NULL; ++ } + } + + _num_clips = info->clip_list_count; +- _clips = (clipping_rect *)malloc(_num_clips*sizeof(clipping_rect)); ++ if (_clips == NULL) ++ _clips = (clipping_rect *)malloc(_num_clips*sizeof(clipping_rect)); + if(_clips) { + memcpy(_clips, info->clip_list, + _num_clips*sizeof(clipping_rect)); +@@ -652,7 +657,7 @@ private: + clipping_rect _bounds; + BLocker *_buffer_locker; + clipping_rect *_clips; +- int32 _num_clips; ++ uint32 _num_clips; + int32 _bytes_per_px; + thread_id _draw_thread_id; + +-- +2.15.1 +