diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2010-08-20 13:41:12 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2010-08-20 13:41:12 +0000 |
commit | f16353b6f236ae9046bfc3d9031efd519fc73b82 (patch) | |
tree | eb4b931c357f70a0cd6804e8be853a49ca2f77c9 /pkgs/games | |
parent | f7d0fcdaac7dc2d60a0d57e90632f20ba36242f5 (diff) | |
parent | 7dea1a0f4f0b893780e0e4d8a64b77642fa22205 (diff) | |
download | nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.tar nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.tar.gz nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.tar.bz2 nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.tar.lz nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.tar.xz nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.tar.zst nixlib-f16353b6f236ae9046bfc3d9031efd519fc73b82.zip |
Updated from trunk.
svn path=/nixpkgs/branches/stdenv-updates/; revision=23275
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/castle-combat/default.nix | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/pkgs/games/castle-combat/default.nix b/pkgs/games/castle-combat/default.nix index 29ebb00f1078..07778363fd54 100644 --- a/pkgs/games/castle-combat/default.nix +++ b/pkgs/games/castle-combat/default.nix @@ -1,54 +1,53 @@ -{ fetchurl, stdenv, python, pygame, twisted, numeric, lib, makeWrapper }: +{ fetchurl, stdenv, buildPythonPackage, pygame, twisted, numeric, makeWrapper }: -stdenv.mkDerivation rec { +buildPythonPackage rec { name = "castle-combat-0.8.1"; + namePrefix = ""; src = fetchurl { url = "mirror://sourceforge/castle-combat/${name}.tar.gz"; sha256 = "1hp4y5dgj88j9g44h4dqiakrgj8lip1krlrdl2qpffin08agrvik"; }; - buildInputs = [ python pygame twisted makeWrapper ]; + 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 + ]; patchPhase = '' sed -i "src/common.py" \ -e "s|^data_path *=.*$|data_path = \"$out/share/${name}\"|g" - ''; - buildPhase = ''python setup.py build --build-base "$out"''; - installPhase = '' - python setup.py install --prefix "$out" + mv -v "src/"*.py . + sed -i "setup.py" -e's/"src"/""/g' + ''; + postInstall = '' ensureDir "$out/share/${name}" - cp -rv data/* "$out/share/${name}" + cp -rv "data/"* "$out/share/${name}" - ${postInstall} + mv -v "$out/bin/castle-combat.py" "$out/bin/castle-combat" ''; - postInstall = '' - mv "$out/bin/castle-combat.py" "$out/bin/castle-combat" - wrapProgram "$out/bin/castle-combat" \ - --prefix PYTHONPATH ":" \ - ${lib.concatStringsSep ":" - ([ "$out/lib/python2.5/site-packages/src" - - # XXX: `Numeric.pth' should be found by Python but it's not. - # Gobolinux has the same problem: - # http://bugs.python.org/issue1431 . - "${numeric}/lib/python2.5/site-packages/Numeric" ] ++ - (map (path: path + "/lib/python2.5/site-packages") - ([ "${pygame}" "${twisted}" ] - ++ twisted.propagatedBuildInputs)))} \ - \ - --prefix LD_LIBRARY_PATH ":" \ - "$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib" + postPhases = "fixLoaderPath"; + fixLoaderPath = + let dollar = "\$"; in + '' sed -i "$out/bin/castle-combat" \ + -e "/^exec/ iexport LD_LIBRARY_PATH=\"$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib\:"'${dollar}'"LD_LIBRARY_PATH\"\\ +export LD_LIBRARY_PATH=\"$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib64\:"'${dollar}'"LD_LIBRARY_PATH\"" + ''; # ^ # `--- The run-time says: "libgcc_s.so.1 must be installed for - # pthread_cancel to work", which means it need help to find it. + # pthread_cancel to work", which means it needs help to find it. - rm -rf "$out/lib/src" - ''; + # No test suite. + doCheck = false; meta = { description = "Castle-Combat, a clone of the old arcade game Rampart"; @@ -64,5 +63,7 @@ stdenv.mkDerivation rec { homepage = http://www.linux-games.com/castle-combat/; license = "unknown"; + + maintainers = [ stdenv.lib.maintainers.ludo ]; }; } |