mirror of
https://github.com/termux/termux-packages.git
synced 2025-10-23 19:54:08 +00:00
- Fixes https://github.com/termux/termux-packages/issues/26656 **Termux** `sdl2` is a unique build of SDL2 that **mixes traits of the intended official Android target of SDL2 and the official GNU/Linux target of SDL2 together**, without exactly matching the entire set of traits that either one would otherwise have by default. Therefore, in order for **Termux** `sdl2-compat` to be a **correct backwards compatibility layer** of **Termux** `sdl3` to programs intended for **Termux** `sdl2`, an intervention in **Termux** `sdl2-compat` must be performed so that it provides the exact same shared libary filenames that **Termux** `sdl2` does. Emphasis on **Termux** is used to denote that **in Termux `sdl2`, we deviated from the set of configurations that upstream considered while they developed upstream SDL2-compat**, and therefore, **to produce a correct `sdl2-compat` package for Termux, we need to modify it wherever necessary to simulate the behavior that specifically **Termux** `sdl2` has had for a long time, not just a generic SDL2. `sdl2` vs. `sdl2-compat` before (note the presence of `libSDL2-2.0.so.0` and `libSDL2-2.0.so.0.3200.56` which never existed in Termux `sdl2`): ```diff --- sdl2.txt 2025-09-23 12:33:30.112715258 -0500 +++ sdl2-compat.txt 2025-09-23 12:32:22.642218098 -0500 @@ -16,6 +16,20 @@ /data/data/com.termux/files/usr/include/SDL2/SDL_blendmode.h /data/data/com.termux/files/usr/include/SDL2/SDL_clipboard.h /data/data/com.termux/files/usr/include/SDL2/SDL_config.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_android.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_emscripten.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_iphoneos.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_macosx.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_minimal.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_ngage.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_os2.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_pandora.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_unix.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_windows.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_wingdk.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_winrt.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_xbox.h +/data/data/com.termux/files/usr/include/SDL2/SDL_copying.h /data/data/com.termux/files/usr/include/SDL2/SDL_cpuinfo.h /data/data/com.termux/files/usr/include/SDL2/SDL_egl.h /data/data/com.termux/files/usr/include/SDL2/SDL_endian.h @@ -89,15 +103,30 @@ /data/data/com.termux/files/usr/lib /data/data/com.termux/files/usr/lib/cmake /data/data/com.termux/files/usr/lib/cmake/SDL2 +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2Config.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2ConfigVersion.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2Targets-release.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2Targets.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2_testTargets-release.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2_testTargets.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2mainTargets-release.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2mainTargets.cmake /data/data/com.termux/files/usr/lib/cmake/SDL2/sdl2-config-version.cmake /data/data/com.termux/files/usr/lib/cmake/SDL2/sdl2-config.cmake -/data/data/com.termux/files/usr/lib/libSDL2-2.0.so +/data/data/com.termux/files/usr/lib/libSDL2-2.0.so.0.3200.56 +/data/data/com.termux/files/usr/lib/libSDL2_test.a +/data/data/com.termux/files/usr/lib/libSDL2main.a /data/data/com.termux/files/usr/lib/pkgconfig -/data/data/com.termux/files/usr/lib/pkgconfig/sdl2.pc +/data/data/com.termux/files/usr/lib/pkgconfig/sdl2-compat.pc /data/data/com.termux/files/usr/share /data/data/com.termux/files/usr/share/aclocal /data/data/com.termux/files/usr/share/aclocal/sdl2.m4 /data/data/com.termux/files/usr/share/doc -/data/data/com.termux/files/usr/share/doc/sdl2 -/data/data/com.termux/files/usr/share/doc/sdl2/copyright +/data/data/com.termux/files/usr/share/doc/sdl2-compat +/data/data/com.termux/files/usr/share/doc/sdl2-compat/copyright +/data/data/com.termux/files/usr/share/licenses +/data/data/com.termux/files/usr/share/licenses/sdl2-compat +/data/data/com.termux/files/usr/share/licenses/sdl2-compat/LICENSE.txt +/data/data/com.termux/files/usr/lib/libSDL2-2.0.so +/data/data/com.termux/files/usr/lib/libSDL2-2.0.so.0 /data/data/com.termux/files/usr/lib/libSDL2.so ``` **Termux** `sdl2` vs **Termux** `sdl2-compat` after (note that there are now **no differences between the provided `.so` filenames**) ```diff --- sdl2.txt 2025-08-15 12:17:33.590054363 -0500 +++ sdl2-compat-new.txt 2025-09-23 13:16:52.812714265 -0500 @@ -16,6 +16,20 @@ /data/data/com.termux/files/usr/include/SDL2/SDL_blendmode.h /data/data/com.termux/files/usr/include/SDL2/SDL_clipboard.h /data/data/com.termux/files/usr/include/SDL2/SDL_config.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_android.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_emscripten.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_iphoneos.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_macosx.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_minimal.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_ngage.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_os2.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_pandora.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_unix.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_windows.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_wingdk.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_winrt.h +/data/data/com.termux/files/usr/include/SDL2/SDL_config_xbox.h +/data/data/com.termux/files/usr/include/SDL2/SDL_copying.h /data/data/com.termux/files/usr/include/SDL2/SDL_cpuinfo.h /data/data/com.termux/files/usr/include/SDL2/SDL_egl.h /data/data/com.termux/files/usr/include/SDL2/SDL_endian.h @@ -89,15 +103,28 @@ /data/data/com.termux/files/usr/lib /data/data/com.termux/files/usr/lib/cmake /data/data/com.termux/files/usr/lib/cmake/SDL2 +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2Config.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2ConfigVersion.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2Targets-release.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2Targets.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2_testTargets-release.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2_testTargets.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2mainTargets-release.cmake +/data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2mainTargets.cmake /data/data/com.termux/files/usr/lib/cmake/SDL2/sdl2-config-version.cmake /data/data/com.termux/files/usr/lib/cmake/SDL2/sdl2-config.cmake /data/data/com.termux/files/usr/lib/libSDL2-2.0.so +/data/data/com.termux/files/usr/lib/libSDL2_test.a +/data/data/com.termux/files/usr/lib/libSDL2main.a /data/data/com.termux/files/usr/lib/pkgconfig -/data/data/com.termux/files/usr/lib/pkgconfig/sdl2.pc +/data/data/com.termux/files/usr/lib/pkgconfig/sdl2-compat.pc /data/data/com.termux/files/usr/share /data/data/com.termux/files/usr/share/aclocal /data/data/com.termux/files/usr/share/aclocal/sdl2.m4 /data/data/com.termux/files/usr/share/doc -/data/data/com.termux/files/usr/share/doc/sdl2 -/data/data/com.termux/files/usr/share/doc/sdl2/copyright +/data/data/com.termux/files/usr/share/doc/sdl2-compat +/data/data/com.termux/files/usr/share/doc/sdl2-compat/copyright +/data/data/com.termux/files/usr/share/licenses +/data/data/com.termux/files/usr/share/licenses/sdl2-compat +/data/data/com.termux/files/usr/share/licenses/sdl2-compat/LICENSE.txt /data/data/com.termux/files/usr/lib/libSDL2.so ``` difference between old `sdl2-compat` and new `sdl2-compat` directly (note the removal of `libSDL2-2.0.so.0.3200.56` and `libSDL2-2.0.so.0`): ```diff --- sdl2-compat.txt 2025-08-15 12:14:01.610054444 -0500 +++ sdl2-compat-new.txt 2025-09-23 13:16:52.812714265 -0500 @@ -113,7 +113,7 @@ /data/data/com.termux/files/usr/lib/cmake/SDL2/SDL2mainTargets.cmake /data/data/com.termux/files/usr/lib/cmake/SDL2/sdl2-config-version.cmake /data/data/com.termux/files/usr/lib/cmake/SDL2/sdl2-config.cmake -/data/data/com.termux/files/usr/lib/libSDL2-2.0.so.0.3200.56 +/data/data/com.termux/files/usr/lib/libSDL2-2.0.so /data/data/com.termux/files/usr/lib/libSDL2_test.a /data/data/com.termux/files/usr/lib/libSDL2main.a /data/data/com.termux/files/usr/lib/pkgconfig @@ -127,6 +127,4 @@ /data/data/com.termux/files/usr/share/licenses /data/data/com.termux/files/usr/share/licenses/sdl2-compat /data/data/com.termux/files/usr/share/licenses/sdl2-compat/LICENSE.txt -/data/data/com.termux/files/usr/lib/libSDL2-2.0.so -/data/data/com.termux/files/usr/lib/libSDL2-2.0.so.0 /data/data/com.termux/files/usr/lib/libSDL2.so ``` - Also: The Termux `sdl2-compat` does **not** need the `termux_step_post_make_install()` of Termux `sdl2`, because it internally automatically creates the symbolic link using its `CMakeLists.txt` in a way that Termux `sdl2` does not - therefore, the `termux_step_post_make_install()` should be removed from `sdl2-compat` to avoid causing confusion, because it is redundant.