summary refs log tree commit diff
path: root/pkgs/games/openspades
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/openspades')
-rw-r--r--pkgs/games/openspades/default.nix6
-rw-r--r--pkgs/games/openspades/git.nix2
2 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/games/openspades/default.nix b/pkgs/games/openspades/default.nix
index 2203bb6337eb..143fa21ce2e5 100644
--- a/pkgs/games/openspades/default.nix
+++ b/pkgs/games/openspades/default.nix
@@ -16,7 +16,11 @@ 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
+    sed '1i#include <math.h>' -i Sources/Draw/SWFeatureLevel.h
   '';
 
   nativeBuildInputs = 
diff --git a/pkgs/games/openspades/git.nix b/pkgs/games/openspades/git.nix
index 8212f160cda8..7d76573f7345 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 ]