[packages/FlightGear] - proper fix for OpenSceneGraph API changes - updated BRs - builds, but segfaults on startup

baggins baggins at pld-linux.org
Fri Nov 7 01:08:09 CET 2014


commit aaa9c0e2b0d5c5be709a1ec4efaa107f2ec95948
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Nov 7 00:46:46 2014 +0100

    - proper fix for OpenSceneGraph API changes
    - updated BRs
    - builds, but segfaults on startup

 FlightGear.spec            |  11 ++-
 OpenSceneGraph-3.3.2.patch | 163 +++++++++------------------------------------
 2 files changed, 40 insertions(+), 134 deletions(-)
---
diff --git a/FlightGear.spec b/FlightGear.spec
index 1efc76b..2432a2d 100644
--- a/FlightGear.spec
+++ b/FlightGear.spec
@@ -20,12 +20,16 @@ Patch1:		OpenSceneGraph-3.3.2.patch
 URL:		http://www.flightgear.org/
 BuildRequires:	OpenAL-devel
 BuildRequires:	OpenGL-devel
+BuildRequires:	OpenSceneGraph-devel
 BuildRequires:	SimGear-devel = %{version}
 BuildRequires:	cmake
+BuildRequires:	flite-devel
 BuildRequires:	fltk-gl-devel
 BuildRequires:	freeglut-devel
+BuildRequires:	libgsm-devel
 BuildRequires:	libstdc++-devel
-BuildRequires:	libxml-devel
+BuildRequires:	speex-devel
+BuildRequires:	sqlite3-devel
 BuildRequires:	plib-devel >= 1.8.5-3
 BuildRequires:	zlib-devel
 Requires:	%{name}-data = %{version}
@@ -71,12 +75,15 @@ EOF
 %build
 install -d build
 cd build
-%cmake ..
+%cmake .. \
+	-DSYSTEM_SQLITE:BOOL=ON
+
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_datadir}/games/%{name}
+
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
diff --git a/OpenSceneGraph-3.3.2.patch b/OpenSceneGraph-3.3.2.patch
index c38d585..e84b8b7 100644
--- a/OpenSceneGraph-3.3.2.patch
+++ b/OpenSceneGraph-3.3.2.patch
@@ -1,145 +1,44 @@
-diff --git a/src/Canvas/canvas_mgr.cxx b/src/Canvas/canvas_mgr.cxx
-index 6646b77..820934e 100644
---- a/src/Canvas/canvas_mgr.cxx
-+++ b/src/Canvas/canvas_mgr.cxx
-@@ -18,6 +18,8 @@
- 
- #include "canvas_mgr.hxx"
- 
-+#include <osg/Version>
-+
- #include <Cockpit/od_gauge.hxx>
- #include <Main/fg_props.hxx>
- #include <Scripting/NasalModelData.hxx>
-@@ -49,7 +51,11 @@ static sc::Placements addSceneObjectPlacement( SGPropertyNode* placement,
-     model_data->getNode(),
-     placement,
-     canvas->getTexture(),
-+#if OSG_VERSION_LESS_THAN(3,3,2)
-     canvas->getCullCallback(),
-+#else
-+    dynamic_cast<osg::NodeCallback*>(canvas->getCullCallback()),
-+#endif
-     canvas
-   );
- }
-diff --git a/src/FDM/groundcache.cxx b/src/FDM/groundcache.cxx
-index 0b34115..379d70a 100644
---- a/src/FDM/groundcache.cxx
-+++ b/src/FDM/groundcache.cxx
-@@ -36,6 +36,7 @@
- #include <osg/MatrixTransform>
- #include <osg/PositionAttitudeTransform>
- #include <osg/CameraView>
-+#include <osg/Version>
- 
- #include <simgear/sg_inlines.h>
- #include <simgear/constants.h>
-@@ -92,7 +93,11 @@ public:
-     }
-     virtual void apply(osg::Node& node)
-     {
-+#if OSG_VERSION_LESS_THAN(3,3,2)
-         if (!testBoundingSphere(node.getBound()))
-+#else
-+        if (!testBoundingSphere(node.getBoundingSphere()))
-+#endif
-             return;
- 
-         addBoundingVolume(node);
-@@ -100,7 +105,11 @@ public:
-     
-     virtual void apply(osg::Group& group)
-     {
-+#if OSG_VERSION_LESS_THAN(3,3,2)
-         if (!testBoundingSphere(group.getBound()))
-+#else
-+        if (!testBoundingSphere(group.getBoundingSphere()))
-+#endif
-             return;
- 
-         simgear::BVHSubTreeCollector::NodeList parentNodeList;
-@@ -133,7 +142,11 @@ public:
-         if (transform.getReferenceFrame() != osg::Transform::RELATIVE_RF)
-             return;
- 
-+#if OSG_VERSION_LESS_THAN(3,3,2)
-         if (!testBoundingSphere(transform.getBound()))
-+#else
-+        if (!testBoundingSphere(transform.getBoundingSphere()))
-+#endif
-             return;
- 
-         osg::Matrix inverseMatrix;
-diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx
-index 73d0b7f..d5fa933 100644
---- a/src/Scenery/scenery.cxx
-+++ b/src/Scenery/scenery.cxx
-@@ -34,6 +34,7 @@
- #include <osg/PositionAttitudeTransform>
- #include <osg/CameraView>
- #include <osg/LOD>
+--- flightgear-3.2.0/src/Model/panelnode.cxx.orig	2014-08-17 15:40:24.000000000 +0200
++++ flightgear-3.2.0/src/Model/panelnode.cxx	2014-11-02 12:27:29.031193511 +0100
+@@ -10,6 +10,7 @@
+ #include <osg/Geode>
+ #include <osg/Switch>
+ #include <osg/BlendFunc>
 +#include <osg/Version>
  
- #include <osgViewer/Viewer>
- 
-@@ -112,7 +113,11 @@ public:
-     {
-         if (&node == _skipNode)
-             return;
-+#if OSG_VERSION_LESS_THAN(3,3,2)
-         if (!testBoundingSphere(node.getBound()))
-+#else
-+        if (!testBoundingSphere(node.getBoundingSphere()))
-+#endif
-             return;
- 
-         addBoundingVolume(node);
-@@ -122,7 +127,11 @@ public:
-     {
-         if (&group == _skipNode)
-             return;
-+#if OSG_VERSION_LESS_THAN(3,3,2)
-         if (!testBoundingSphere(group.getBound()))
-+#else
-+        if (!testBoundingSphere(group.getBoundingSphere()))
-+#endif
-             return;
- 
-         traverse(group);
-@@ -153,7 +162,11 @@ private:
-         if (transform.getReferenceFrame() != osg::Transform::RELATIVE_RF)
-             return;
+ #include <simgear/compiler.h>
+ #include <simgear/structure/exception.hxx>
+@@ -315,7 +316,11 @@
+ }
  
+ osg::BoundingBox
 +#if OSG_VERSION_LESS_THAN(3,3,2)
-         if (!testBoundingSphere(transform.getBound()))
+ FGPanelNode::computeBound() const
 +#else
-+        if (!testBoundingSphere(transform.getBoundingSphere()))
++FGPanelNode::computeBoundingBox() const
 +#endif
-             return;
+ {
  
-         osg::Matrix inverseMatrix;
-diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx
-index 31d14c7..d49c1b1 100644
---- a/src/Scenery/tileentry.cxx
-+++ b/src/Scenery/tileentry.cxx
-@@ -29,6 +29,7 @@
- #include <istream>
- 
- #include <osg/LOD>
+   osg::Vec3 coords[3];
+--- flightgear-3.2.0/src/Model/panelnode.hxx.orig	2014-08-17 15:40:24.000000000 +0200
++++ flightgear-3.2.0/src/Model/panelnode.hxx	2014-11-02 12:27:11.551194127 +0100
+@@ -4,6 +4,7 @@
+ #include <osg/Vec3>
+ #include <osg/Matrix>
+ #include <osg/Drawable>
 +#include <osg/Version>
  
- #include <simgear/bucket/newbucket.hxx>
- #include <simgear/debug/logstream.hxx>
-@@ -81,7 +82,11 @@ void TileEntry::prep_ssg_node(float vis) {
-         return;
-     // visibility can change from frame to frame so we update the
-     // range selector cutoff's each time.
+ #include <memory>
+ #include <simgear/structure/SGSharedPtr.hxx>
+@@ -30,7 +31,11 @@
+     { drawImplementation(*renderInfo.getState()); }
+   
+     void drawImplementation(osg::State& state) const;
 +#if OSG_VERSION_LESS_THAN(3,3,2)
-     float bounding_radius = _node->getChild(0)->getBound().radius();
+     virtual osg::BoundingBox computeBound() const;
 +#else
-+    float bounding_radius = _node->getChild(0)->getBoundingSphere().radius();
++    virtual osg::BoundingBox computeBoundingBox() const;
 +#endif
-     _node->setRange( 0, 0, vis + bounding_radius );
- }
  
+     /** Return true, FGPanelNode does support accept(PrimitiveFunctor&). */
+     virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/FlightGear.git/commitdiff/aaa9c0e2b0d5c5be709a1ec4efaa107f2ec95948



More information about the pld-cvs-commit mailing list