aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2005-10-29 13:48:50 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2005-10-29 13:48:50 +0000
commitf99d4099348d418c0a4093566a97e37e6341c053 (patch)
tree2789c5b6bd56c79134723d8f92c1bb279697e1ec
parentc15d6133c61ace5a250c63dd72e19a22b5c026d0 (diff)
downloadports-f99d4099348d418c0a4093566a97e37e6341c053.tar.gz
ports-f99d4099348d418c0a4093566a97e37e6341c053.zip
Notes
-rw-r--r--games/groundhog/Makefile10
-rw-r--r--games/groundhog/files/patch-src-highscore.cc39
-rw-r--r--games/groundhog/files/patch-src__game.cc49
-rw-r--r--games/groundhog/files/patch-src__pocket.h19
-rw-r--r--games/groundhog/files/patch-src__score.cc74
-rw-r--r--games/groundhog/files/patch-src__score.h50
-rw-r--r--games/groundhog/files/patch-src_highscore_tab.cc51
-rw-r--r--games/groundhog/files/patch-src_new_highscore_dialog.h19
-rw-r--r--games/groundhog/files/patch-src_options_dialog.h0
-rw-r--r--games/groundhog/files/patch-src_solved_dialog.cc27
10 files changed, 325 insertions, 13 deletions
diff --git a/games/groundhog/Makefile b/games/groundhog/Makefile
index d0ec4fa44018..ed2259165362 100644
--- a/games/groundhog/Makefile
+++ b/games/groundhog/Makefile
@@ -7,7 +7,7 @@
PORTNAME= groundhog
PORTVERSION= 1.4
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= games
MASTER_SITES= http://home-2.tiscali.nl/~cb007736/
@@ -18,10 +18,4 @@ USE_GMAKE= yes
USE_GNOME= gtk20
GNU_CONFIGURE= yes
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} > 502112
-BROKEN= "Does not compile on FreeBSD >= 5.x"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/groundhog/files/patch-src-highscore.cc b/games/groundhog/files/patch-src-highscore.cc
index c6f9eb10531e..a616a816cd5b 100644
--- a/games/groundhog/files/patch-src-highscore.cc
+++ b/games/groundhog/files/patch-src-highscore.cc
@@ -1,11 +1,40 @@
---- src/highscore.cc/old Sat May 4 23:43:58 2002
-+++ src/highscore.cc Thu May 23 14:10:49 2002
-@@ -26,6 +26,8 @@
- std::string filename = getenv("HOME");
+--- src/highscore.cc.orig Sat May 4 23:43:58 2002
++++ src/highscore.cc Sun Oct 30 00:49:25 2005
+@@ -17,27 +17,30 @@
+ */
+
+ #include <fstream.h>
++using namespace std;
+
+ #include "highscore.h"
+
+ void
+ HighScore::Read()
+ {
+- std::string filename = getenv("HOME");
++ string filename = getenv("HOME");
filename += "/.groundhog.highscore";
- std::ifstream in(filename.c_str());
+- std::ifstream in(filename.c_str());
++ ifstream in(filename.c_str());
+ if (in==NULL)
+ return;
in >> _beginner >> _intermediate >> _expert;
}
+ void
+ HighScore::Write()
+ {
+- std::string filename = getenv("HOME");
++ string filename = getenv("HOME");
+ filename += "/.groundhog.highscore";
+- std::ofstream out(filename.c_str());
+- out << _beginner << std::endl
+- << _intermediate << std::endl
+- << _expert << std::endl;
++ ofstream out(filename.c_str());
++ out << _beginner << endl
++ << _intermediate << endl
++ << _expert << endl;
+ }
+
+
diff --git a/games/groundhog/files/patch-src__game.cc b/games/groundhog/files/patch-src__game.cc
new file mode 100644
index 000000000000..4fd3e4e53590
--- /dev/null
+++ b/games/groundhog/files/patch-src__game.cc
@@ -0,0 +1,49 @@
+--- src/game.cc.orig Sun May 5 04:30:51 2002
++++ src/game.cc Sun Oct 30 00:48:40 2005
+@@ -18,10 +18,15 @@
+
+ #include <config.h>
+
+-#include <strstream.h>
++#include <sstream>
++#include <iostream>
++#include <string>
++
+ #include <time.h>
+ #include <unistd.h>
+
++using namespace std;
++
+ #include "about_dialog.h"
+ #include "ball.h"
+ #include "game.h"
+@@ -193,21 +198,19 @@
+ void
+ Game::DisplayMoves()
+ {
+- char info[128];
+- ostrstream ost(info, sizeof(info));
+-
+- ost << _("Moves: ") << _nr_of_moves << std::ends;
+- gtk_label_set(GTK_LABEL(_moves), info);
++ ostringstream ost;
++ ost << _("Moves: ") << _nr_of_moves << ends; // format string
++ string info = ost.str(); // retrieve formatted string
++ gtk_label_set(GTK_LABEL(_moves), info.c_str());
+ }
+
+ void
+ Game::DisplayTime()
+ {
+- char info[128];
+- ostrstream ost(info, sizeof(info));
+-
+- ost << _("Time: ") << _seconds << std::ends;
+- gtk_label_set(GTK_LABEL(_time), info);
++ ostringstream ost;
++ ost << _("Time: ") << _seconds << ends; // format string
++ string info = ost.str(); // retrieve formatted string
++ gtk_label_set(GTK_LABEL(_time), info.c_str());
+ }
+
+ void
diff --git a/games/groundhog/files/patch-src__pocket.h b/games/groundhog/files/patch-src__pocket.h
new file mode 100644
index 000000000000..d57e15350b4a
--- /dev/null
+++ b/games/groundhog/files/patch-src__pocket.h
@@ -0,0 +1,19 @@
+--- src/pocket.h.orig Sun Oct 30 00:51:58 2005
++++ src/pocket.h Sun Oct 30 00:52:09 2005
+@@ -20,6 +20,7 @@
+ #define _POCKET_H_
+
+ #include <list>
++using namespace std;
+
+ #include <gtk/gtk.h>
+
+@@ -54,7 +55,7 @@
+ };
+
+ class SetOffPockets {
+- std::list<Pocket*> _set;
++ list<Pocket*> _set;
+ public:
+ SetOffPockets() {}
+ void Add(Pocket* pocket) {_set.push_back(pocket);}
diff --git a/games/groundhog/files/patch-src__score.cc b/games/groundhog/files/patch-src__score.cc
new file mode 100644
index 000000000000..11a2bf06fb76
--- /dev/null
+++ b/games/groundhog/files/patch-src__score.cc
@@ -0,0 +1,74 @@
+--- src/score.cc.orig Sun Oct 30 00:52:15 2005
++++ src/score.cc Sun Oct 30 00:53:45 2005
+@@ -17,20 +17,21 @@
+ */
+
+ #include <iostream>
++using namespace std;
+ #include "score.h"
+
+-std::ostream&
+-operator<<(std::ostream& s, const Score& score)
++ostream&
++operator<<(ostream& s, const Score& score)
+ {
+ return s << "(\"" << score._name << "\" " << score._seconds << ')';
+ }
+
+-std::istream&
+-operator>>(std::istream& s, Score& score)
++istream&
++operator>>(istream& s, Score& score)
+ {
+ char c;
+- std::ios::fmtflags flag = s.flags();
+- s.flags(flag & ~std::ios::skipws);
++ ios::fmtflags flag = s.flags();
++ s.flags(flag & ~ios::skipws);
+
+ score._name = "";
+ s >> c >> c;
+@@ -54,14 +55,14 @@
+ bool
+ ScoreList::IsNewHighScore(int seconds)
+ {
+- std::list<Score>::iterator last = _list.end();
++ list<Score>::iterator last = _list.end();
+ return _list.size() < 10 || seconds < (*--last).GetSeconds();
+ }
+
+ void
+ ScoreList::AddHighScore(Score& score)
+ {
+- std::list<Score>::iterator i;
++ list<Score>::iterator i;
+ for (i = _list.begin(); i != _list.end(); i++)
+ if (score < *i)
+ break;
+@@ -74,18 +75,18 @@
+ }
+ }
+
+-std::ostream&
+-operator<<(std::ostream& s, const ScoreList& slist)
++ostream&
++operator<<(ostream& s, const ScoreList& slist)
+ {
+- s << '(' << std::endl;
+- for (std::list<Score>::const_iterator i = slist._list.begin();
++ s << '(' << endl;
++ for (list<Score>::const_iterator i = slist._list.begin();
+ i != slist._list.end(); i++)
+- s << *i << std::endl;
+- return s << ')' << std::endl;
++ s << *i << endl;
++ return s << ')' << endl;
+ }
+
+-std::istream&
+-operator>>(std::istream& s, ScoreList& slist)
++istream&
++operator>>(istream& s, ScoreList& slist)
+ {
+ char c;
+ s >> c;
diff --git a/games/groundhog/files/patch-src__score.h b/games/groundhog/files/patch-src__score.h
new file mode 100644
index 000000000000..2aab7b586dfc
--- /dev/null
+++ b/games/groundhog/files/patch-src__score.h
@@ -0,0 +1,50 @@
+--- src/score.h.orig Sun Oct 30 00:53:49 2005
++++ src/score.h Sun Oct 30 00:54:22 2005
+@@ -20,34 +20,37 @@
+ #define _SCORE_H
+
+ #include <list>
++#include <iostream>
+ #include <string>
+
++using namespace std;
++
+ class Score {
+- std::string _name;
++ string _name;
+ int _seconds;
+ protected:
+ public:
+ Score() {}
+- Score(const std::string& name, int seconds) : _name(name),
++ Score(const string& name, int seconds) : _name(name),
+ _seconds(seconds) {}
+ int operator<(Score& score);
+- friend std::ostream& operator<<(std::ostream& s, const Score& score);
+- friend std::istream& operator>>(std::istream& s, Score& score);
+- const std::string& GetName() const {return _name;}
++ friend ostream& operator<<(ostream& s, const Score& score);
++ friend istream& operator>>(istream& s, Score& score);
++ const string& GetName() const {return _name;}
+ int GetSeconds() const {return _seconds;}
+ };
+
+ class ScoreList {
+- std::list<Score> _list;
++ list<Score> _list;
+ protected:
+ public:
+ ScoreList() {}
+ bool IsNewHighScore(int seconds);
+ void AddHighScore(Score& score);
+- friend std::ostream& operator<<(std::ostream& s, const ScoreList& slist);
+- friend std::istream& operator>>(std::istream& s, ScoreList& slist);
+- std::list<Score>::const_iterator Begin() const {return _list.begin();}
+- std::list<Score>::const_iterator End() const {return _list.end();}
++ friend ostream& operator<<(ostream& s, const ScoreList& slist);
++ friend istream& operator>>(istream& s, ScoreList& slist);
++ list<Score>::const_iterator Begin() const {return _list.begin();}
++ list<Score>::const_iterator End() const {return _list.end();}
+ };
+
+ #endif // _SCORE_H
diff --git a/games/groundhog/files/patch-src_highscore_tab.cc b/games/groundhog/files/patch-src_highscore_tab.cc
new file mode 100644
index 000000000000..522783dd64f0
--- /dev/null
+++ b/games/groundhog/files/patch-src_highscore_tab.cc
@@ -0,0 +1,51 @@
+--- src/highscore_tab.cc.orig Sun Oct 30 00:49:30 2005
++++ src/highscore_tab.cc Sun Oct 30 00:51:04 2005
+@@ -16,7 +16,9 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+-#include <strstream.h>
++#include <sstream>
++#include <string>
++using namespace std;
+
+ #include "highscore_tab.h"
+ #include "intl.h"
+@@ -37,11 +39,12 @@
+ gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 0, 1);
+
+ for (int i = 1; i <= 10; i++) {
+- char scratch[16];
+- std::ostrstream ost(scratch, sizeof(scratch));
+-
+- ost << i << std::ends;
+- GtkWidget* index_label = gtk_label_new(scratch);
++ ostringstream ost;
++ ost << i << ends; // format string
++ string temp = ost.str(); // retrieve formatted string
++
++ GtkWidget* index_label = gtk_label_new(temp.c_str());
++
+ gtk_table_attach_defaults(GTK_TABLE(table), index_label, 0, 1, i, i + 1);
+
+ _names[i] = gtk_label_new(N_(""));
+@@ -66,14 +69,12 @@
+ HighScoreTab::Fill(const ScoreList& slist)
+ {
+ int index = 1;
+- for (std::list<Score>::const_iterator i = slist.Begin();
++ for (list<Score>::const_iterator i = slist.Begin();
+ i != slist.End(); i++) {
+- char scratch[16];
+- std::ostrstream ost(scratch, sizeof(scratch));
+-
+- ost << (*i).GetSeconds() << std::ends;
+-
+- FillOneScore(index++, (*i).GetName().c_str(), scratch);
++ ostringstream ost;
++ ost << (*i).GetSeconds() << ends; // format string
++ string temp = ost.str(); // retrieve string
++ FillOneScore(index++, (*i).GetName().c_str(), temp.c_str());
+ }
+
+ for (; index <= 10; index++)
diff --git a/games/groundhog/files/patch-src_new_highscore_dialog.h b/games/groundhog/files/patch-src_new_highscore_dialog.h
new file mode 100644
index 000000000000..234fc30bde8a
--- /dev/null
+++ b/games/groundhog/files/patch-src_new_highscore_dialog.h
@@ -0,0 +1,19 @@
+--- src/new_highscore_dialog.h.orig Sun Oct 30 00:51:13 2005
++++ src/new_highscore_dialog.h Sun Oct 30 00:51:28 2005
+@@ -20,6 +20,7 @@
+ #define _NEW_HIGHSCORE_DIALOG_H
+
+ #include <string>
++using namespace std;
+ #include "dialog.h"
+
+ class Game;
+@@ -28,7 +29,7 @@
+ Game* _game;
+ GtkWidget* _name;
+ char* GetLoginName();
+- std::string GetUserName();
++ string GetUserName();
+ protected:
+ void OnOk();
+ public:
diff --git a/games/groundhog/files/patch-src_options_dialog.h b/games/groundhog/files/patch-src_options_dialog.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/games/groundhog/files/patch-src_options_dialog.h
diff --git a/games/groundhog/files/patch-src_solved_dialog.cc b/games/groundhog/files/patch-src_solved_dialog.cc
new file mode 100644
index 000000000000..8514b318fb59
--- /dev/null
+++ b/games/groundhog/files/patch-src_solved_dialog.cc
@@ -0,0 +1,27 @@
+--- src/solved_dialog.cc.orig Sun Oct 30 00:54:28 2005
++++ src/solved_dialog.cc Sun Oct 30 00:54:56 2005
+@@ -16,7 +16,9 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+-#include <strstream.h>
++#include <sstream>
++#include <string>
++using namespace std;
+
+ #include "intl.h"
+ #include "solved_dialog.h"
+@@ -33,9 +35,8 @@
+ void
+ SolvedDialog::SetLabel(int moves)
+ {
+- char info[128];
+- std::ostrstream ost(info, sizeof(info));
+-
+- ost << _(" Game solved in ") << moves << _(" moves!") << std::ends;
+- gtk_label_set(GTK_LABEL(_label), info);
++ ostringstream ost;
++ ost << _(" Game solved in ") << moves << _(" moves!") << ends;
++ string info = ost.str();
++ gtk_label_set(GTK_LABEL(_label), info.c_str());
+ }