summary refs log tree commit diff
path: root/pkgs/games/openspades
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-06-19 10:18:30 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-06-19 10:18:30 +0200
commit97c484a10f4b38efc4fb3dd210defed96003ae7d (patch)
tree3cf505288a69445d7a0da288197352484942421c /pkgs/games/openspades
parentd133a168f082d2f4c94984190e836e55f5e389a7 (diff)
downloadnixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.tar
nixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.tar.gz
nixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.tar.bz2
nixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.tar.lz
nixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.tar.xz
nixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.tar.zst
nixpkgs-97c484a10f4b38efc4fb3dd210defed96003ae7d.zip
treewide: fix #include errors after gcc-5.4
They were mostly missing <cmath> or <math.h>.
Diffstat (limited to 'pkgs/games/openspades')
-rw-r--r--pkgs/games/openspades/default.nix5
-rw-r--r--pkgs/games/openspades/git.nix2
2 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/games/openspades/default.nix b/pkgs/games/openspades/default.nix
index 2203bb6337e..d263be3ec11 100644
--- a/pkgs/games/openspades/default.nix
+++ b/pkgs/games/openspades/default.nix
@@ -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 = 
diff --git a/pkgs/games/openspades/git.nix b/pkgs/games/openspades/git.nix
index 8212f160cda..7d76573f734 100644
--- a/pkgs/games/openspades/git.nix
+++ b/pkgs/games/openspades/git.nix
@@ -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 ]