2010-08-18 14:25:07 +00:00
|
|
|
{ fetchurl, stdenv, buildPythonPackage, pygame, twisted, numeric, makeWrapper }:
|
2008-10-06 22:49:37 +00:00
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
buildPythonPackage rec {
|
2008-10-06 22:49:37 +00:00
|
|
|
name = "castle-combat-0.8.1";
|
2010-08-18 14:25:07 +00:00
|
|
|
namePrefix = "";
|
2008-10-06 22:49:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/castle-combat/${name}.tar.gz";
|
|
|
|
sha256 = "1hp4y5dgj88j9g44h4dqiakrgj8lip1krlrdl2qpffin08agrvik";
|
|
|
|
};
|
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
propagatedBuildInputs =
|
|
|
|
[ pygame twisted
|
|
|
|
|
|
|
|
# XXX: `Numeric.pth' should be found by Python but it's not.
|
|
|
|
# Gobolinux has the same problem:
|
|
|
|
# http://bugs.python.org/issue1431 .
|
|
|
|
numeric
|
|
|
|
];
|
2008-10-06 22:49:37 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i "src/common.py" \
|
|
|
|
-e "s|^data_path *=.*$|data_path = \"$out/share/${name}\"|g"
|
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
mv -v "src/"*.py .
|
|
|
|
sed -i "setup.py" -e's/"src"/""/g'
|
|
|
|
'';
|
2008-10-06 22:49:37 +00:00
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
postInstall = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/share/${name}"
|
2010-08-18 14:25:07 +00:00
|
|
|
cp -rv "data/"* "$out/share/${name}"
|
2008-10-06 22:49:37 +00:00
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
mv -v "$out/bin/castle-combat.py" "$out/bin/castle-combat"
|
2008-10-06 22:49:37 +00:00
|
|
|
'';
|
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
postPhases = "fixLoaderPath";
|
2008-10-06 22:49:37 +00:00
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
fixLoaderPath =
|
|
|
|
let dollar = "\$"; in
|
|
|
|
'' sed -i "$out/bin/castle-combat" \
|
2014-12-17 18:11:30 +00:00
|
|
|
-e "/^exec/ iexport LD_LIBRARY_PATH=\"$(cat ${stdenv.cc}/nix-support/orig-gcc)/lib\:"'${dollar}'"LD_LIBRARY_PATH\"\\
|
|
|
|
export LD_LIBRARY_PATH=\"$(cat ${stdenv.cc}/nix-support/orig-gcc)/lib64\:"'${dollar}'"LD_LIBRARY_PATH\""
|
2010-08-18 14:25:07 +00:00
|
|
|
'';
|
2008-10-06 22:49:37 +00:00
|
|
|
# ^
|
|
|
|
# `--- The run-time says: "libgcc_s.so.1 must be installed for
|
2010-08-18 14:25:07 +00:00
|
|
|
# pthread_cancel to work", which means it needs help to find it.
|
2008-10-06 22:49:37 +00:00
|
|
|
|
2010-08-18 14:25:07 +00:00
|
|
|
# No test suite.
|
|
|
|
doCheck = false;
|
2008-10-06 22:49:37 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Castle-Combat, a clone of the old arcade game Rampart";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Castle-Combat is a clone of the old arcade game Rampart. Up to
|
|
|
|
four players (or more in future versions) build castle walls,
|
|
|
|
place cannons inside these walls, and shoot at the walls of
|
|
|
|
their enemy(s). If a player cannot build a complete wall around
|
|
|
|
one of his castles, he loses. The last surviving player wins.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = http://www.linux-games.com/castle-combat/;
|
|
|
|
|
|
|
|
license = "unknown";
|
2010-08-18 14:25:07 +00:00
|
|
|
|
2013-08-16 21:44:33 +00:00
|
|
|
maintainers = [ ];
|
2008-10-06 22:49:37 +00:00
|
|
|
};
|
|
|
|
}
|