summary refs log tree commit diff
path: root/pkgs/games/scorched3d
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-04-16 22:50:36 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-04-16 22:50:36 +0000
commita81a4cfd6e5709d452538e8fea2eb1766f38f7c1 (patch)
tree5fd3d521c551e78f559b0a31f45167a8a4a6cd0f /pkgs/games/scorched3d
parent0df122b0acdc9cf446fff5d005a29b1a3c312571 (diff)
downloadnixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.tar
nixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.tar.gz
nixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.tar.bz2
nixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.tar.lz
nixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.tar.xz
nixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.tar.zst
nixpkgs-a81a4cfd6e5709d452538e8fea2eb1766f38f7c1.zip
Added Scorched3D.
svn path=/nixpkgs/trunk/; revision=15108
Diffstat (limited to 'pkgs/games/scorched3d')
-rw-r--r--pkgs/games/scorched3d/default.nix33
-rw-r--r--pkgs/games/scorched3d/file-existence.patch37
-rw-r--r--pkgs/games/scorched3d/scorched3d-42.1-fixups.patch58
3 files changed, 128 insertions, 0 deletions
diff --git a/pkgs/games/scorched3d/default.nix b/pkgs/games/scorched3d/default.nix
new file mode 100644
index 00000000000..18a86f2d85c
--- /dev/null
+++ b/pkgs/games/scorched3d/default.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl, mesa, openal, autoconf, automake, libtool, freealut, wxGTK,
+freetype, fftw, SDL, SDL_net, zlib, libpng, libjpeg} :
+
+stdenv.mkDerivation {
+  name = "scorched3d-42.1";
+  src = fetchurl {
+    url = mirror://sourceforge/scorched3d/Scorched3D-42.1-src.tar.gz;
+    sha256 = "0vhhi68ii5ldxbacsiqccsascrn3q033hnaa1ha8r9gxspzcqkl8";
+  };
+
+  buildInputs = [ mesa openal autoconf automake libtool freealut wxGTK
+    freetype fftw SDL SDL_net zlib libpng libjpeg ];
+
+  unpackPhase = "tar xvzf $src ; cd scorched";
+
+  patches = [ ./scorched3d-42.1-fixups.patch ./file-existence.patch ];
+
+  preConfigure = ''
+    set +e
+    aclocal
+    libtoolize --copy --force
+    autoconf
+    automake
+    libtoolize
+    set -e
+  '';
+
+  meta = {
+    homepage = http://scorched3d.co.uk/;
+    description = "3D Clone of the classic Scorched Earth";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/games/scorched3d/file-existence.patch b/pkgs/games/scorched3d/file-existence.patch
new file mode 100644
index 00000000000..35eb63d0702
--- /dev/null
+++ b/pkgs/games/scorched3d/file-existence.patch
@@ -0,0 +1,37 @@
+diff --git a/src/common/common/DefinesFile.cpp b/src/common/common/DefinesFile.cpp
+index 6ad803d..022797a 100644
+--- a/src/common/common/DefinesFile.cpp
++++ b/src/common/common/DefinesFile.cpp
+@@ -36,6 +36,17 @@
+ #include <unistd.h>

+ #endif

+ 

++namespace {

++    bool fileCanBeStated(const std::string &file)

++    {

++        struct stat buf;

++        memset(&buf, 0, sizeof(buf));

++        int result = stat(file.c_str(), &buf );

++

++        return result == 0;

++    }

++}

++

+ std::string S3D::getHomeDir()

+ {

+ #ifdef _WIN32

+@@ -74,12 +85,12 @@ bool S3D::dirMake(const std::string &file)
+ 

+ bool S3D::fileExists(const std::string &file)

+ {

+-	return (S3D::fileModTime(file) != 0);

++	return fileCanBeStated(file);

+ }

+ 

+ bool S3D::dirExists(const std::string &file)

+ {

+-	return (S3D::fileModTime(file) != 0);

++	return fileCanBeStated(file);

+ }

+ 

+ time_t S3D::fileModTime(const std::string &file)

diff --git a/pkgs/games/scorched3d/scorched3d-42.1-fixups.patch b/pkgs/games/scorched3d/scorched3d-42.1-fixups.patch
new file mode 100644
index 00000000000..36a027cb60c
--- /dev/null
+++ b/pkgs/games/scorched3d/scorched3d-42.1-fixups.patch
@@ -0,0 +1,58 @@
+diff -ru scorched.orig/configure-al.m4 scorched/configure-al.m4
+--- scorched.orig/configure-al.m4	2008-03-03 16:17:18.000000000 -0500
++++ scorched/configure-al.m4	2009-02-15 20:43:35.000000000 -0500
+@@ -7,25 +7,9 @@
+ 	[  --disable-openaltest    Do not try to compile and run a test OpenAL program],
+ 		    , enable_openaltest=yes)
+ AC_MSG_CHECKING(for OpenAL support)
+-AC_PATH_PROG(OPENAL_CONFIG, openal-config, no)
+-if test x$OPENAL_CONFIG = xno; then
+-	echo "*** The openal-config script installed by OpenAL could not be found"
+-	echo "*** Make sure openal-config is in your path, or set the OPENAL_CONFIG"
+-	echo "*** environment variable to the full path to openal-config."
+-
+-	AC_MSG_ERROR([*** Can't find the openal library. Try: http://www.openal.org/])
+-else
+-
+-	if test x"$use_static_openal" = x"yes"; then
+-		AL_LIBS="/usr/local/lib/libopenal.a"
+-	else
+-		AL_LIBS="`$OPENAL_CONFIG --libs`"
+-	fi
+-	
+-	AL_CFLAGS="`$OPENAL_CONFIG --cflags`"
+-
+-	AC_MSG_RESULT(yes)
+-fi
++AL_LIBS="-lopenal"
++AL_CFLAGS="-I/usr/include/AL"
++AC_MSG_RESULT(yes)
+ 
+ AC_MSG_CHECKING(for Freealut support)
+ AC_PATH_PROG(FREEALUT_CONFIG, freealut-config, no)
+diff -ru scorched.orig/configure.ac scorched/configure.ac
+--- scorched.orig/configure.ac	2008-03-03 16:17:18.000000000 -0500
++++ scorched/configure.ac	2009-02-15 20:40:30.000000000 -0500
+@@ -13,22 +13,6 @@
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
+ 
+-LDFLAGS="-L/usr/X11R6/lib -L/usr/X11R6"
+-CPPFLAGS="-I/usr/X11R6/include -I/usr/X11R6"
+-
+-if test `uname` == Darwin; then
+-LDFLAGS="$LDFLAGS -lmx"
+-CPPFLAGS="$CPPFLAGS -DFFTW_USE_DOUBLE -D__DARWIN__ -D__MACOSX__"
+-else
+-LDFLAGS="$LDFLAGS -L/usr/local/lib"
+-CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+-fi
+-
+-AC_CHECK_LIB(fridge, beer, echo "Hmm?!",[
+-	echo "Warning: No beer found in fridge!";
+-	echo "We highly suggest that you rectify this situation immediately."
+-])
+-
+ AC_ARG_ENABLE(serveronly, 
+ 	[  --enable-serveronly Enable server only compilation],
+ 		    , enable_serveronly=no,