git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #29022 from disassembler/stuntrally

stunt rally: fixing build with gcc6

commit1791b436911339d5d95cf70d6a725beeae446492 authorJörg Thalheim <Mic92@users.noreply.github.com> dateTue 5 Sep 2017, 16:36 (9 years ago) parent47ec9572134b92
2 files changed+71
pkgs/games/stuntrally/default.nix+4 pkgs/games/stuntrally/gcc6.patch+67
pkgs/games/stuntrally/default.nix+4
@@ -26,6 +26,10 @@ stdenv.mkDerivation rec {
2626 popd
2727 '';
2828
29+ patches = [
30+ ./gcc6.patch
31+ ];
32+
2933 buildInputs = [ cmake boost ogre mygui ois SDL2 libvorbis pkgconfig
3034 makeWrapper enet libXcursor bullet openal
3135 ];
pkgs/games/stuntrally/gcc6.patchnew file+67
@@ -0,0 +1,67 @@
1+diff --git i/source/ogre/CarModel_Create.cpp w/source/ogre/CarModel_Create.cpp
2+index 834eac7..47ec647 100644
3+--- i/source/ogre/CarModel_Create.cpp
4++++ w/source/ogre/CarModel_Create.cpp
5+@@ -130,7 +130,8 @@ void CarModel::Load(int startId)
6+
7+ /// load config .car
8+ string pathCar;
9+- pApp->gui->GetCarPath(&pathCar, 0, 0, sDirname, pApp->mClient); // force orig for newtorked games
10++ string empty;
11++ pApp->gui->GetCarPath(&pathCar, &empty, &empty, sDirname, bool(pApp->mClient)); // force orig for newtorked games
12+ LoadConfig(pathCar);
13+
14+
15+diff --git i/source/ogre/Gui_Tweak.cpp w/source/ogre/Gui_Tweak.cpp
16+index 76ed8e9..9444271 100644
17+--- i/source/ogre/Gui_Tweak.cpp
18++++ w/source/ogre/Gui_Tweak.cpp
19+@@ -412,8 +412,8 @@ bool CGui::GetCarPath(std::string* pathCar,
20+ pathUserD = PATHMANAGER::CarSimU() + "/" + pSet->game.sim_mode + "/cars/",
21+ pathUser = pathUserD + file;
22+
23+- if (pathSave) *pathSave = pathUser;
24+- if (pathSaveDir) *pathSaveDir = pathUserD;
25++ if (pathSave != "") *pathSave = pathUser;
26++ if (pathSaveDir != "") *pathSaveDir = pathUserD;
27+
28+ if (!forceOrig && PATHMANAGER::FileExists(pathUser))
29+ {
30+diff --git i/source/vdrift/cartire.cpp w/source/vdrift/cartire.cpp
31+index dd6dd48..083fa0c 100644
32+--- i/source/vdrift/cartire.cpp
33++++ w/source/vdrift/cartire.cpp
34+@@ -3,6 +3,7 @@
35+ #include "cardefs.h"
36+ //#include "../ogre/common/Def_Str.h"
37+
38++using namespace std;
39+
40+ void CARTIRE::FindSigmaHatAlphaHat(Dbl load, Dbl & output_sigmahat, Dbl & output_alphahat, int iterations)
41+ {
42+diff --git i/source/vdrift/model_obj.cpp w/source/vdrift/model_obj.cpp
43+index 338d122..e67c1db 100644
44+--- i/source/vdrift/model_obj.cpp
45++++ w/source/vdrift/model_obj.cpp
46+@@ -205,7 +205,7 @@ bool MODEL_OBJ::Save(const std::string & strFileName, std::ostream & error_outpu
47+ std::ofstream f(strFileName.c_str());
48+ if (!f)
49+ {
50+- error_output << "Error opening file for writing: " << error_output << endl;
51++ error_output << "Error opening file for writing: " << endl;
52+ return false;
53+ }
54+
55+diff --git i/source/vdrift/texture.h w/source/vdrift/texture.h
56+index b21846a..c115fd6 100644
57+--- i/source/vdrift/texture.h
58++++ w/source/vdrift/texture.h
59+@@ -125,7 +125,7 @@ class TEXTURELIBRARY
60+ bool FileExists(const std::string & filename)
61+ {
62+ std::ifstream f(filename.c_str());
63+- return f;
64++ return bool(f);
65+ }
66+
67+ public: