[SimGear] fix ftbfs

Tom Callaway spot at fedoraproject.org
Mon Jan 16 18:57:15 UTC 2012


commit 75377a15e095d093dd9933af503a50ea7472f1d1
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Mon Jan 16 13:57:12 2012 -0500

    fix ftbfs

 SimGear-2.4.0-gcc47.patch                      |   12 ++
 SimGear.spec                                   |   17 +++-
 b261836f7182b5442b464907c8b084bde0bfded3.patch |  166 ++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 1 deletions(-)
---
diff --git a/SimGear-2.4.0-gcc47.patch b/SimGear-2.4.0-gcc47.patch
new file mode 100644
index 0000000..c2e25fd
--- /dev/null
+++ b/SimGear-2.4.0-gcc47.patch
@@ -0,0 +1,12 @@
+diff -up simgear-2.4.0/simgear/structure/SGExpression.hxx.gcc47 simgear-2.4.0/simgear/structure/SGExpression.hxx
+--- simgear-2.4.0/simgear/structure/SGExpression.hxx.gcc47	2012-01-16 13:34:03.229634670 -0500
++++ simgear-2.4.0/simgear/structure/SGExpression.hxx	2012-01-16 13:42:54.757625850 -0500
+@@ -1248,7 +1248,7 @@ namespace simgear
+     ConvertExpression() {}
+     ConvertExpression(::SGExpression<OpType>* expr0)
+     {
+-      addOperand(expr0);
++      this->addOperand(expr0);
+     }
+     virtual void eval(T& value, const simgear::expression::Binding* b) const
+     {
diff --git a/SimGear.spec b/SimGear.spec
index 08197e7..06d0c40 100644
--- a/SimGear.spec
+++ b/SimGear.spec
@@ -1,6 +1,6 @@
 Name:		SimGear
 Version:	2.4.0
-Release:	2%{?dist}
+Release:	3%{?dist}
 License:	GPLv2+
 Group:		System Environment/Libraries
 Summary:	Simulation library components
@@ -13,6 +13,13 @@ Patch2:		SimGear-2.4.0-dependencies.patch
 Patch4:		SimGear-2.0.0-more-archs.patch
 Patch5:		SimGear-2.4.0-expat.patch
 Patch100:	SimGear-1.9.0-headers.patch
+# http://code.google.com/p/flightgear-bugs/issues/detail?id=512
+# https://www.gitorious.org/fg/simgear/commit/b261836f7182b5442b464907c8b084bde0bfded3
+# Should be safe to drop when 2.6.0 lands.
+Patch101:	b261836f7182b5442b464907c8b084bde0bfded3.patch
+# https://www.gitorious.org/fg/simgear/commit/bcf7ed501d02d57cc8038c270db380a01a23da72
+# Should be safe to drop when 2.6.0 lands.
+Patch102:	SimGear-2.4.0-gcc47.patch
 BuildRequires:	openal-soft-devel, plib-devel >= 1.8.5
 BuildRequires:	OpenSceneGraph-devel >= 2.8.0
 BuildRequires:	boost-devel >= 1.37.0
@@ -51,6 +58,10 @@ SimGear.
 %patch4 -p1
 # Use expat
 %patch5 -p1 -b .expat
+# Fix boost
+%patch101 -p1 -b .boostfix
+# Fix compile with gcc 4.7.0
+%patch102 -p1 -b .gcc47
 
 # makes rpmlint happy
 find -name \*.cxx -o -name \*.hxx | xargs chmod -x
@@ -124,6 +135,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libsgxml.so
 
 %changelog
+* Mon Jan 16 2012 Tom Callaway <spot at fedoraproject.org> - 2.4.0-3
+- fix boost compile issue in rawhide
+- fix gcc 4.7 compile issue in rawhide
+
 * Thu Jan 12 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.4.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
diff --git a/b261836f7182b5442b464907c8b084bde0bfded3.patch b/b261836f7182b5442b464907c8b084bde0bfded3.patch
new file mode 100644
index 0000000..0e03370
--- /dev/null
+++ b/b261836f7182b5442b464907c8b084bde0bfded3.patch
@@ -0,0 +1,166 @@
+diff -up simgear-2.4.0/simgear/structure/Makefile.am.boostfix simgear-2.4.0/simgear/structure/Makefile.am
+--- simgear-2.4.0/simgear/structure/Makefile.am.boostfix	2012-01-16 13:22:19.943077138 -0500
++++ simgear-2.4.0/simgear/structure/Makefile.am	2012-01-16 13:23:02.489674415 -0500
+@@ -20,6 +20,7 @@ include_HEADERS = \
+ 	SGSmplstat.hxx \
+ 	SGWeakPtr.hxx \
+ 	SGWeakReferenced.hxx \
++	singleton.hpp \
+ 	Singleton.hxx \
+ 	StringTable.hxx
+ 
+diff -up simgear-2.4.0/simgear/structure/Makefile.in.boostfix simgear-2.4.0/simgear/structure/Makefile.in
+--- simgear-2.4.0/simgear/structure/Makefile.in.boostfix	2012-01-16 13:23:06.976631783 -0500
++++ simgear-2.4.0/simgear/structure/Makefile.in	2012-01-16 13:23:20.258506410 -0500
+@@ -242,6 +242,7 @@ include_HEADERS = \
+ 	SGSmplstat.hxx \
+ 	SGWeakPtr.hxx \
+ 	SGWeakReferenced.hxx \
++	singleton.hpp \
+ 	Singleton.hxx \
+ 	StringTable.hxx
+ 
+diff -up simgear-2.4.0/simgear/structure/singleton.hpp.boostfix simgear-2.4.0/simgear/structure/singleton.hpp
+--- simgear-2.4.0/simgear/structure/singleton.hpp.boostfix	2012-01-16 13:21:20.413640858 -0500
++++ simgear-2.4.0/simgear/structure/singleton.hpp	2012-01-16 13:21:20.413640858 -0500
+@@ -0,0 +1,128 @@
++// Copyright (C) 2000 Stephen Cleary
++//
++// Distributed under the Boost Software License, Version 1.0.
++// Boost Software License - Version 1.0 - August 17th, 2003
++
++// Permission is hereby granted, free of charge, to any person or organization
++// obtaining a copy of the software and accompanying documentation covered by
++// this license (the "Software") to use, reproduce, display, distribute,
++// execute, and transmit the Software, and to prepare derivative works of the
++// Software, and to permit third-parties to whom the Software is furnished to
++// do so, all subject to the following:
++
++// The copyright notices in the Software and this entire statement, including
++// the above license grant, this restriction and the following disclaimer,
++// must be included in all copies of the Software, in whole or in part, and
++// all derivative works of the Software, unless such copies or derivative
++// works are solely in the form of machine-executable object code generated by
++// a source language processor.
++
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
++// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
++// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
++// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++// DEALINGS IN THE SOFTWARE.
++//
++// See http://www.boost.org for updates, documentation, and revision history.
++
++#ifndef BOOST_POOL_SINGLETON_HPP
++#define BOOST_POOL_SINGLETON_HPP
++
++// The following code might be put into some Boost.Config header in a later revision
++#ifdef __BORLANDC__
++# pragma option push -w-inl
++#endif
++
++//
++// The following helper classes are placeholders for a generic "singleton"
++//  class.  The classes below support usage of singletons, including use in
++//  program startup/shutdown code, AS LONG AS there is only one thread
++//  running before main() begins, and only one thread running after main()
++//  exits.
++//
++// This class is also limited in that it can only provide singleton usage for
++//  classes with default constructors.
++//
++
++// The design of this class is somewhat twisted, but can be followed by the
++//  calling inheritance.  Let us assume that there is some user code that
++//  calls "singleton_default<T>::instance()".  The following (convoluted)
++//  sequence ensures that the same function will be called before main():
++//    instance() contains a call to create_object.do_nothing()
++//    Thus, object_creator is implicitly instantiated, and create_object
++//      must exist.
++//    Since create_object is a static member, its constructor must be
++//      called before main().
++//    The constructor contains a call to instance(), thus ensuring that
++//      instance() will be called before main().
++//    The first time instance() is called (i.e., before main()) is the
++//      latest point in program execution where the object of type T
++//      can be created.
++//    Thus, any call to instance() will auto-magically result in a call to
++//      instance() before main(), unless already present.
++//  Furthermore, since the instance() function contains the object, instead
++//  of the singleton_default class containing a static instance of the
++//  object, that object is guaranteed to be constructed (at the latest) in
++//  the first call to instance().  This permits calls to instance() from
++//  static code, even if that code is called before the file-scope objects
++//  in this file have been initialized.
++
++namespace boost {
++
++namespace details {
++namespace pool {
++
++// T must be: no-throw default constructible and no-throw destructible
++template <typename T>
++struct singleton_default
++{
++  private:
++    struct object_creator
++    {
++      // This constructor does nothing more than ensure that instance()
++      //  is called before main() begins, thus creating the static
++      //  T object before multithreading race issues can come up.
++      object_creator() { singleton_default<T>::instance(); }
++      inline void do_nothing() const { }
++    };
++    static object_creator create_object;
++
++    singleton_default();
++
++  public:
++    typedef T object_type;
++
++    // If, at any point (in user code), singleton_default<T>::instance()
++    //  is called, then the following function is instantiated.
++    static object_type & instance()
++    {
++      // This is the object that we return a reference to.
++      // It is guaranteed to be created before main() begins because of
++      //  the next line.
++      static object_type obj;
++
++      // The following line does nothing else than force the instantiation
++      //  of singleton_default<T>::create_object, whose constructor is
++      //  called before main() begins.
++      create_object.do_nothing();
++
++      return obj;
++    }
++};
++template <typename T>
++typename singleton_default<T>::object_creator
++singleton_default<T>::create_object;
++
++} // namespace pool
++} // namespace details
++
++} // namespace boost
++
++// The following code might be put into some Boost.Config header in a later revision
++#ifdef __BORLANDC__
++# pragma option pop
++#endif
++
++#endif
+diff -up simgear-2.4.0/simgear/structure/Singleton.hxx.boostfix simgear-2.4.0/simgear/structure/Singleton.hxx
+--- simgear-2.4.0/simgear/structure/Singleton.hxx.boostfix	2010-12-17 22:37:16.000000000 -0500
++++ simgear-2.4.0/simgear/structure/Singleton.hxx	2012-01-16 13:24:08.089052385 -0500
+@@ -1,7 +1,7 @@
+ #ifndef SIMGEAR_SINGLETON_HXX
+ #define SIMGEAR_SINGLETON_HXX 1
+ 
+-#include <boost/pool/detail/singleton.hpp>
++#include "singleton.hpp"
+ 
+ #include <osg/Referenced>
+ #include <osg/ref_ptr>


More information about the scm-commits mailing list