treewide: fix #include errors after gcc-5.4
They were mostly missing <cmath> or <math.h>.
This commit is contained in:
@@ -21,6 +21,9 @@ stdenv.mkDerivation rec {
|
||||
sed -i Makefile \
|
||||
-e 's,-Werror,,g' \
|
||||
-e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g'
|
||||
|
||||
sed '1i#include <cmath>' \
|
||||
-i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
|
||||
'';
|
||||
|
||||
makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
|
||||
|
||||
@@ -39,6 +39,7 @@ in stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
patches = [ ./use-system-libraries.patch ];
|
||||
postPatch = "sed '1i#include <math.h>' -i plugins/3dveins.cpp";
|
||||
|
||||
nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ];
|
||||
# we can't use native Lua; upstream uses private headers
|
||||
|
||||
@@ -13,6 +13,8 @@ stdenv.mkDerivation {
|
||||
sha256 = "12bqh3k4wsk1c0bz2zly8h0ilbsdmsbwr9cdjc6i7liwg9906g7i";
|
||||
};
|
||||
|
||||
postPatch = "sed '1i#include <math.h>' -i g_src/ttf_manager.cpp";
|
||||
|
||||
cmakeFlags = [
|
||||
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
|
||||
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
|
||||
|
||||
@@ -16,7 +16,10 @@ stdenv.mkDerivation rec {
|
||||
postPatch = ''
|
||||
substituteInPlace Sources/Client/Client_Input.cpp --replace "isnan(" "std::isnan("
|
||||
substituteInPlace Sources/Client/Corpse.cpp --replace "isnan(" "std::isnan("
|
||||
substituteInPlace Sources/Draw/SWMapRenderer.cpp --replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf("
|
||||
substituteInPlace Sources/Draw/SWMapRenderer.cpp \
|
||||
--replace "isnan(" "std::isnan(" --replace "isinf(" "std::isinf("
|
||||
sed '1i#include <cmath>' -i Sources/Client/{Player,Client_Input,Corpse}.cpp \
|
||||
-i Sources/Draw/SWMapRenderer.cpp
|
||||
'';
|
||||
|
||||
nativeBuildInputs =
|
||||
|
||||
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0vyvmgim03q8pcmfa1i0njr4w1lpjq5g3b47f67v9b5c5jcjycwn";
|
||||
};
|
||||
|
||||
postPatch = "sed '1i#include <cmath>' -i Sources/Client/{,Client}Player.cpp";
|
||||
|
||||
nativeBuildInputs =
|
||||
with stdenv.lib;
|
||||
[ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ]
|
||||
|
||||
@@ -9,8 +9,12 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1cs4q9qiakfd2m1lvfsvfgf8yvhxzmc06glng5d80piwyn6ymzxg";
|
||||
};
|
||||
|
||||
postPatch = "sed '1i#include <vector>' -i src/model/World.h";
|
||||
|
||||
buildInputs = [ qt4 box2d which cmake ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
installPhase = ''
|
||||
make DESTDIR=.. install
|
||||
mkdir -p $out/bin
|
||||
|
||||
Reference in New Issue
Block a user