Fix FTBFS.

This commit is contained in:
Jon Ciesla 2017-02-22 08:26:31 -06:00
parent 99996511f0
commit 95ded6a35e
2 changed files with 113 additions and 1 deletions

105
bastet-tr1.patch Normal file
View File

@ -0,0 +1,105 @@
diff -U3 -r bastet-0.43.1/BastetBlockChooser.cpp /home/limb/fedora/bastet/BastetBlockChooser.cpp
--- bastet-0.43.1/BastetBlockChooser.cpp 2014-05-29 13:47:50.000000000 -0500
+++ bastet/BastetBlockChooser.cpp 2017-02-22 08:16:54.551988209 -0600
@@ -19,7 +19,9 @@
#include "BastetBlockChooser.hpp"
#include "Block.hpp"
+#include <boost/functional/hash.hpp>
#include <boost/foreach.hpp>
+#include <unordered_set>
#include <cstdlib>
#include <algorithm>
diff -U3 -r bastet-0.43.1/BastetBlockChooser.hpp /home/limb/fedora/bastet/BastetBlockChooser.hpp
--- bastet-0.43.1/BastetBlockChooser.hpp 2014-05-29 13:47:50.000000000 -0500
+++ bastet/BastetBlockChooser.hpp 2017-02-22 08:16:54.549988291 -0600
@@ -23,16 +23,26 @@
#include "Well.hpp"
-#include <boost/tr1/tr1/unordered_set>
+#include <unordered_set>
#include <set>
#include <boost/functional/hash.hpp>
+//boilerplate to use boost::hash as std::hash
+namespace std{
+ template<> struct hash<Bastet::BlockPosition>{
+ size_t operator()(const Bastet::BlockPosition &fb) const{
+ static boost::hash<Bastet::BlockPosition> h;
+ return h(fb);
+ }
+ };
+ }
+
namespace Bastet{
static const long GameOverScore=-1000; //bogus score assigned to combinations which cause game over
// declared in Well.hpp
-// long Evaluate(const Well *w, int extralines); //assigns a score to a position w + a number of extra lines deleted while getting there
+ long Evaluate(const Well *w, int extralines=0); //assigns a score to a position w + a number of extra lines deleted while getting there
typedef BlockPosition Vertex;
@@ -75,7 +85,7 @@
public:
Searcher(BlockType b, const Well *well, Vertex v, WellVisitor *visitor);
private:
- std::tr1::unordered_set<Vertex> _visited;
+ std::unordered_set<Vertex> _visited;
//std::set<Vertex> _visited; ^^ the above is more efficient, we need to do many inserts
BlockType _block;
const Well *_well;
Only in /home/limb/fedora/bastet/: bastet.png
Only in /home/limb/fedora/bastet/: bastet.svg
Only in /home/limb/fedora/bastet/: depend
Only in /home/limb/fedora/bastet/: .git
diff -U3 -r bastet-0.43.1/Makefile /home/limb/fedora/bastet/Makefile
--- bastet-0.43.1/Makefile 2014-05-29 13:47:50.000000000 -0500
+++ bastet/Makefile 2017-02-22 08:16:54.546988413 -0600
@@ -3,9 +3,9 @@
TESTS=Test.cpp
PROGNAME=bastet
BOOST_PO?=-lboost_program_options
-LDFLAGS+=-lncurses $(BOOST_PO)
+LDFLAGS+=-lncurses $(BOOST_PO) -std=c++11
#CXXFLAGS+=-ggdb -Wall
-CXXFLAGS+=-DNDEBUG -Wall
+CXXFLAGS+=-DNDEBUG -Wall -std=c++11
#CXXFLAGS+=-pg
#LDFLAGS+=-pg
diff -U3 -r bastet-0.43.1/Test.cpp /home/limb/fedora/bastet/Test.cpp
--- bastet-0.43.1/Test.cpp 2014-05-29 13:47:50.000000000 -0500
+++ bastet/Test.cpp 2017-02-22 08:11:53.145250162 -0600
@@ -1,4 +1,5 @@
#include "Well.hpp"
+#include "BastetBlockChooser.hpp"
#include <ios>
using namespace Bastet;
diff -U3 -r bastet-0.43.1/Ui.cpp /home/limb/fedora/bastet/Ui.cpp
--- bastet-0.43.1/Ui.cpp 2014-05-29 13:47:50.000000000 -0500
+++ bastet/Ui.cpp 2017-02-22 08:11:53.145250162 -0600
@@ -482,6 +482,7 @@
}
void Ui::Play(BlockChooser *bc){
+ _level=0;
_points=0;
_lines=0;
BOOST_FOREACH(ColorWellLine &a, _colors)
diff -U3 -r bastet-0.43.1/Well.hpp /home/limb/fedora/bastet/Well.hpp
--- bastet-0.43.1/Well.hpp 2014-05-29 13:47:50.000000000 -0500
+++ bastet/Well.hpp 2017-02-22 08:11:53.146250121 -0600
@@ -66,7 +66,7 @@
LinesCompleted Lock(BlockType t, const BlockPosition &p); //permanently adds a tetromino to the well; returns a bitset of 4 bits where return[i]==1 iff line (start of fb)+i is complete
void ClearLines(const LinesCompleted &lc); //removes the given lines from the well (whether they are completed or not)
int LockAndClearLines(BlockType t, const BlockPosition &p); //locks, clear lines, returns number of lines cleared
- friend long Evaluate(const Well *w, int extralines=0); //for BastetBlockChooser
+ friend long Evaluate(const Well *w, int extralines); //for BastetBlockChooser
std::string PrettyPrint() const;
};

View File

@ -1,6 +1,6 @@
Name: bastet
Version: 0.43.1
Release: 14%{?dist}
Release: 15%{?dist}
Summary: An evil falling bricks game
Group: Amusements/Games
@ -10,6 +10,7 @@ Source0: https://github.com/fph/bastet/archive/%{version}.zip
Source1: %{name}.desktop
# self-made icon
Source2: %{name}.png
Patch0: bastet-tr1.patch
BuildRequires: boost-devel ncurses-devel desktop-file-utils
@ -24,6 +25,9 @@ frustrating experience!
%prep
%setup -q
%patch0 -p1
# remove reference to Tetris to match our guidelines
sed -e 's/Tetris(R)/any falling bricks game/g' -e 's/Tetris/falling bricks game/g' \
-e 's/tetris/falling bricks game/g' README > README.new
@ -92,6 +96,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog
* Wed Feb 22 2017 Jon Ciesla <limburgher@gmail.com> - 0.43.1-15
- Fix FTBFS.
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.43.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild