From: George Shapovalov Date: Thu, 24 Oct 2002 05:07:41 +0000 (+0000) Subject: gcc-3.x fix X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=fae5a011abcb7886c397d1ada60dbd8edb7c61c0;p=gentoo.git gcc-3.x fix --- diff --git a/app-misc/celestia/ChangeLog b/app-misc/celestia/ChangeLog index 87e6f12e416b..bf38686d5f79 100644 --- a/app-misc/celestia/ChangeLog +++ b/app-misc/celestia/ChangeLog @@ -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 celestia-1.2.4.ebuildi, files/celestia-gcc3.patch : + + applied fix to make celestia compile under gcc-3.x, + Thanks to Bret Towe , bug #6417 + 19 Oct 2002; Daniel Ahlberg celestia-1.2.4.ebuild : Updated to mirror://sourceforge in SRC_URI. diff --git a/app-misc/celestia/celestia-1.2.4.ebuild b/app-misc/celestia/celestia-1.2.4.ebuild index 600d39f5102d..8c895e927cb2 100644 --- a/app-misc/celestia/celestia-1.2.4.ebuild +++ b/app-misc/celestia/celestia-1.2.4.ebuild @@ -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 index 000000000000..c62ac6e951fa --- /dev/null +++ b/app-misc/celestia/files/celestia-gcc3.patch @@ -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::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 ++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 + #include + #include "celestiacore.h" ++#include ++using namespace std; + /* what are you supposed to be? + #include "popt.h" + */