sfml: Fix unresolved symbols issue

This commit is contained in:
Tee KOBAYASHI 2022-04-29 03:56:41 +09:00 committed by xtkoba
parent ad17b20175
commit 6a53312dd3
3 changed files with 38 additions and 3 deletions

View File

@ -3,17 +3,16 @@ TERMUX_PKG_DESCRIPTION="A simple, fast, cross-platform and object-oriented multi
TERMUX_PKG_LICENSE="ZLIB"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.5.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/SFML/SFML/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=438c91a917cc8aa19e82c6f59f8714da353c488584a007d401efac8368e1c785
TERMUX_PKG_DEPENDS="freetype, libc++, libflac, libogg, libvorbis, libx11, libxrandr, mesa, openal-soft"
termux_step_post_get_source() {
cp src/SFML/Window/Android/JoystickImpl.cpp src/SFML/Window/Unix/
cp src/SFML/Window/Android/JoystickImpl.{cpp,hpp} src/SFML/Window/Unix/
}
termux_step_pre_configure() {
CPPFLAGS+=" -DSFML_SYSTEM_LINUX"
_NEED_DUMMY_LIBPTHREAD_A=
_LIBPTHREAD_A=$TERMUX_PREFIX/lib/libpthread.a
if [ ! -e $_LIBPTHREAD_A ]; then

View File

@ -0,0 +1,16 @@
--- a/include/SFML/Config.hpp
+++ b/include/SFML/Config.hpp
@@ -71,12 +71,7 @@
#elif defined(__unix__)
// UNIX system, see which one it is
- #if defined(__ANDROID__)
-
- // Android
- #define SFML_SYSTEM_ANDROID
-
- #elif defined(__linux__)
+ #if defined(__linux__)
// Linux
#define SFML_SYSTEM_LINUX

View File

@ -0,0 +1,20 @@
--- a/src/SFML/System/Unix/ThreadImpl.cpp
+++ b/src/SFML/System/Unix/ThreadImpl.cpp
@@ -62,7 +62,7 @@
{
if (m_isActive)
{
- #ifndef SFML_SYSTEM_ANDROID
+ #ifndef __ANDROID__
pthread_cancel(m_thread);
#else
// See https://stackoverflow.com/questions/4610086/pthread-cancel-al
@@ -78,7 +78,7 @@
// The Thread instance is stored in the user data
Thread* owner = static_cast<Thread*>(userData);
- #ifndef SFML_SYSTEM_ANDROID
+ #ifndef __ANDROID__
// Tell the thread to handle cancel requests immediately
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
#endif