Added XSokoban

svn path=/nixpkgs/trunk/; revision=13737
This commit is contained in:
Michael Raskin 2009-01-11 22:05:19 +00:00
parent 7807b74774
commit 490c7d417e
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,48 @@
a :
let
fetchurl = a.fetchurl;
version = a.lib.getAttr ["version"] "3.3c" a;
buildInputs = with a; [
a.libX11 a.xproto a.libXpm a.libXt
];
in
rec {
src = fetchurl {
url = "http://www.cs.cornell.edu/andru/release/xsokoban-${version}.tar.gz";
sha256 = "006lp8y22b9pi81x1a9ldfgkl1fbmkdzfw0lqw5y9svmisbafbr9";
};
inherit buildInputs;
configureFlags = [];
/* doConfigure should be removed if not needed */
phaseNames = ["preConfigure" "doConfigure" "preBuild" "doMakeInstall"];
preConfigure = a.FullDepEntry (''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.libXpm}/include/X11"
for i in $NIX_CFLAGS_COMPILE; do echo $i; ls ''${i#-I}; done
chmod a+rw config.h
echo '#define HERE "@nixos-packaged"' >> config.h
echo '#define WWW 0' >> config.h
echo '#define OWNER "'$(whoami)'"' >> config.h
echo '#define ROOTDIR "'$out/lib/xsokoban'"' >> config.h
echo '#define ANYLEVEL 1' >> config.h
echo '#define SCOREFILE "/tmp/.xsokoban-score"' >> config.h
echo '#define LOCKFILE "/tmp/.xsokoban-score-lock"' >> config.h
sed -e 's/getpass[(][^)]*[)]/PASSWORD/' -i main.c
sed -e '/if [(]owner[)]/iowner=1;' -i main.c
'') ["minInit" "doUnpack"];
preBuild = a.FullDepEntry (''
sed -e "s@/usr/local/@$out/@" -i Makefile
sed -e "s@ /bin/@ @" -i Makefile
ensureDir $out/bin $out/share $out/man/man1 $out/lib
'') ["minInit" "doConfigure" "defEnsureDir"];
name = "xsokoban-" + version;
meta = {
description = "X sokoban";
};
}

View File

@ -8454,6 +8454,10 @@ let
inherit fetchurl stdenv xlibs mesa;
};
xsokoban = builderDefsPackage (import ../games/xsokoban) {
inherit (xlibs) libX11 xproto libXpm libXt;
};
zoom = import ../games/zoom {
inherit fetchurl stdenv perl expat freetype;
inherit (xlibs) xlibs;