gcc-3.x fix
authorGeorge Shapovalov <george@gentoo.org>
Thu, 24 Oct 2002 05:07:41 +0000 (05:07 +0000)
committerGeorge Shapovalov <george@gentoo.org>
Thu, 24 Oct 2002 05:07:41 +0000 (05:07 +0000)
app-misc/celestia/ChangeLog
app-misc/celestia/celestia-1.2.4.ebuild
app-misc/celestia/files/celestia-gcc3.patch [new file with mode: 0644]

index 87e6f12e416b58eb900822cf3c69a66fd6d37221..bf38686d5f795e781b1d1252e25b4afd22eb6b06 100644 (file)
@@ -1,9 +1,14 @@
 # ChangeLog for app-misc/celestia
 # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/app-misc/celestia/ChangeLog,v 1.3 2002/10/19 15:48:49 aliz Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/celestia/ChangeLog,v 1.4 2002/10/24 05:07:41 george Exp $
 
 *celestia-1.2.4 (4 May 2002)
 
+  23 Oct 2002; George Shapovalov <george@gentoo.org> celestia-1.2.4.ebuildi, files/celestia-gcc3.patch :
+
+  applied fix to make celestia compile under gcc-3.x,
+  Thanks to Bret Towe <btowe@gbis.com>, bug #6417
+
   19 Oct 2002; Daniel Ahlberg <aliz@gentoo.org> celestia-1.2.4.ebuild :
   Updated to mirror://sourceforge in SRC_URI.
 
index 600d39f5102dd8b55784783534229fd15df6dca3..8c895e927cb2f3957a004775918e2e10e7c411eb 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2002 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/celestia/celestia-1.2.4.ebuild,v 1.9 2002/10/20 18:40:21 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/celestia/celestia-1.2.4.ebuild,v 1.10 2002/10/24 05:07:41 george Exp $
 
 IUSE="gtk gnome"
 
@@ -21,6 +21,13 @@ DEPEND="gtk? ( =x11-libs/gtk+-1.2*
        media-libs/jpeg
        media-libs/libpng"
 
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+
+       patch -p1 < ${FILESDIR}/celestia-gcc3.patch
+}
+
 src_compile() {
        local myconf
 
diff --git a/app-misc/celestia/files/celestia-gcc3.patch b/app-misc/celestia/files/celestia-gcc3.patch
new file mode 100644 (file)
index 0000000..c62ac6e
--- /dev/null
@@ -0,0 +1,101 @@
+diff -ur celestia-1.2.4/src/buildstardb.cpp celestia-1.2.4.fixed/src/buildstardb.cpp
+--- celestia-1.2.4/src/buildstardb.cpp 2002-01-14 10:48:37.000000000 -0800
++++ celestia-1.2.4.fixed/src/buildstardb.cpp   2002-10-13 22:31:41.000000000 -0700
+@@ -921,7 +921,7 @@
+             {
+                 MultistarSystem* multiSystem = new MultistarSystem();
+                 multiSystem->nStars = 1;
+-                multiSystem->stars[0] = iter;
++                multiSystem->stars[0] = &(*iter);
+                 starSystems.insert(MultistarSystemCatalog::value_type(iter->CCDMIdentifier, multiSystem));
+             }
+             else
+@@ -933,7 +933,7 @@
+                 }
+                 else
+                 {
+-                    multiSystem->stars[multiSystem->nStars] = iter;
++                    multiSystem->stars[multiSystem->nStars] = &(*iter);
+                     multiSystem->nStars++;
+                 }
+             }
+@@ -1162,7 +1162,7 @@
+         for (vector<HipparcosStar>::iterator iter = stars.begin();
+              iter != stars.end(); iter++)
+         {
+-            starIndex.insert(starIndex.end(), iter);
++            starIndex.insert(starIndex.end(), &(*iter));
+         }
+ 
+         HIPCatalogComparePredicate pred;
+diff -ur celestia-1.2.4/src/celengine/starbrowser.h celestia-1.2.4.fixed/src/celengine/starbrowser.h
+--- celestia-1.2.4/src/celengine/starbrowser.h 2002-01-15 17:55:49.000000000 -0800
++++ celestia-1.2.4.fixed/src/celengine/starbrowser.h   2002-10-13 22:11:30.000000000 -0700
+@@ -15,6 +15,8 @@
+ #include "star.h"
+ #include "stardb.h"
+ #include "simulation.h"
++#include <vector>
++using namespace std;
+ 
+ class StarBrowser
+ {
+diff -ur celestia-1.2.4/src/celestia/celestiacore.cpp celestia-1.2.4.fixed/src/celestia/celestiacore.cpp
+--- celestia-1.2.4/src/celestia/celestiacore.cpp       2002-05-02 10:53:49.000000000 -0700
++++ celestia-1.2.4.fixed/src/celestia/celestiacore.cpp 2002-10-13 22:28:14.000000000 -0700
+@@ -194,7 +194,7 @@
+     sim->setFrame(fav.coordSys, sim->getSelection());
+ }
+ 
+-void CelestiaCore::addFavorite(string name, string parentFolder, FavoritesList::const_iterator* iter)
++void CelestiaCore::addFavorite(std::string name, std::string parentFolder, FavoritesList::iterator* iter)
+ {
+     FavoritesList::iterator pos;
+     if(!iter)
+@@ -214,7 +214,7 @@
+     favorites->insert(pos, fav);
+ }
+ 
+-void CelestiaCore::addFavoriteFolder(string name, FavoritesList::const_iterator* iter)
++void CelestiaCore::addFavoriteFolder(std::string name, FavoritesList::iterator* iter)
+ {
+     FavoritesList::iterator pos;
+     if(!iter)
+@@ -1137,9 +1137,8 @@
+             if (sun != NULL)
+             {
+                 double distFromSun = body.getHeliocentricPosition(t).distanceFromOrigin();
+-                float planetTemp = sun->getTemperature() * 
+-                    (float) (pow(1 - body.getAlbedo(), 0.25) *
+-                             sqrt(sun->getRadius() / (2 * distFromSun)));
++              float planetTemp = sun->getTemperature() *
++                      (float) (pow((float)(1 - body.getAlbedo()), (float) 0.25) *+                             sqrt((float)(sun->getRadius() / (2 * distFromSun))));
+                 overlay << setprecision(0);
+                 overlay << "Temperature: " << planetTemp << " K\n";
+                 overlay << setprecision(3);
+diff -ur celestia-1.2.4/src/celestia/celestiacore.h celestia-1.2.4.fixed/src/celestia/celestiacore.h
+--- celestia-1.2.4/src/celestia/celestiacore.h 2002-04-02 07:24:09.000000000 -0800
++++ celestia-1.2.4.fixed/src/celestia/celestiacore.h   2002-10-13 22:22:20.000000000 -0700
+@@ -126,8 +126,8 @@
+     void readFavoritesFile();
+     void writeFavoritesFile();
+     void activateFavorite(FavoritesEntry&);
+-    void addFavorite(std::string, std::string, FavoritesList::const_iterator* iter=NULL);
+-    void addFavoriteFolder(std::string, FavoritesList::const_iterator* iter=NULL);
++    void addFavorite(std::string, std::string, FavoritesList::iterator* iter=NULL);
++    void addFavoriteFolder(std::string, FavoritesList::iterator* iter=NULL);
+     const FavoritesList* getFavorites();
+ 
+     const DestinationList* getDestinations();
+diff -ur celestia-1.2.4/src/celestia/glutmain.cpp celestia-1.2.4.fixed/src/celestia/glutmain.cpp
+--- celestia-1.2.4/src/celestia/glutmain.cpp   2002-04-30 10:36:11.000000000 -0700
++++ celestia-1.2.4.fixed/src/celestia/glutmain.cpp     2002-10-13 22:12:53.000000000 -0700
+@@ -32,6 +32,8 @@
+ #include <celmath/mathlib.h>
+ #include <celengine/astro.h>
+ #include "celestiacore.h"
++#include <iostream>
++using namespace std;
+ /* what are you supposed to be?
+ #include "popt.h"
+ */