2014-11-05 09:49:37 +00:00
|
|
|
a :
|
|
|
|
let
|
2009-01-11 22:05:19 +00:00
|
|
|
fetchurl = a.fetchurl;
|
|
|
|
|
2014-11-05 09:49:37 +00:00
|
|
|
version = a.lib.attrByPath ["version"] "3.3c" a;
|
2009-01-11 22:05:19 +00:00
|
|
|
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"];
|
|
|
|
|
2009-05-19 23:25:58 +00:00
|
|
|
preConfigure = a.fullDepEntry (''
|
2012-11-26 14:24:21 +00:00
|
|
|
sed -e 's/getline/my_getline/' -i score.c
|
2009-01-11 22:05:19 +00:00
|
|
|
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
|
2012-11-26 14:24:03 +00:00
|
|
|
echo '#define SCOREFILE ".xsokoban-score"' >> config.h
|
|
|
|
echo '#define LOCKFILE ".xsokoban-score-lock"' >> config.h
|
2009-01-11 22:05:19 +00:00
|
|
|
|
|
|
|
sed -e 's/getpass[(][^)]*[)]/PASSWORD/' -i main.c
|
|
|
|
sed -e '/if [(]owner[)]/iowner=1;' -i main.c
|
|
|
|
'') ["minInit" "doUnpack"];
|
2014-11-05 09:49:37 +00:00
|
|
|
|
2009-05-19 23:25:58 +00:00
|
|
|
preBuild = a.fullDepEntry (''
|
2009-01-11 22:05:19 +00:00
|
|
|
sed -e "s@/usr/local/@$out/@" -i Makefile
|
2014-11-05 09:49:37 +00:00
|
|
|
sed -e "s@ /bin/@ @" -i Makefile
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin $out/share $out/man/man1 $out/lib
|
2009-01-11 22:05:19 +00:00
|
|
|
'') ["minInit" "doConfigure" "defEnsureDir"];
|
|
|
|
|
|
|
|
name = "xsokoban-" + version;
|
|
|
|
meta = {
|
|
|
|
description = "X sokoban";
|
2014-11-05 09:49:37 +00:00
|
|
|
license = a.stdenv.lib.licenses.publicDomain;
|
2014-11-05 08:12:35 +00:00
|
|
|
maintainers = [ a.stdenv.lib.maintainers.raskin ];
|
2009-01-11 22:05:19 +00:00
|
|
|
};
|
|
|
|
}
|