From e4c64d1e17fa198c091401315f9df873aaac2f6e Mon Sep 17 00:00:00 2001
From: Michael Raskin <7c6f434c@mail.ru>
Date: Sun, 2 Feb 2014 15:03:22 +0400
Subject: [PATCH] Adding missing unistd.h includes

---
 pkgs/games/ultimatestunts/default.nix | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pkgs/games/ultimatestunts/default.nix b/pkgs/games/ultimatestunts/default.nix
index dc221f37dd62..4b1cab6531c7 100644
--- a/pkgs/games/ultimatestunts/default.nix
+++ b/pkgs/games/ultimatestunts/default.nix
@@ -10,6 +10,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL mesa SDL_image freealut openal libvorbis pkgconfig ];
 
+  postPatch = ''
+    sed -e '1i#include <unistd.h>' -i $(find . -name '*.c' -o -name '*.cpp')
+  '';
+
   meta = {
     homepage = http://www.ultimatestunts.nl/;
     description = "Remake of the popular racing DOS-game Stunts";