summary refs log tree commit diff
path: root/pkgs/games/teeworlds
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-01-13 19:44:11 +0000
committerLudovic Courtès <ludo@gnu.org>2009-01-13 19:44:11 +0000
commite71dbdbb8334152dbf3083801d194b2f88cee9b4 (patch)
treee1fc09fe8c5dd0834b4068b0141ed1e0a23d4624 /pkgs/games/teeworlds
parent4d5c788b815adad5273c0e5256a72c1a31065d77 (diff)
downloadnixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.tar
nixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.tar.gz
nixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.tar.bz2
nixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.tar.lz
nixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.tar.xz
nixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.tar.zst
nixpkgs-e71dbdbb8334152dbf3083801d194b2f88cee9b4.zip
Add Teeworlds, a Worms-like game, if you see what I mean.
svn path=/nixpkgs/trunk/; revision=13762
Diffstat (limited to 'pkgs/games/teeworlds')
-rw-r--r--pkgs/games/teeworlds/default.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/games/teeworlds/default.nix b/pkgs/games/teeworlds/default.nix
new file mode 100644
index 00000000000..a458976e3e4
--- /dev/null
+++ b/pkgs/games/teeworlds/default.nix
@@ -0,0 +1,63 @@
+{ fetchurl, stdenv, unzip, python, alsaLib, libX11, mesa }:
+
+stdenv.mkDerivation rec {
+  name = "teeworlds-0.4.3";
+
+  src = fetchurl {
+    url = "http://www.teeworlds.com/files/${name}-src.tar.gz";
+    sha256 = "1k141517wchhw2586m0kkvh65kadnlybpvzrxlb8b098jbg1hr1n";
+  };
+
+  # Note: Teeworlds requires Python 2.x to compile.  Python 3.0 will
+  # not work.
+  buildInputs = [ unzip python alsaLib libX11 mesa ];
+
+  patchPhase = ''
+    substituteInPlace "default.bam"                             \
+      --replace 'settings.linker.flags = ""'                    \
+                'settings.linker.flags = "-fstack-protector-all"'
+  '';
+  configurePhase = ''
+    # Fetch and build BAM, the home-made build system.
+    unzip ${fetchurl {
+        url = "http://teeworlds.com/files/bam.zip";
+        sha256 = "0dz9k906skgzc4l15ihlqb1d1hk0s2yajadbq5zs01gxi05xhy6v";
+      }
+    }
+    ( cd bam && ./make_unix.sh )
+
+    # Build Teeworlds.
+    ./bam/src/bam release
+  '';
+
+  installPhase = ''
+    ensureDir "$out/share/${name}"
+    cp -rv data "$out/share/${name}"
+
+    ensureDir "$out/bin"
+    cp -v teeworlds "$out/bin/.wrapped-teeworlds"
+
+    cat > "$out/bin/teeworlds" <<EOF
+#!/bin/sh
+cd "$out/share/${name}" && exec "$out/bin/.wrapped-teeworlds"
+EOF
+    chmod +x "$out/bin/teeworlds"
+
+    ensureDir "$out/doc/${name}"
+    cp -v *.txt "$out/doc/${name}"
+  '';
+
+  meta = {
+    description = "Teeworlds, a retro multiplayer shooter game";
+
+    longDescription = ''
+      Teeworlds is a free online multiplayer game, available for all
+      major operating systems.  Battle with up to 12 players in a
+      variety of game modes, including Team Deathmatch and Capture The
+      Flag.  You can even design your own maps!
+    '';
+
+    homepage = http://teeworlds.com/;
+    license = "BSD-style, see `license.txt'";
+  };
+}