glfw: Fix unresolved symbols issue

This commit is contained in:
Tee KOBAYASHI 2022-04-29 03:30:05 +09:00 committed by xtkoba
parent cc441d5dbf
commit ad17b20175
5 changed files with 65 additions and 0 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="An Open Source, multi-platform library for OpenGL, OpenG
TERMUX_PKG_LICENSE="ZLIB" TERMUX_PKG_LICENSE="ZLIB"
TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.3.7 TERMUX_PKG_VERSION=3.3.7
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/glfw/glfw/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://github.com/glfw/glfw/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=fd21a5f65bcc0fc3c76e0f8865776e852de09ef6fbc3620e09ce96d2b2807e04 TERMUX_PKG_SHA256=fd21a5f65bcc0fc3c76e0f8865776e852de09ef6fbc3620e09ce96d2b2807e04
TERMUX_PKG_DEPENDS="libx11" TERMUX_PKG_DEPENDS="libx11"
@ -13,3 +14,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_TESTS=OFF
-DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_DOCS=OFF
" "
termux_step_pre_configure() {
LDFLAGS+=" -lm"
}

View File

@ -0,0 +1,20 @@
--- a/src/wl_init.c
+++ b/src/wl_init.c
@@ -1150,7 +1150,7 @@
// Sync so we got all initial output events
wl_display_roundtrip(_glfw.wl.display);
-#ifdef __linux__
+#if defined __linux__ && !defined __ANDROID__
if (!_glfwInitJoysticksLinux())
return GLFW_FALSE;
#endif
@@ -1211,7 +1211,7 @@
void _glfwPlatformTerminate(void)
{
-#ifdef __linux__
+#if defined __linux__ && !defined __ANDROID__
_glfwTerminateJoysticksLinux();
#endif
_glfwTerminateEGL();

View File

@ -0,0 +1,11 @@
--- a/src/wl_platform.h
+++ b/src/wl_platform.h
@@ -45,7 +45,7 @@
#include "posix_thread.h"
#include "posix_time.h"
-#ifdef __linux__
+#if defined __linux__ && !defined __ANDROID__
#include "linux_joystick.h"
#else
#include "null_joystick.h"

View File

@ -63,3 +63,21 @@
_glfw.x11.xrender.handle = _glfw_dlopen("libXrender.so"); _glfw.x11.xrender.handle = _glfw_dlopen("libXrender.so");
#else #else
_glfw.x11.xrender.handle = _glfw_dlopen("libXrender.so.1"); _glfw.x11.xrender.handle = _glfw_dlopen("libXrender.so.1");
@@ -1147,7 +1147,7 @@
}
}
-#if defined(__linux__)
+#if defined(__linux__) && !defined(__ANDROID__)
if (!_glfwInitJoysticksLinux())
return GLFW_FALSE;
#endif
@@ -1240,7 +1240,7 @@
_glfwTerminateEGL();
_glfwTerminateGLX();
-#if defined(__linux__)
+#if defined(__linux__) && !defined(__ANDROID__)
_glfwTerminateJoysticksLinux();
#endif

View File

@ -0,0 +1,11 @@
--- a/src/x11_window.c
+++ b/src/x11_window.c
@@ -2830,7 +2830,7 @@
{
drainEmptyEvents();
-#if defined(__linux__)
+#if defined(__linux__) && !defined(__ANDROID__)
_glfwDetectJoystickConnectionLinux();
#endif
XPending(_glfw.x11.display);