diff --git a/tur/flightgear/build.sh b/tur/flightgear/build.sh new file mode 100644 index 0000000000..303abf8bdd --- /dev/null +++ b/tur/flightgear/build.sh @@ -0,0 +1,21 @@ +TERMUX_PKG_HOMEPAGE=https://www.flightgear.org +TERMUX_PKG_DESCRIPTION="Free open-source flight simulator" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="@termux-user-repository" +TERMUX_PKG_VERSION=2024.1.1 +TERMUX_PKG_SRCURL=https://gitlab.com/flightgear/flightgear/-/archive/v${TERMUX_PKG_VERSION}/flightgear-v${TERMUX_PKG_VERSION}.tar.bz2 +TERMUX_PKG_SHA256="a3b1fea7064caa18964828e79cc1ec663f6aabf0fb5eb4f7f7fb82635fc8a937" +TERMUX_PKG_DEPENDS="boost, mesa, openscenegraph, plib, simgear, libandroid-execinfo, openal-soft, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg" +TERMUX_PKG_BUILD_IN_SRC=true + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=' +-DCHECK_FOR_QT6=ON +-DCMAKE_SYSTEM_NAME=Linux +-DCROSS_COMPILING=ON +-DWITH_FGPANEL=ON +-DSYSTEM_SQLITE=ON +' + +termux_step_pre_configure() { + export LDFLAGS+=" -landroid-execinfo" +} diff --git a/tur/flightgear/fake_fgrcc.patch b/tur/flightgear/fake_fgrcc.patch new file mode 100644 index 0000000000..4959121009 --- /dev/null +++ b/tur/flightgear/fake_fgrcc.patch @@ -0,0 +1,130 @@ +diff -Naur 2/src/EmbeddedResources/CMakeLists.txt 1/src/EmbeddedResources/CMakeLists.txt +--- 2/src/EmbeddedResources/CMakeLists.txt 2025-02-19 09:53:41.000000000 +0100 ++++ 1/src/EmbeddedResources/CMakeLists.txt 2025-03-13 21:15:20.675052868 +0100 +@@ -1,7 +1,6 @@ + add_executable(fgrcc fgrcc.cxx fgrcc.hxx) + target_link_libraries(fgrcc SimGearCore) + +-# On Windows, make sure fgrcc can be run (it needs third-party libraries) in add_custom_target + if(MSVC) + set_target_properties(fgrcc PROPERTIES DEBUG_POSTFIX d) + if (FINAL_MSVC_3RDPARTY_DIR) +@@ -11,37 +10,49 @@ + endif() + endif() + +-add_custom_command( +- COMMAND +- fgrcc --root=${PROJECT_SOURCE_DIR} +- --output-cpp-file=${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx +- --init-func-name=initFlightGearEmbeddedResources +- --output-header-file=${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx +- --output-header-identifier=_FG_FLIGHTGEAR_EMBEDDED_RESOURCES +- ${CMAKE_CURRENT_SOURCE_DIR}/FlightGear-resources.xml +- OUTPUT +- ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx +- ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx +- MAIN_DEPENDENCY +- fgrcc ${CMAKE_CURRENT_SOURCE_DIR}/FlightGear-resources.xml +- COMMENT +- "Re-generating embedded resources" +-) +- +-# set automatically by add_custom_command? +-#set_source_files_properties(${EMBEDDED_RESOURCE_SOURCES} PROPERTIES GENERATED TRUE) +-#set_source_files_properties(${EMBEDDED_RESOURCE_HEADERS} PROPERTIES GENERATED TRUE) ++# Sprawdź czy to cross-kompilacja ++if(NOT CROSS_COMPILING) ++ # Originalne uruchomienie fgrcc ++ add_custom_command( ++ COMMAND ++ fgrcc --root=${PROJECT_SOURCE_DIR} ++ --output-cpp-file=${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx ++ --init-func-name=initFlightGearEmbeddedResources ++ --output-header-file=${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx ++ --output-header-identifier=_FG_FLIGHTGEAR_EMBEDDED_RESOURCES ++ ${CMAKE_CURRENT_SOURCE_DIR}/FlightGear-resources.xml ++ OUTPUT ++ ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx ++ ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx ++ MAIN_DEPENDENCY ++ fgrcc ${CMAKE_CURRENT_SOURCE_DIR}/FlightGear-resources.xml ++ COMMENT ++ "Re-generating embedded resources" ++ ) ++else() ++ # Dummy command dla cross-kompilacji: nic nie rób, ale zwróć sukces ++ add_custom_command( ++ COMMAND ++ ${CMAKE_COMMAND} -E true # Pusta komenda CMake (sukces) ++ OUTPUT ++ ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx ++ ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx ++ COMMENT ++ "Skipping fgrcc execution during cross-compilation" ++ ) ++ ++ # Sprawdź czy pliki istnieją (np. zostały wcześniej wygenerowane) ++ if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx" OR ++ NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx") ++ message(FATAL_ERROR "FlightGear-resources.[cxx|hxx] must be pre-generated for cross-compilation!") ++ endif() ++endif() + + add_library(fgembeddedresources STATIC + ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.cxx + ${CMAKE_CURRENT_BINARY_DIR}/FlightGear-resources.hxx +- ) ++) + +-# users of the library include this as + target_include_directories(fgembeddedresources INTERFACE ${PROJECT_BINARY_DIR}/src) +- + target_link_libraries(fgembeddedresources SimGearCore) +- +-# don't try to Automoc these files, it confuses the dependency logic +-set_property(TARGET fgembeddedresources PROPERTY AUTOMOC OFF) +- ++set_property(TARGET fgembeddedresources PROPERTY AUTOMOC OFF) +\ Brak znaku nowej linii na końcu pliku +diff -Naur 2/src/EmbeddedResources/FlightGear-resources.cxx 1/src/EmbeddedResources/FlightGear-resources.cxx +--- 2/src/EmbeddedResources/FlightGear-resources.cxx 1970-01-01 01:00:00.000000000 +0100 ++++ 1/src/EmbeddedResources/FlightGear-resources.cxx 2025-03-13 21:07:11.711350697 +0100 +@@ -0,0 +1,22 @@ ++// -*- coding: utf-8 -*- ++// ++// File automatically generated by fgrcc. ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++using std::unique_ptr; ++using simgear::AbstractEmbeddedResource; ++using simgear::RawEmbeddedResource; ++using simgear::ZlibEmbeddedResource; ++using simgear::EmbeddedResourceManager; ++ ++void initFlightGearEmbeddedResources() ++{ ++ EmbeddedResourceManager::instance(); ++} +\ Brak znaku nowej linii na końcu pliku +diff -Naur 2/src/EmbeddedResources/FlightGear-resources.hxx 1/src/EmbeddedResources/FlightGear-resources.hxx +--- 2/src/EmbeddedResources/FlightGear-resources.hxx 1970-01-01 01:00:00.000000000 +0100 ++++ 1/src/EmbeddedResources/FlightGear-resources.hxx 2025-03-13 21:07:28.491066065 +0100 +@@ -0,0 +1,10 @@ ++// -*- coding: utf-8 -*- ++// ++// Header file automatically generated by fgrcc. ++ ++#ifndef _FG_FLIGHTGEAR_EMBEDDED_RESOURCES ++#define _FG_FLIGHTGEAR_EMBEDDED_RESOURCES ++ ++void initFlightGearEmbeddedResources(); ++ ++#endif // of _FG_FLIGHTGEAR_EMBEDDED_RESOURCES diff --git a/tur/flightgear/glh.patch b/tur/flightgear/glh.patch new file mode 100644 index 0000000000..a8d8c2fdc5 --- /dev/null +++ b/tur/flightgear/glh.patch @@ -0,0 +1,176 @@ +diff -ur orig/3rdparty/fonts/fntBitmap.cxx mod/3rdparty/fonts/fntBitmap.cxx +--- orig/3rdparty/fonts/fntBitmap.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/3rdparty/fonts/fntBitmap.cxx 2025-03-10 10:44:16.386768830 +0100 +@@ -23,7 +23,7 @@ + + + #include "fnt.h" +- ++#include + + fntBitmapFont::fntBitmapFont( const GLubyte **_data, int _first, int _height, + float _xorig, float _yorig ) +diff -ur orig/3rdparty/fonts/fnt.cxx mod/3rdparty/fonts/fnt.cxx +--- orig/3rdparty/fonts/fnt.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/3rdparty/fonts/fnt.cxx 2025-03-10 10:44:22.470680280 +0100 +@@ -22,7 +22,7 @@ + */ + + #include "fntLocal.h" +- ++#include + #include + #include + +diff -ur orig/3rdparty/fonts/fnt.h mod/3rdparty/fonts/fnt.h +--- orig/3rdparty/fonts/fnt.h 2025-02-19 09:53:41.000000000 +0100 ++++ mod/3rdparty/fonts/fnt.h 2025-03-10 10:44:13.342812959 +0100 +@@ -30,6 +30,7 @@ + #include + #include + ++#include + #define FNTMAX_CHAR 256 + #define FNT_TRUE 1 + #define FNT_FALSE 0 +diff -ur orig/3rdparty/fonts/fntLocal.h mod/3rdparty/fonts/fntLocal.h +--- orig/3rdparty/fonts/fntLocal.h 2025-02-19 09:53:41.000000000 +0100 ++++ mod/3rdparty/fonts/fntLocal.h 2025-03-10 10:44:19.066729886 +0100 +@@ -23,7 +23,7 @@ + + + #include "fnt.h" +- ++#include + + extern int _fntIsSwapped ; + extern FILE *_fntCurrImageFd ; +diff -ur orig/3rdparty/fonts/fntTXF.cxx mod/3rdparty/fonts/fntTXF.cxx +--- orig/3rdparty/fonts/fntTXF.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/3rdparty/fonts/fntTXF.cxx 2025-03-10 10:44:26.094627310 +0100 +@@ -23,7 +23,7 @@ + + + #include "fntLocal.h" +- ++#include + #include + #include + +diff -ur orig/src/Canvas/gui_mgr.cxx mod/src/Canvas/gui_mgr.cxx +--- orig/src/Canvas/gui_mgr.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Canvas/gui_mgr.cxx 2025-03-10 10:45:01.874095940 +0100 +@@ -33,6 +33,8 @@ + #include + #include + ++#include ++ + class DesktopGroup; + typedef SGSharedPtr DesktopPtr; + typedef SGWeakPtr DesktopWeakPtr; +diff -ur orig/src/Cockpit/render_area_2d.cxx mod/src/Cockpit/render_area_2d.cxx +--- orig/src/Cockpit/render_area_2d.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Cockpit/render_area_2d.cxx 2025-03-10 10:48:52.702403957 +0100 +@@ -27,6 +27,7 @@ + #endif + + #include "render_area_2d.hxx" ++#include + + RA2DPrimitive::RA2DPrimitive() { + invert = false; +diff -ur orig/src/Instrumentation/HUD/HUD.cxx mod/src/Instrumentation/HUD/HUD.cxx +--- orig/src/Instrumentation/HUD/HUD.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Instrumentation/HUD/HUD.cxx 2025-03-10 11:36:57.996810605 +0100 +@@ -47,6 +47,8 @@ + #include "HUD.hxx" + #include "HUD_private.hxx" + ++#include ++ + using std::endl; + using std::ifstream; + using std::string; +@@ -223,7 +225,7 @@ + Matrixf proj + = Matrixf::perspective(view->get_v_fov(), 1/view->get_aspect_ratio(), + 0.1, 10); +- glLoadMatrix(proj.ptr()); ++ glLoadMatrixf(proj.ptr()); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); +@@ -237,7 +239,7 @@ + lookat[1] = 9999; // FPU sanity + Matrixf mv = Matrixf::lookAt(Vec3f(0.0, 0.0, 0.0), lookat, + Vec3f(0.0, 1.0, 0.0)); +- glLoadMatrix(mv.ptr()); ++ glLoadMatrixf(mv.ptr()); + + // Map the -1:1 square to a 55.0x41.25 degree wide patch at z=1. + // This is the default fgfs field of view, which the HUD files are +@@ -271,7 +273,7 @@ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + Matrixf proj = Matrixf::ortho2D(x_start, x_end, y_start, y_end); +- glLoadMatrix(proj.ptr()); ++ glLoadMatrixf(proj.ptr()); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); +diff -ur orig/src/Instrumentation/HUD/HUD.hxx mod/src/Instrumentation/HUD/HUD.hxx +--- orig/src/Instrumentation/HUD/HUD.hxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Instrumentation/HUD/HUD.hxx 2025-03-10 10:59:54.559110928 +0100 +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + class FGFontCache; + class fntRenderer; +diff -ur orig/src/Instrumentation/HUD/HUD_label.cxx mod/src/Instrumentation/HUD/HUD_label.cxx +--- orig/src/Instrumentation/HUD/HUD_label.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Instrumentation/HUD/HUD_label.cxx 2025-03-10 10:53:46.937359099 +0100 +@@ -14,6 +14,7 @@ + #include "HUD_private.hxx" + + #include
++#include + + HUD::Label::Label(HUD *hud, const SGPropertyNode *n, float x, float y) : + Item(hud, n, x, y), +diff -ur orig/src/Instrumentation/HUD/HUD_misc.cxx mod/src/Instrumentation/HUD/HUD_misc.cxx +--- orig/src/Instrumentation/HUD/HUD_misc.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Instrumentation/HUD/HUD_misc.cxx 2025-03-10 10:54:00.453123052 +0100 +@@ -26,6 +26,7 @@ + #include "HUD_private.hxx" + + #include
++#include + + // MIL-STD-1787B aiming reticle + +diff -ur orig/src/Instrumentation/HUD/HUD_runway.cxx mod/src/Instrumentation/HUD/HUD_runway.cxx +--- orig/src/Instrumentation/HUD/HUD_runway.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Instrumentation/HUD/HUD_runway.cxx 2025-03-10 11:00:08.242883462 +0100 +@@ -40,6 +40,7 @@ + + #include "HUD.hxx" + #include "HUD_private.hxx" ++#include + + HUD::Runway::Runway(HUD *hud, const SGPropertyNode *node, float x, float y) : + Item(hud, node, x, y), +diff -ur orig/src/Scenery/marker.cxx mod/src/Scenery/marker.cxx +--- orig/src/Scenery/marker.cxx 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/Scenery/marker.cxx 2025-03-10 11:45:40.291898232 +0100 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + osg::Node* fgCreateMarkerNode(const osgText::String& label, float font_size, float pin_height, float tip_height, const osg::Vec4f& color) + { diff --git a/tur/flightgear/jsbsim.patch b/tur/flightgear/jsbsim.patch new file mode 100644 index 0000000000..740246b713 --- /dev/null +++ b/tur/flightgear/jsbsim.patch @@ -0,0 +1,14 @@ +diff -ur orig/src/FDM/JSBSim/input_output/FGfdmSocket.h mod/src/FDM/JSBSim/input_output/FGfdmSocket.h +--- orig/src/FDM/JSBSim/input_output/FGfdmSocket.h 2025-02-19 09:53:41.000000000 +0100 ++++ mod/src/FDM/JSBSim/input_output/FGfdmSocket.h 2025-03-10 10:11:01.735473089 +0100 +@@ -48,6 +48,10 @@ + #include + #endif + ++#include ++#include ++#include ++ + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FORWARD DECLARATIONS + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/tur/flightgear/pthread_cancel.patch b/tur/flightgear/pthread_cancel.patch new file mode 100644 index 0000000000..285f605633 --- /dev/null +++ b/tur/flightgear/pthread_cancel.patch @@ -0,0 +1,30 @@ +diff -ur orig/3rdparty/iaxclient/lib/unixfuncs.c mod/3rdparty/iaxclient/lib/unixfuncs.c +--- orig/3rdparty/iaxclient/lib/unixfuncs.c 2025-02-19 09:53:41.000000000 +0100 ++++ mod/3rdparty/iaxclient/lib/unixfuncs.c 2025-03-06 11:22:36.010228007 +0100 +@@ -291,7 +291,7 @@ + cleanup: + b->CanaryRun = 0; + DBUG("WatchDogProc: cancel Canary\n"); +- pthread_cancel( b->CanaryThread ); ++ pthread_kill( b->CanaryThread , SIGUSR2); + DBUG("WatchDogProc: join Canary\n"); + pthread_join( b->CanaryThread, NULL ); + DBUG("WatchDogProc: forget Canary\n"); +@@ -310,7 +310,7 @@ + { + b->WatchDogRun = 0; + DBUG("StopWatchDog: cancel WatchDog\n"); +- pthread_cancel( b->WatchDogThread ); ++ pthread_kill( b->WatchDogThread , SIGUSR2); + pthread_join( b->WatchDogThread, NULL ); + b->IsWatchDogThreadValid = 0; + } +@@ -319,7 +319,7 @@ + { + b->CanaryRun = 0; + DBUG("StopWatchDog: cancel Canary\n"); +- pthread_cancel( b->CanaryThread ); ++ pthread_kill( b->CanaryThread , SIGUSR2); + DBUG("StopWatchDog: join Canary\n"); + pthread_join( b->CanaryThread, NULL ); + b->IsCanaryThreadValid = 0; diff --git a/tur/flightgear/remove_x86_simd.patch b/tur/flightgear/remove_x86_simd.patch new file mode 100644 index 0000000000..2699e45130 --- /dev/null +++ b/tur/flightgear/remove_x86_simd.patch @@ -0,0 +1,24 @@ +Tylko w mod: build +diff -ur orig/CMakeLists.txt mod/CMakeLists.txt +--- orig/CMakeLists.txt 2025-02-19 09:53:41.000000000 +0100 ++++ mod/CMakeLists.txt 2025-03-06 11:14:23.441895531 +0100 +@@ -455,7 +455,8 @@ + set(WARNING_FLAGS_C "-Wall") + + if (X86 OR X86_64) +- set(SIMD_COMPILER_FLAGS "-msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize") ++ #set(SIMD_COMPILER_FLAGS "-msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize") ++ set(SIMD_COMPILER_FLAGS "") + endif() + + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG") +@@ -478,7 +479,8 @@ + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG") + +- set(SIMD_COMPILER_FLAGS "-msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize") ++# set(SIMD_COMPILER_FLAGS "-msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize") ++set(SIMD_COMPILER_FLAGS "") + set(WARNING_FLAGS_C "-Wall") + endif() + diff --git a/tur/openscenegraph/build.sh b/tur/openscenegraph/build.sh new file mode 100644 index 0000000000..d547cbf775 --- /dev/null +++ b/tur/openscenegraph/build.sh @@ -0,0 +1,22 @@ +TERMUX_PKG_HOMEPAGE=http://www.openscenegraph.org +TERMUX_PKG_DESCRIPTION="The OpenSceneGraph is an open source high performance 3D graphics toolkit, used by application developers in fields such as visual simulation, games, virtual reality, scientific visualization and modelling. (Flightgear Fork)" +TERMUX_PKG_LICENSE="LGPL-2.0" +TERMUX_PKG_MAINTAINER="@termux-user-repository" +TERMUX_PKG_VERSION=2024 +TERMUX_PKG_SRCURL=https://gitlab.com/flightgear/openscenegraph/-/archive/release/$TERMUX_PKG_VERSION-build/openscenegraph-release-$TERMUX_PKG_VERSION-build.tar.bz2 +TERMUX_PKG_SHA256=bf4da20bba1f434a03824b669a79a85b4124b997b2fa5b159d42722bb1e012e9 +TERMUX_PKG_DEPENDS="freetype, sdl, gdal, libasio, libvncserver" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=' +-DANDROID=false +-DLINUX=true +-DUNIX=true +-DCMAKE_SYSTEM_NAME=Linux +-D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE=0 +' + +termux_step_pre_configure() { + export TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DMATH_LIBRARY=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libm.so" + export CXXFLAGS+=" -std=c++11" + export LDFLAGS+=" -lXinerama" +} diff --git a/tur/openscenegraph/pthread.patch b/tur/openscenegraph/pthread.patch new file mode 100644 index 0000000000..e9541d44b3 --- /dev/null +++ b/tur/openscenegraph/pthread.patch @@ -0,0 +1,36 @@ +diff -ur orig/src/OpenThreads/pthreads/PThread.cpp mod/src/OpenThreads/pthreads/PThread.cpp +--- orig/src/OpenThreads/pthreads/PThread.cpp 2025-03-09 23:42:15.000000000 +0100 ++++ mod/src/OpenThreads/pthreads/PThread.cpp 2025-03-12 17:10:48.006488947 +0100 +@@ -757,6 +757,7 @@ + // + int Thread::testCancel() + { ++#undef HAVE_PTHREAD_TESTCANCEL + #if defined(HAVE_PTHREAD_TESTCANCEL) + PThreadPrivateData *pd = static_cast (_prvData); + +@@ -779,6 +780,7 @@ + // Use: public + // + int Thread::cancel() ++#undef HAVE_PTHREAD_CANCEL + { + #if defined(HAVE_PTHREAD_CANCEL) + PThreadPrivateData *pd = static_cast (_prvData); +@@ -802,6 +804,7 @@ + // + int Thread::setCancelModeDisable() + { ++#undef HAVE_PTHREAD_SETCANCELSTATE + #if defined(HAVE_PTHREAD_SETCANCELSTATE) + return pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, 0 ); + #else +@@ -816,7 +819,7 @@ + // Use: public + // + int Thread::setCancelModeAsynchronous() { +- ++#undef HAVE_PTHREAD_SETCANCELSTATE + #if defined(HAVE_PTHREAD_SETCANCELSTATE) + int status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); + if(status != 0) return status; diff --git a/tur/plib/00_fix_kfreebsd_FTBFS.patch b/tur/plib/00_fix_kfreebsd_FTBFS.patch new file mode 100644 index 0000000000..c3e0200fb0 --- /dev/null +++ b/tur/plib/00_fix_kfreebsd_FTBFS.patch @@ -0,0 +1,49 @@ +Description: _fix_kfreebsd_FTBFS.diff +Index: plib/src/js/jsBSD.cxx +=================================================================== +--- plib.orig/src/js/jsBSD.cxx 2009-06-09 18:18:17.000000000 +0100 ++++ plib/src/js/jsBSD.cxx 2009-12-14 22:12:02.000000000 +0000 +@@ -47,7 +47,7 @@ + #include + #include + #include +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + # include + #else + # include // For analog joysticks +Index: plib/src/sl/slDSP.cxx +=================================================================== +--- plib.orig/src/sl/slDSP.cxx 2009-06-09 18:18:17.000000000 +0100 ++++ plib/src/sl/slDSP.cxx 2009-12-14 22:12:02.000000000 +0000 +@@ -413,7 +413,7 @@ + /* NetBSD/OpenBSD 2.3 this should be very close to SUN Audio */ + /* ------------------------------------------------------------ */ + +-#elif (defined(UL_BSD) && !defined(__FreeBSD__)) || defined(UL_SOLARIS) ++#elif (defined(UL_BSD) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)) || defined(UL_SOLARIS) + void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) + { + +Index: plib/src/sl/slPortability.h +=================================================================== +--- plib.orig/src/sl/slPortability.h 2009-06-09 18:18:17.000000000 +0100 ++++ plib/src/sl/slPortability.h 2009-12-14 22:12:02.000000000 +0000 +@@ -59,7 +59,7 @@ + # if defined(UL_LINUX) + # include + # include +-# elif defined(__FreeBSD__) ++# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + # include + # else + /* +@@ -75,7 +75,7 @@ + #endif + + #ifdef UL_BSD +-#ifndef __FreeBSD__ ++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) + # include + #endif + #endif diff --git a/tur/plib/01_fix_hurd_FTBFS.patch b/tur/plib/01_fix_hurd_FTBFS.patch new file mode 100644 index 0000000000..53b423c61b --- /dev/null +++ b/tur/plib/01_fix_hurd_FTBFS.patch @@ -0,0 +1,58 @@ +Description: _fix_hurd_FTBFS.diff +--- a/src/js/jsNone.cxx ++++ b/src/js/jsNone.cxx +@@ -22,7 +22,7 @@ + + #include "js.h" + +-#if defined(UL_IRIX) || defined(UL_SOLARIS) || defined (UL_HPUX) ++#if defined(UL_IRIX) || defined(UL_SOLARIS) || defined (UL_HPUX) || defined(UL_GNU) + + struct os_specific_s ; + +--- a/src/util/ul.h ++++ b/src/util/ul.h +@@ -92,6 +92,10 @@ + + #define UL_HPUX 1 + ++#elif defined(__GNU__) ++ ++#define UL_GNU 1 ++ + #elif (defined(__unix__) || defined(unix)) && !defined(USG) + + #define UL_BSD 1 +@@ -144,6 +148,12 @@ + #define UL_GLX 1 + #endif + ++#ifdef UL_GNU ++#include ++#include ++#define UL_GLX 1 ++#endif ++ + #include + #include + #include +--- a/src/sl/slPortability.h ++++ b/src/sl/slPortability.h +@@ -51,7 +51,7 @@ + #include + #include + +-#if (defined(UL_LINUX) || defined(UL_BSD)) && !defined(__NetBSD__) ++#if (defined(UL_LINUX) || defined(UL_BSD) || defined(UL_GNU)) && !defined(__NetBSD__) + #define SL_USING_OSS_AUDIO 1 + #endif + +@@ -59,7 +59,7 @@ + # if defined(UL_LINUX) + # include + # include +-# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(UL_GNU) + # include + # else + /* diff --git a/tur/plib/03_remove_pthread_link.patch b/tur/plib/03_remove_pthread_link.patch new file mode 100644 index 0000000000..30dd368631 --- /dev/null +++ b/tur/plib/03_remove_pthread_link.patch @@ -0,0 +1,13 @@ +Description: _remove_pthread_link.diff + diff -Naur plib-1.8.5.orig/configure.in plib-1.8.5/configure.in +--- plib-1.8.5.orig/configure.in 2008-04-17 20:05:09.000000000 +0100 ++++ plib-1.8.5/configure.in 2008-04-17 20:04:50.000000000 +0100 +@@ -286,7 +286,7 @@ + + dnl Reasonable stuff non-windoze variants ... :-) + +- AC_CHECK_LIB(pthread, pthread_create) ++# AC_CHECK_LIB(pthread, pthread_create) + AC_CHECK_LIB(GL, glNewList) + if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then + dnl if no GL, check for MesaGL diff --git a/tur/plib/04_CVE-2011-4620.patch b/tur/plib/04_CVE-2011-4620.patch new file mode 100644 index 0000000000..455938acab --- /dev/null +++ b/tur/plib/04_CVE-2011-4620.patch @@ -0,0 +1,12 @@ +Description: _CVE 2011 4620.diff +--- a/src/util/ulError.cxx ++++ b/src/util/ulError.cxx +@@ -39,7 +39,7 @@ + { + va_list argp; + va_start ( argp, fmt ) ; +- vsprintf ( _ulErrorBuffer, fmt, argp ) ; ++ vsnprintf ( _ulErrorBuffer, sizeof(_ulErrorBuffer), fmt, argp ) ; + va_end ( argp ) ; + + if ( _ulErrorCB ) diff --git a/tur/plib/05_CVE-2012-4552.patch b/tur/plib/05_CVE-2012-4552.patch new file mode 100644 index 0000000000..19cabb5dbe --- /dev/null +++ b/tur/plib/05_CVE-2012-4552.patch @@ -0,0 +1,56 @@ +Description: _CVE 2012 4552.diff + diff -up plib-1.8.5/src/ssg/ssgParser.cxx~ plib-1.8.5/src/ssg/ssgParser.cxx +--- plib-1.8.5/src/ssg/ssgParser.cxx~ 2008-03-11 03:06:23.000000000 +0100 ++++ plib-1.8.5/src/ssg/ssgParser.cxx 2012-11-01 15:33:12.424483374 +0100 +@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form + char msgbuff[ 255 ]; + va_list argp; + +- char* msgptr = msgbuff; +- if (linenum) +- { +- msgptr += sprintf ( msgptr,"%s, line %d: ", +- path, linenum ); +- } +- + va_start( argp, format ); +- vsprintf( msgptr, format, argp ); ++ vsnprintf( msgbuff, sizeof(msgbuff), format, argp ); + va_end( argp ); + +- ulSetError ( UL_WARNING, "%s", msgbuff ) ; ++ if (linenum) ++ { ++ ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ; ++ } else { ++ ulSetError ( UL_WARNING, "%s", msgbuff ) ; ++ } + } + + +@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo + char msgbuff[ 255 ]; + va_list argp; + +- char* msgptr = msgbuff; +- if (linenum) +- { +- msgptr += sprintf ( msgptr,"%s, line %d: ", +- path, linenum ); +- } +- + va_start( argp, format ); +- vsprintf( msgptr, format, argp ); ++ vsnprintf( msgbuff, sizeof(msgbuff), format, argp ); + va_end( argp ); + +- ulSetError ( UL_DEBUG, "%s", msgbuff ) ; ++ if (linenum) ++ { ++ ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ; ++ } else { ++ ulSetError ( UL_DEBUG, "%s", msgbuff ) ; ++ } + } + + // Opens the file and does a few internal calculations based on the spec. diff --git a/tur/plib/06_spelling_errors.patch b/tur/plib/06_spelling_errors.patch new file mode 100644 index 0000000000..3f56a7db8a --- /dev/null +++ b/tur/plib/06_spelling_errors.patch @@ -0,0 +1,28 @@ +Description: Fix spelling errors in code + s/implmented/implemented, s/adress/address +Author: Tobias Frost +Last-Update: 2017-07-24 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/ssg/ssgSaveDXF.cxx ++++ b/src/ssg/ssgSaveDXF.cxx +@@ -102,7 +102,7 @@ + } + } + else +- ulSetError ( UL_WARNING, "ssgSaveDXF: OpenGL mode %d not implmented yet. Parts or all of the model are ignored!' for writing", (int)mode ) ; ++ ulSetError ( UL_WARNING, "ssgSaveDXF: OpenGL mode %d not implemented yet. Parts or all of the model are ignored!' for writing", (int)mode ) ; + } + + +--- a/src/ssg/ssgLoadMDL.cxx ++++ b/src/ssg/ssgLoadMDL.cxx +@@ -1858,7 +1858,7 @@ + fseek(fp, -12, SEEK_CUR); + unsigned long addr = ftell(fp); + if(addr&1L) +- printf("strange... found RIFF, but on an odd adress %lx\n", addr); ++ printf("strange... found RIFF, but on an odd address %lx\n", addr); + else + printf("found a good RIFF header at address %lx\n", addr); + FindBGLBeginRIFF(fp); diff --git a/tur/plib/07_dont_break_joystick_system_calibration.patch b/tur/plib/07_dont_break_joystick_system_calibration.patch new file mode 100644 index 0000000000..ba904c5cf1 --- /dev/null +++ b/tur/plib/07_dont_break_joystick_system_calibration.patch @@ -0,0 +1,30 @@ +Description: Don't break system calibration settings when a joystick is opened + plib may do additional dead-band management on top of the OS joystick driver, + it should not break system settings for that reason! +Bug: https://sourceforge.net/p/plib/bugs/47/ +Bug-Debian: https://bugs.debian.org/787464 +Author: Florent Rougon +Last-Update: 2015-06-01 +--- a/src/js/jsLinux.cxx ++++ b/src/js/jsLinux.cxx +@@ -79,20 +79,6 @@ + if ( num_axes > _JS_MAX_AXES ) + num_axes = _JS_MAX_AXES ; + +- // Remove any deadband value already done in the kernel. +- // Since we have our own deadband management this is save to do so. +- struct js_corr* corr = new js_corr[ all_axes ] ; +- ioctl ( os->fd, JSIOCGCORR, corr ); +- for ( int i = 0; i < num_axes ; ++i ) { +- if ( corr[ i ] . type == JS_CORR_BROKEN ) { +- int nodeadband = ( corr[ i ] . coef[ 0 ] + corr[ i ] . coef[ 1 ] ) / 2 ; +- corr[ i ] . coef[ 0 ] = nodeadband ; +- corr[ i ] . coef[ 1 ] = nodeadband ; +- } +- } +- ioctl ( os->fd, JSIOCSCORR, corr ); +- delete [] corr; +- + for ( int i = 0 ; i < _JS_MAX_AXES ; i++ ) + { + max [ i ] = 32767.0f ; diff --git a/tur/plib/08_CVE-2021-38714.patch b/tur/plib/08_CVE-2021-38714.patch new file mode 100644 index 0000000000..1336677275 --- /dev/null +++ b/tur/plib/08_CVE-2021-38714.patch @@ -0,0 +1,64 @@ +Description: Prevent integer overflow in ssgLoadTGA() function. CVE-2021-38714 +Author: Anton Gladky +Bug-Debian: https://bugs.debian.org/992973 +Last-Update: 2021-10-02 + +Index: plib/src/ssg/ssgLoadTGA.cxx +=================================================================== +--- plib.orig/src/ssg/ssgLoadTGA.cxx ++++ plib/src/ssg/ssgLoadTGA.cxx +@@ -23,6 +23,7 @@ + + + #include "ssgLocal.h" ++#include + + #ifdef SSG_LOAD_TGA_SUPPORTED + +@@ -103,9 +104,9 @@ bool ssgLoadTGA ( const char *fname, ssg + + // image info + int type = header[2]; +- int xsize = get16u(header + 12); +- int ysize = get16u(header + 14); +- int bits = header[16]; ++ unsigned int xsize = get16u(header + 12); ++ unsigned int ysize = get16u(header + 14); ++ unsigned int bits = header[16]; + + /* image types: + * +@@ -169,9 +170,32 @@ bool ssgLoadTGA ( const char *fname, ssg + } + + ++ const auto bytes_to_allocate = (bits / 8) * xsize * ysize; ++ ++ ulSetError( UL_DEBUG, "bytes_to_allocate=%ld xsize = %ld, ysize = %ld, %ld == %ld ", bytes_to_allocate, xsize, ysize, bytes_to_allocate / xsize, (ysize * (bits / 8))); ++ ++ if (xsize != 0 && ((ysize * (bits / 8)) != bytes_to_allocate / xsize)) ++ { ++ ulSetError( UL_WARNING, "Integer overflow in image size: xsize = %d, ysize = %d", xsize, ysize); ++ return false; ++ } ++ else ++ { ++ ulSetError( UL_DEBUG, "ssgLoadTGA: Allocating %ld bytes for the size %d x %d", bytes_to_allocate, xsize, ysize ); ++ } ++ + // read image data + +- GLubyte *image = new GLubyte [ (bits / 8) * xsize * ysize ]; ++ GLubyte *image; ++ try ++ { ++ image = new GLubyte [ bytes_to_allocate ]; ++ } ++ catch (const std::bad_alloc&) ++ { ++ ulSetError( UL_WARNING, "ssgLoadTGA: Allocation of %d bytes failed!", bytes_to_allocate); ++ return false; ++ } + + if ((type & 8) != 0) + { diff --git a/tur/plib/build.sh b/tur/plib/build.sh new file mode 100644 index 0000000000..19a31c1e91 --- /dev/null +++ b/tur/plib/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=https://plib.sourceforge.net +TERMUX_PKG_DESCRIPTION="Provides a Joystick interface, a simple GUI built on top of OpenGL, some standard geometry functions, a sound library and a simple scene graph API built on top of OpenGL." +TERMUX_PKG_LICENSE="BSD" +TERMUX_PKG_MAINTAINER="@termux-user-repository" +TERMUX_PKG_VERSION=1.8.5 +TERMUX_PKG_SRCURL=http://deb.debian.org/debian/pool/main/p/plib/plib_${TERMUX_PKG_VERSION}.orig.tar.gz +TERMUX_PKG_SHA256=485b22bf6fdc0da067e34ead5e26f002b76326f6371e2ae006415dea6a380a32 +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +ac_cv_lib_MesaGL_glNewList=yes +" + +termux_step_pre_configure() { + export LDFLAGS+=" -Wl,--no-as-needed,-lOpenSLES,--as-needed" + ./autogen.sh + touch ltmain.sh +} diff --git a/tur/plib/remote_register.patch b/tur/plib/remote_register.patch new file mode 100644 index 0000000000..cc645ff843 --- /dev/null +++ b/tur/plib/remote_register.patch @@ -0,0 +1,93 @@ +diff -ur orig/src/sl/slEnvelope.cxx mod/src/sl/slEnvelope.cxx +--- orig/src/sl/slEnvelope.cxx 2008-03-11 03:06:24.000000000 +0100 ++++ mod/src/sl/slEnvelope.cxx 2025-03-06 07:54:26.811205277 +0100 +@@ -160,7 +160,7 @@ + + while ( nframes-- ) + { +- register int res = (int)( (float)((int)*(src++)-0x80) * _value ) + 0x80 ; ++ int res = (int)( (float)((int)*(src++)-0x80) * _value ) + 0x80 ; + + _value += delta ; + +@@ -175,16 +175,16 @@ + float _time = slScheduler::getCurrent() -> getElapsedTime ( start ) ; + int step = getStepDelta ( &_time, &delta ) ; + float _value = delta * (_time - time[step]) + value[step] ; +- register float p_v = previous_value; ++ float p_v = previous_value; + delta /= (float) slScheduler::getCurrent() -> getRate () ; + + while ( nframes-- ) + { + +- register float c_v = (float) ((int)*(src++) - 0x80); +- register float f=_value; ++ float c_v = (float) ((int)*(src++) - 0x80); ++ float f=_value; + p_v = p_v*(1.0f - f)+ f*c_v; +- register int res = (int)(p_v) + 0x80 ; ++ int res = (int)(p_v) + 0x80 ; + _value += delta ; + + *(dst++) = ( res > 255 ) ? 255 : ( res < 0 ) ? 0 : res ; +@@ -208,7 +208,7 @@ + + while ( nframes-- ) + { +- register int res = (int)( (float)((int)*(src++)-0x80) * _value ) + 0x80 ; ++ int res = (int)( (float)((int)*(src++)-0x80) * _value ) + 0x80 ; + + _value += delta ; + +diff -ur orig/src/sl/slScheduler.cxx mod/src/sl/slScheduler.cxx +--- orig/src/sl/slScheduler.cxx 2008-03-11 03:06:24.000000000 +0100 ++++ mod/src/sl/slScheduler.cxx 2025-03-06 07:54:34.019087576 +0100 +@@ -229,9 +229,9 @@ + break ; + + case 2: +- { register int l = mixer_buffer_size ; +- register Uchar *d = mixer_buffer, *a, *b ; +- register int t, x = l / 100 ; ++ { int l = mixer_buffer_size ; ++ Uchar *d = mixer_buffer, *a, *b ; ++ int t, x = l / 100 ; + psp[0] -> read ( l, a = mixer_inputs [ 0 ] ) ; + psp[1] -> read ( l, b = mixer_inputs [ 1 ] ) ; + while ( l-- ) +@@ -243,9 +243,9 @@ + } break; + + case 3: +- { register int l = mixer_buffer_size ; +- register Uchar *d = mixer_buffer, *a, *b, *c ; +- register int t, x = l / 100 ; ++ { int l = mixer_buffer_size ; ++ Uchar *d = mixer_buffer, *a, *b, *c ; ++ int t, x = l / 100 ; + psp[0] -> read ( l, a = mixer_inputs [ 0 ] ) ; + psp[1] -> read ( l, b = mixer_inputs [ 1 ] ) ; + psp[2] -> read ( l, c = mixer_inputs [ 2 ] ) ; +@@ -260,17 +260,17 @@ + default: + { /* How much data to get, and where to put it */ + int l = mixer_buffer_size ; +- register Uchar *d = mixer_buffer ; ++ Uchar *d = mixer_buffer ; + /* We compute one value in here, in the loop below */ +- register int t ; ++ int t ; + /* We need to determine the maximum range of values */ + int tmax = 0x80, tmin = 0x80; + /* A pointer to the element about to be added to "t" */ +- register Uchar **p ; ++ Uchar **p ; + /* Sound cards use offset binary, so do zero adjustment */ + int z = ( (int) 0x8000 / mixer_gain ) - ( inputsused * 0x80 ) ; + /* An array of pointers to keep in step with "d" above */ +- register Uchar * s [ SL_MAX_MIXERINPUTS + 1 ] ; ++ Uchar * s [ SL_MAX_MIXERINPUTS + 1 ] ; + /* First thing is to read individual channels into buffers */ + for ( i = 0; i < inputsused; i++ ) + psp[i] -> read ( l, s [ i ] = mixer_inputs [ i ] ); diff --git a/tur/plib/ushort.patch b/tur/plib/ushort.patch new file mode 100644 index 0000000000..39cf4a68b0 --- /dev/null +++ b/tur/plib/ushort.patch @@ -0,0 +1,11 @@ +diff -ur orig/src/ssg/ssgLoadFLT.cxx mod/src/ssg/ssgLoadFLT.cxx +--- orig/src/ssg/ssgLoadFLT.cxx 2008-03-11 03:06:23.000000000 +0100 ++++ mod/src/ssg/ssgLoadFLT.cxx 2025-03-06 09:47:47.183363147 +0100 +@@ -116,6 +116,7 @@ + # include + #endif + ++using ushort = unsigned short; + + #ifndef O_BINARY + # define O_BINARY 0 diff --git a/tur/simgear/build.sh b/tur/simgear/build.sh new file mode 100644 index 0000000000..11763eca64 --- /dev/null +++ b/tur/simgear/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=https://www.flightgear.org/ +TERMUX_PKG_DESCRIPTION="SimGear - simulation libraries for FlightGear" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="2024.1.1" +TERMUX_PKG_SRCURL=https://gitlab.com/flightgear/simgear/-/archive/v${TERMUX_PKG_VERSION}/simgear-v${TERMUX_PKG_VERSION}.tar.bz2 +TERMUX_PKG_SHA256=b75d3940d923a46c445c9afa6f8eb09f6a944ff23c4b546e72ba75fb5482a794 +TERMUX_PKG_DEPENDS="boost, mesa, openal-soft, openscenegraph, libcurl" +TERMUX_PKG_BUILD_DEPENDS="libglvnd-dev, mesa-dev" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=' +-DCMAKE_C_FLAGS="-DXML_POOR_ENTROPY" +-DCMAKE_CXX_FLAGS="-DXML_POOR_ENTROPY" +' + +termux_step_pre_configure() { + export LDFLAGS+=" -Wl,--no-as-needed,-lOpenSLES,--as-needed" +} diff --git a/tur/simgear/fix_compression.patch b/tur/simgear/fix_compression.patch new file mode 100644 index 0000000000..336d99f72b --- /dev/null +++ b/tur/simgear/fix_compression.patch @@ -0,0 +1,38 @@ +diff -ur orig/simgear/scene/util/SGImageUtils.cxx mod/simgear/scene/util/SGImageUtils.cxx +--- orig/simgear/scene/util/SGImageUtils.cxx 2024-12-02 22:40:19.000000000 +0100 ++++ mod/simgear/scene/util/SGImageUtils.cxx 2024-12-03 22:34:42.074628057 +0100 +@@ -1077,21 +1077,21 @@ + + #else // OSG_GLES2_AVAILABLE + +- if (caps.supportsTextureCompression(osg::Texture::USE_PVRTC_4BPP_COMPRESSION)) +- { +- out_mode = osg::Texture::USE_PVRTC_4BPP_COMPRESSION; +- return true; +- } +- else if (caps.supportsTextureCompression(osg::Texture::USE_PVRTC_2BPP_COMPRESSION)) +- { +- out_mode = osg::Texture::USE_PVRTC_2BPP_COMPRESSION; +- return true; +- } +- else if (caps.supportsTextureCompression(osg::Texture::USE_ETC_COMPRESSION)) +- { ++// if (caps.supportsTextureCompression(osg::Texture::USE_PVRTC_4BPP_COMPRESSION)) ++// { ++// out_mode = osg::Texture::USE_PVRTC_4BPP_COMPRESSION; ++// return true; ++// } ++// else if (caps.supportsTextureCompression(osg::Texture::USE_PVRTC_2BPP_COMPRESSION)) ++// { ++// out_mode = osg::Texture::USE_PVRTC_2BPP_COMPRESSION; ++// return true; ++// } ++// else if (caps.supportsTextureCompression(osg::Texture::USE_ETC_COMPRESSION)) ++// { + out_mode = osg::Texture::USE_ETC_COMPRESSION; + return true; +- } ++// } + + #endif + diff --git a/tur/simgear/fix_i686_register_storage_class.patch b/tur/simgear/fix_i686_register_storage_class.patch new file mode 100644 index 0000000000..80ccaf6be2 --- /dev/null +++ b/tur/simgear/fix_i686_register_storage_class.patch @@ -0,0 +1,13 @@ +diff -ur a/simgear/structure/SGAtomic.hxx b/simgear/structure/SGAtomic.hxx +--- a/simgear/structure/SGAtomic.hxx 2025-02-20 09:42:31.000000000 +0100 ++++ b/simgear/structure/SGAtomic.hxx 2025-04-12 21:38:14.708733151 +0200 +@@ -21,8 +21,7 @@ + #ifndef SGAtomic_HXX + #define SGAtomic_HXX + +-#if defined(__GNUC__) && ((4 < __GNUC__)||(4 == __GNUC__ && 1 <= __GNUC_MINOR__)) && \ +- defined(__x86_64__) ++#if defined(__GNUC__) && ((4 < __GNUC__)||(4 == __GNUC__ && 1 <= __GNUC_MINOR__)) + // No need to include something. Is a Compiler API ... + # define SGATOMIC_USE_GCC4_BUILTINS + #elif defined(__GNUC__) && defined(__i386__) diff --git a/tur/simgear/glh.patch b/tur/simgear/glh.patch new file mode 100644 index 0000000000..83801007ea --- /dev/null +++ b/tur/simgear/glh.patch @@ -0,0 +1,104 @@ +diff -ur orig/simgear/canvas/ODGauge.cxx mod/simgear/canvas/ODGauge.cxx +--- orig/simgear/canvas/ODGauge.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/canvas/ODGauge.cxx 2025-03-06 10:01:58.884479363 +0100 +@@ -49,6 +49,8 @@ + + #include + ++#include ++ + namespace simgear + { + namespace canvas +diff -ur orig/simgear/scene/material/Effect.cxx mod/simgear/scene/material/Effect.cxx +--- orig/simgear/scene/material/Effect.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/material/Effect.cxx 2025-03-06 10:02:18.496140184 +0100 +@@ -81,6 +81,8 @@ + #include + #include + ++#include ++ + namespace simgear + { + using namespace std; +diff -ur orig/simgear/scene/model/SGClipGroup.cxx mod/simgear/scene/model/SGClipGroup.cxx +--- orig/simgear/scene/model/SGClipGroup.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/model/SGClipGroup.cxx 2025-03-06 10:06:09.360152850 +0100 +@@ -34,6 +34,8 @@ + #include + #include + ++#include ++ + class SGClipGroup::ClipRenderBin : public osgUtil::RenderBin { + public: + virtual osg::Object* cloneType() const +diff -ur orig/simgear/scene/sky/dome.cxx mod/simgear/scene/sky/dome.cxx +--- orig/simgear/scene/sky/dome.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/sky/dome.cxx 2025-03-06 10:10:20.859993353 +0100 +@@ -48,6 +48,7 @@ + #include + #include + ++#include + #include "dome.hxx" + + using namespace osg; +diff -ur orig/simgear/scene/sky/moon.cxx mod/simgear/scene/sky/moon.cxx +--- orig/simgear/scene/sky/moon.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/sky/moon.cxx 2025-03-06 10:10:35.511749704 +0100 +@@ -48,6 +48,7 @@ + #include + #include + ++#include + #include "sphere.hxx" + #include "moon.hxx" + +diff -ur orig/simgear/scene/sky/stars.cxx mod/simgear/scene/sky/stars.cxx +--- orig/simgear/scene/sky/stars.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/sky/stars.cxx 2025-03-06 10:10:05.876242340 +0100 +@@ -54,6 +54,7 @@ + #include + #include + ++#include + #include "stars.hxx" + + using namespace simgear; +diff -ur orig/simgear/scene/tgdb/SGVasiDrawable.cxx mod/simgear/scene/tgdb/SGVasiDrawable.cxx +--- orig/simgear/scene/tgdb/SGVasiDrawable.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/tgdb/SGVasiDrawable.cxx 2025-03-06 10:13:49.612507068 +0100 +@@ -23,6 +23,7 @@ + # include + #endif + ++#include + #include + + #include "SGVasiDrawable.hxx" +diff -ur orig/simgear/scene/tgdb/ShaderGeometry.cxx mod/simgear/scene/tgdb/ShaderGeometry.cxx +--- orig/simgear/scene/tgdb/ShaderGeometry.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/scene/tgdb/ShaderGeometry.cxx 2025-03-06 10:23:09.319059081 +0100 +@@ -24,7 +24,7 @@ + #include + + #include "ShaderGeometry.hxx" +- ++#include + #include + + using namespace osg; +diff -ur orig/simgear/screen/tr.cxx mod/simgear/screen/tr.cxx +--- orig/simgear/screen/tr.cxx 2025-02-20 09:42:31.000000000 +0100 ++++ mod/simgear/screen/tr.cxx 2025-03-06 09:59:12.175366358 +0100 +@@ -147,7 +147,7 @@ + #include + + #include "tr.h" +- ++#include + + #define DEFAULT_TILE_WIDTH 256 + #define DEFAULT_TILE_HEIGHT 256