[Inventor] Modernize spec file. Add -funsigned-char to CXXFLAGS. Add Inventor-2.1.5-41.patch (Address gcc-4.7 F

corsepiu corsepiu at fedoraproject.org
Sun Jan 8 06:32:40 UTC 2012


commit 87f79c8fe147e6c2ef758c193a6926fd053e7602
Author: Ralf Corsépius <corsepiu at fedoraproject.org>
Date:   Sun Jan 8 07:32:29 2012 +0100

    Modernize spec file.
    Add -funsigned-char to CXXFLAGS.
    Add Inventor-2.1.5-41.patch (Address gcc-4.7 FTBFS).
    Add Inventor-2.1.5-bz433154.patch (Address BZ433154).

 Inventor-2.1.5-41.patch       |  239 +++++++++++++++++++++++++++++++++++++++++
 Inventor-2.1.5-bz433154.patch |   13 +++
 Inventor.spec                 |   29 +++--
 3 files changed, 269 insertions(+), 12 deletions(-)
---
diff --git a/Inventor-2.1.5-41.patch b/Inventor-2.1.5-41.patch
new file mode 100644
index 0000000..126b63c
--- /dev/null
+++ b/Inventor-2.1.5-41.patch
@@ -0,0 +1,239 @@
+diff --git a/lib/nodekits/src/nodekits/SoNkCatalog.c++ b/lib/nodekits/src/nodekits/SoNkCatalog.c++
+index 19dead1..896627f 100644
+--- a/lib/nodekits/src/nodekits/SoNkCatalog.c++
++++ b/lib/nodekits/src/nodekits/SoNkCatalog.c++
+@@ -904,7 +904,7 @@ SoNodekitCatalog::clone( SoType typeOfThis ) const
+     if (numEntries == 0)
+ 	theClone->entries = NULL;
+     else {
+-	theClone->entries = new ( SoNodekitCatalogEntry *[numEntries]);
++	theClone->entries = new SoNodekitCatalogEntry* [numEntries];
+ 	for (int i = 0; i < numEntries; i++) {
+ 	    if ( i == SO_CATALOG_THIS_PART_NUM )
+ 		theClone->entries[i] = entries[i]->clone( typeOfThis, 
+@@ -1259,7 +1259,7 @@ SoNodekitCatalog::addEntry( const SbName &theName,
+     // IF ALL TESTS WERE PASSED...
+ 
+     // expand the list by one slot
+-    newArray = new ( SoNodekitCatalogEntry *[numEntries + 1]);
++    newArray = new SoNodekitCatalogEntry* [numEntries + 1];
+     if ( entries != NULL ) {
+ 	for (int i = 0; i < numEntries; i++ )
+ 	    newArray[i] = entries[i];
+diff --git a/lib/nodekits/src/nodekits/SoNkParts.c++ b/lib/nodekits/src/nodekits/SoNkParts.c++
+index d7a5740..8eed9aa 100644
+--- a/lib/nodekits/src/nodekits/SoNkParts.c++
++++ b/lib/nodekits/src/nodekits/SoNkParts.c++
+@@ -95,7 +95,7 @@ SoNodekitParts::SoNodekitParts( SoBaseKit *rootOfKit )
+     catalog = rootOfKit->getNodekitCatalog();  // assign the catalog
+ 
+     numEntries = catalog->getNumEntries();        // make a empty node list
+-    fieldList = new ( SoSFNode *[numEntries] );
++    fieldList = new SoSFNode* [numEntries];
+ 
+     // Make each field in the fieldList point to the field corresponding
+     // to the similarly indexed catalog entry.
+diff --git a/lib/nodekits/src/upgraders/SoV1NkCatalog.c++ b/lib/nodekits/src/upgraders/SoV1NkCatalog.c++
+index e17aced..3bc1889 100644
+--- a/lib/nodekits/src/upgraders/SoV1NkCatalog.c++
++++ b/lib/nodekits/src/upgraders/SoV1NkCatalog.c++
+@@ -808,7 +808,7 @@ SoV1NodekitCatalog::clone( const SoType &typeOfThis ) const
+     if (numEntries == 0)
+ 	theClone->entries = NULL;
+     else {
+-	theClone->entries = new ( SoV1NodekitCatalogEntry *[numEntries]);
++	theClone->entries = new SoV1NodekitCatalogEntry* [numEntries];
+ 	for (int i = 0; i < numEntries; i++) {
+ 	    if ( entries[i]->getName() == "this" )
+ 		theClone->entries[i] = entries[i]->clone( typeOfThis, 
+@@ -1131,7 +1131,7 @@ SoV1NodekitCatalog::addEntry( const SbName &theName,
+     // IF ALL TESTS WERE PASSED...
+ 
+     // expand the list by one slot
+-    newArray = new ( SoV1NodekitCatalogEntry *[numEntries + 1]);
++    newArray = new SoV1NodekitCatalogEntry* [numEntries + 1];
+     if ( entries != NULL ) {
+ 	for (int i = 0; i < numEntries; i++ )
+ 	    newArray[i] = entries[i];
+diff --git a/lib/nodekits/src/upgraders/SoV1NkParts.c++ b/lib/nodekits/src/upgraders/SoV1NkParts.c++
+index 0adb1ce..884410a 100644
+--- a/lib/nodekits/src/upgraders/SoV1NkParts.c++
++++ b/lib/nodekits/src/upgraders/SoV1NkParts.c++
+@@ -82,7 +82,7 @@ SoV1NodekitParts::SoV1NodekitParts( SoV1BaseKit *rootOfKit,
+     catalog = rootOfKit->getNodekitCatalog();  // assign the catalog
+ 
+     numEntries = catalog->getNumEntries();        // make an empty node list
+-    nodeList = new ( SoNode *[numEntries] );
++    nodeList = new SoNode* [numEntries];
+     int i;
+     for ( i = 0; i < numEntries; i++ )
+ 	nodeList[i] = NULL;
+diff --git a/libSoXt/src/motif/SoXtLtSldrSet.c++ b/libSoXt/src/motif/SoXtLtSldrSet.c++
+index d53769d..561564f 100644
+--- a/libSoXt/src/motif/SoXtLtSldrSet.c++
++++ b/libSoXt/src/motif/SoXtLtSldrSet.c++
+@@ -128,7 +128,7 @@ SoXtLightSliderSet::constructorCommon(SbBool buildNow)
+ {
+     // Create the two modules used by this editor.
+     _numSubComponents = 2;
+-    _subComponentArray = new ( SoXtSliderSetBase * [ _numSubComponents ] );
++    _subComponentArray = new SoXtSliderSetBase* [ _numSubComponents ];
+ 
+     _subComponentArray[0] = NULL;
+     _subComponentArray[1] = NULL;
+diff --git a/libSoXt/src/motif/SoXtMltSldrs.c++ b/libSoXt/src/motif/SoXtMltSldrs.c++
+index 150e22b..fefd819 100644
+--- a/libSoXt/src/motif/SoXtMltSldrs.c++
++++ b/libSoXt/src/motif/SoXtMltSldrs.c++
+@@ -183,7 +183,7 @@ SoXtTransMultiSlider::SoXtTransMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -275,7 +275,7 @@ SoXtScaleMultiSlider::SoXtScaleMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -366,7 +366,7 @@ SoXtRotateMultiSlider::SoXtRotateMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -485,7 +485,7 @@ SoXtScaleOrientationMultiSlider::SoXtScaleOrientationMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -604,7 +604,7 @@ SoXtCenterMultiSlider::SoXtCenterMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -685,7 +685,7 @@ SoXtAmbientColorMultiSlider::SoXtAmbientColorMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -777,7 +777,7 @@ SoXtDiffuseColorMultiSlider::SoXtDiffuseColorMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -869,7 +869,7 @@ SoXtSpecularColorMultiSlider::SoXtSpecularColorMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -960,7 +960,7 @@ SoXtEmissiveColorMultiSlider::SoXtEmissiveColorMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -1051,7 +1051,7 @@ SoXtShininessMultiSlider::SoXtShininessMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 1;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -1128,7 +1128,7 @@ SoXtTransparencyMultiSlider::SoXtTransparencyMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 1;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -1206,7 +1206,7 @@ SoXtLightIntensityMultiSlider::SoXtLightIntensityMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 1;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -1282,7 +1282,7 @@ SoXtLightColorMultiSlider::SoXtLightColorMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 3;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+@@ -1372,7 +1372,7 @@ SoXtFovMultiSlider::SoXtFovMultiSlider(
+ 	    FALSE)  // tell parent not to build just yet
+ {
+     _numSubComponents = 1;
+-    _subComponentArray = new ( SoXtSliderSetBase * [_numSubComponents] );
++    _subComponentArray = new SoXtSliderSetBase* [_numSubComponents];
+ 
+     Widget form = buildForm(getParentWidget());
+     
+diff --git a/libSoXt/src/motif/SoXtMtlSSet.c++ b/libSoXt/src/motif/SoXtMtlSSet.c++
+index 08febf2..254f109 100644
+--- a/libSoXt/src/motif/SoXtMtlSSet.c++
++++ b/libSoXt/src/motif/SoXtMtlSSet.c++
+@@ -127,7 +127,7 @@ SoXtMaterialSliderSet::constructorCommon(SbBool buildNow)
+ {
+     // Create the five modules used by a Transform editor.
+     _numSubComponents = 6;
+-    _subComponentArray = new ( SoXtSliderSetBase * [ _numSubComponents ] );
++    _subComponentArray = new SoXtSliderSetBase* [ _numSubComponents ];
+ 
+     _subComponentArray[0] = NULL;
+     _subComponentArray[1] = NULL;
+diff --git a/libSoXt/src/motif/SoXtTfSldrSet.c++ b/libSoXt/src/motif/SoXtTfSldrSet.c++
+index 13cd10f..a6c0e100 100644
+--- a/libSoXt/src/motif/SoXtTfSldrSet.c++
++++ b/libSoXt/src/motif/SoXtTfSldrSet.c++
+@@ -127,7 +127,7 @@ SoXtTransformSliderSet::constructorCommon(SbBool buildNow)
+ {
+     // Create the five modules used by a Transform editor.
+     _numSubComponents = 5;
+-    _subComponentArray = new ( SoXtSliderSetBase * [ _numSubComponents ] );
++    _subComponentArray = new SoXtSliderSetBase* [ _numSubComponents ];
+ 
+     _subComponentArray[0] = NULL;
+     _subComponentArray[1] = NULL;
diff --git a/Inventor-2.1.5-bz433154.patch b/Inventor-2.1.5-bz433154.patch
new file mode 100644
index 0000000..fa1c18f
--- /dev/null
+++ b/Inventor-2.1.5-bz433154.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/database/src/so/SoType.c++ b/lib/database/src/so/SoType.c++
+index e712e01..1484086 100644
+--- a/lib/database/src/so/SoType.c++
++++ b/lib/database/src/so/SoType.c++
+@@ -295,7 +295,7 @@ SoType::fromName(SbName name)
+ 	if (dsoHandle  == NULL)
+ 	    return SoType::badType();
+ 
+-#if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
++#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
+ #define DUMMY_FUNC "_ZN%d%s9initClassEv"
+ #else
+ #define DUMMY_FUNC "initClass__%d%s%s"
diff --git a/Inventor.spec b/Inventor.spec
index fc9c1e9..d7e022d 100644
--- a/Inventor.spec
+++ b/Inventor.spec
@@ -1,12 +1,12 @@
 #
-# Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Ralf Corsepius, Ulm, Germany.
+# Copyright (c) 2004-2012 Ralf Corsepius, Ulm, Germany.
 # This file and all modifications and additions to the pristine
 # package are under the same license as the package itself.
 #
 
 Name:           Inventor
 Version:        2.1.5
-Release:        40%{?dist}
+Release:        41%{?dist}
 
 Summary:        SGI Open Inventor (TM)
 
@@ -24,10 +24,14 @@ Patch3:		Inventor-2.1.5-32-33.diff
 Patch4:         Inventor-2.1.5-s390x.patch
 # Indirect linkage fixes
 Patch5:         Inventor-2.1.5-33-38.diff
+# DSO loader fix.
+Patch6:		Inventor-2.1.5-bz433154.patch
+# GCC-4.7 FTBFS hacks
+Patch7:         Inventor-2.1.5-41.patch
 
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-%define hackcxxflags -O2 -fno-strict-aliasing
+# Inventor is not aliasing-safe.
+# Inventor presumes unsigned chars.
+%define hackcxxflags -O2 -fno-strict-aliasing -funsigned-char
 
 BuildRequires:  libGLU-devel
 BuildRequires:	libGLw-devel
@@ -152,6 +156,8 @@ find -name CVS | xargs rm -rf
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 sed -i \
 -e 's,^IVPREFIX =.*$,IVPREFIX = %{_prefix},' \
@@ -192,7 +198,6 @@ rm -f data/models/scenes/chesschairs.iv
 
 %build
 # Inventor's build system wants us to install and build everything at once.
-rm -rf $RPM_BUILD_ROOT
 export LD_LIBRARY_PATH=${RPM_BUILD_ROOT}%{_libdir}
 export VCOPTS="${RPM_OPT_FLAGS} -D_REENTRANT"
 export VCXXOPTS=$(echo "${RPM_OPT_FLAGS} -D_REENTRANT -D__STDC_FORMAT_MACROS" | sed -e 's,-O2,%{hackcxxflags},')
@@ -225,7 +230,6 @@ make clean
 popd > /dev/null
 
 %install
-rm -rf $RPM_BUILD_ROOT
 export LD_LIBRARY_PATH=${RPM_BUILD_ROOT}%{_libdir}
 export VCOPTS="${RPM_OPT_FLAGS} -D_REENTRANT"
 export VCXXOPTS="${RPM_OPT_FLAGS} -D_REENTRANT"
@@ -262,11 +266,6 @@ ln -s /usr/share/fonts/liberation/LiberationMono-Italic.ttf Courier-Oblique
 ln -s /usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf Courier-BoldOblique
 popd > /dev/null
 
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -352,6 +351,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/Inventor/examples
 
 %changelog
+* Sun Jan 08 2012 Ralf Corsépius <corsepiu at fedoraproject.org> - 2.1.5-41
+- Modernize spec file.
+- Add -funsigned-char to CXXFLAGS.
+- Add Inventor-2.1.5-41.patch (Address gcc-4.7 FTBFS).
+- Add Inventor-2.1.5-bz433154.patch (Address BZ433154).
+
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.1.5-40
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list