Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tur/flightgear/build.sh
Original file line number Diff line number Diff line change
@@ -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"
}
130 changes: 130 additions & 0 deletions tur/flightgear/fake_fgrcc.patch
Original file line number Diff line number Diff line change
@@ -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 <EmbeddedResources/FlightGear-resources.hxx>
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 <memory>
+#include <utility>
+
+#include <simgear/io/iostreams/CharArrayStream.hxx>
+#include <simgear/io/iostreams/zlibstream.hxx>
+#include <simgear/embedded_resources/EmbeddedResource.hxx>
+#include <simgear/embedded_resources/EmbeddedResourceManager.hxx>
+
+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
176 changes: 176 additions & 0 deletions tur/flightgear/glh.patch
Original file line number Diff line number Diff line change
@@ -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 <GL/gl.h>

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 <GL/gl.h>
#include <simgear/misc/sg_path.hxx>
#include <simgear/debug/logstream.hxx>

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 <plib/sg.h>
#include <osg/GL>

+#include <GL/gl.h>
#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 <GL/gl.h>

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 <GL/gl.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sg_path.hxx>

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 <osgViewer/View>
#include <osgGA/GUIEventHandler>

+#include <GL/gl.h>
+
class DesktopGroup;
typedef SGSharedPtr<DesktopGroup> DesktopPtr;
typedef SGWeakPtr<DesktopGroup> 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 <GL/gl.h>

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 <GL/gl.h>
+
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 <simgear/constants.h>
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/props/props.hxx>
+#include <GL/gl.h>

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 <Main/globals.hxx>
+#include <GL/gl.h>

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 <Main/globals.hxx>
+#include <GL/gl.h>

// 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 <GL/gl.h>

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 <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/Registry>
+#include <GL/gl.h>

osg::Node* fgCreateMarkerNode(const osgText::String& label, float font_size, float pin_height, float tip_height, const osg::Vec4f& color)
{
14 changes: 14 additions & 0 deletions tur/flightgear/jsbsim.patch
Original file line number Diff line number Diff line change
@@ -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 <netdb.h>
#endif

+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
30 changes: 30 additions & 0 deletions tur/flightgear/pthread_cancel.patch
Original file line number Diff line number Diff line change
@@ -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;
Loading
Loading