summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorcillianderoiste <cillian.deroiste@gmail.com>2014-10-14 17:51:44 +0200
committercillianderoiste <cillian.deroiste@gmail.com>2014-10-14 17:51:44 +0200
commit0868feeb3dea42d30380cf1be2deb883a6c369b0 (patch)
tree5b260a546a40e5da3484d929f0041848860318aa /pkgs
parent31a5126b0698e73247259639b97149e893df5172 (diff)
parent48664fb7b2dfac94a9958679eb14b1f49c2c9e25 (diff)
downloadnixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.tar
nixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.tar.gz
nixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.tar.bz2
nixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.tar.lz
nixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.tar.xz
nixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.tar.zst
nixlib-0868feeb3dea42d30380cf1be2deb883a6c369b0.zip
Merge pull request #4524 from kragniz/master
Add hedgewars
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/games/hedgewars/default.nix69
-rw-r--r--pkgs/games/hedgewars/fix-ghc-7.8-build-failure.diff16
-rw-r--r--pkgs/top-level/all-packages.nix6
3 files changed, 91 insertions, 0 deletions
diff --git a/pkgs/games/hedgewars/default.nix b/pkgs/games/hedgewars/default.nix
new file mode 100644
index 000000000000..3dbc86a73784
--- /dev/null
+++ b/pkgs/games/hedgewars/default.nix
@@ -0,0 +1,69 @@
+{ SDL_image, SDL_ttf, SDL_net, fpc, qt4 , ghc, ffmpeg, freeglut, network, vector
+, stdenv, makeWrapper, fetchurl, cmake, pkgconfig, lua5_1, SDL, SDL_mixer
+, utf8String, bytestringShow, hslogger, random, dataenc, zlib, libpng, mesa
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.9.20.5";
+  name = "hedgewars-${version}";
+  src = fetchurl {
+    url = "http://download.gna.org/hedgewars/hedgewars-src-${version}.tar.bz2";
+    sha256 = "1k5dq14s9pshrqlz8vnix237bcapfif4k3rc4yj4cmwdx1pqkl56";
+  };
+
+  buildInputs = [
+    SDL_ttf SDL_net network vector utf8String bytestringShow hslogger random
+    cmake pkgconfig lua5_1 SDL SDL_mixer SDL_image fpc qt4 ghc ffmpeg freeglut
+    dataenc makeWrapper
+  ];
+
+  patches = [ ./fix-ghc-7.8-build-failure.diff ];
+
+  preBuild = ''
+    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${SDL_image}/lib
+                                     -rpath ${SDL_mixer}/lib
+                                     -rpath ${SDL_net}/lib
+                                     -rpath ${SDL_ttf}/lib
+                                     -rpath ${SDL}/lib
+                                     -rpath ${libpng}/lib
+                                     -rpath ${lua5_1}/lib
+                                     -rpath ${mesa}/lib
+                                     -rpath ${zlib}/lib
+                                     "
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/hwengine --prefix LD_LIBRARY_PATH : $LD_LIBRARY_PATH:${mesa}/lib/:${freeglut}/lib
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Turn-based strategy artillery game similiar to Worms";
+    homepage = http://hedgewars.org/;
+    license = licenses.gpl2;
+    longDescription = ''
+       Each player controls a team of several hedgehogs. During the course of
+       the game, players take turns with one of their hedgehogs. They then use
+       whatever tools and weapons are available to attack and kill the
+       opponents' hedgehogs, thereby winning the game. Hedgehogs may move
+       around the terrain in a variety of ways, normally by walking and jumping
+       but also by using particular tools such as the "Rope" or "Parachute", to
+       move to otherwise inaccessible areas. Each turn is time-limited to
+       ensure that players do not hold up the game with excessive thinking or
+       moving.
+
+       A large variety of tools and weapons are available for players during
+       the game: Grenade, Cluster Bomb, Bazooka, UFO, Homing Bee, Shotgun,
+       Desert Eagle, Fire Punch, Baseball Bat, Dynamite, Mine, Rope, Pneumatic
+       pick, Parachute. Most weapons, when used, cause explosions that deform
+       the terrain, removing circular chunks. The landscape is an island
+       floating on a body of water, or a restricted cave with water at the
+       bottom. A hedgehog dies when it enters the water (either by falling off
+       the island, or through a hole in the bottom of it), it is thrown off
+       either side of the arena or when its health is reduced, typically from
+       contact with explosions, to zero (the damage dealt to the attacked
+       hedgehog or hedgehogs after a player's or CPU turn is shown only when
+       all movement on the battlefield has ceased).'';
+    maintainers = maintainers.kragniz;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/games/hedgewars/fix-ghc-7.8-build-failure.diff b/pkgs/games/hedgewars/fix-ghc-7.8-build-failure.diff
new file mode 100644
index 000000000000..7974c6797fc5
--- /dev/null
+++ b/pkgs/games/hedgewars/fix-ghc-7.8-build-failure.diff
@@ -0,0 +1,16 @@
+## fix-ghc-7.8-build-failure.diff [diff]
+diff --git a/gameServer/Actions.hs b/gameServer/Actions.hs
+index 2cebe4f..355ee26 100644
+--- a/gameServer/Actions.hs
++++ b/gameServer/Actions.hs
+@@ -562,7 +562,7 @@ processAction (AddClient cl) = do
+     si <- gets serverInfo
+     newClId <- io $ do
+         ci <- addClient rnc cl
+-        _ <- Exception.mask (forkIO . clientRecvLoop (clientSocket cl) (coreChan si) (sendChan cl) ci)
++        _ <- Exception.mask (\x -> forkIO $ clientRecvLoop (clientSocket cl) (coreChan si) (sendChan cl) ci x)
+ 
+         infoM "Clients" (show ci ++ ": New client. Time: " ++ show (connectTime cl))
+ 
+
+
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ba1a6b143264..677fb81b794f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -11005,6 +11005,12 @@ let
 
   gtypist = callPackage ../games/gtypist { };
 
+  hedgewars = callPackage ../games/hedgewars {
+    inherit (haskellPackages) ghc network vector utf8String bytestringShow
+      random hslogger dataenc;
+    SDL = SDL_pulseaudio;
+  };
+
   hexen = callPackage ../games/hexen { };
 
   icbm3d = callPackage ../games/icbm3d { };