2015-05-01 16:56:53 +02:00
|
|
|
{ stdenv, fetchurl, libX11, xproto, libXpm, libXt }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "xsokoban-${version}";
|
|
|
|
version = "3.3c";
|
2009-01-11 23:05:19 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-05-01 16:56:53 +02:00
|
|
|
url = "http://www.cs.cornell.edu/andru/release/${name}.tar.gz";
|
2009-01-11 23:05:19 +01:00
|
|
|
sha256 = "006lp8y22b9pi81x1a9ldfgkl1fbmkdzfw0lqw5y9svmisbafbr9";
|
|
|
|
};
|
|
|
|
|
2015-05-01 16:56:53 +02:00
|
|
|
buildInputs = [ libX11 xproto libXpm libXt ];
|
2009-01-11 23:05:19 +01:00
|
|
|
|
2015-05-01 16:56:53 +02:00
|
|
|
preConfigure = ''
|
2012-11-26 15:24:21 +01:00
|
|
|
sed -e 's/getline/my_getline/' -i score.c
|
2015-11-25 21:31:09 +01:00
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libXpm.dev}/include/X11"
|
2009-01-11 23:05:19 +01:00
|
|
|
for i in $NIX_CFLAGS_COMPILE; do echo $i; ls ''${i#-I}; done
|
|
|
|
chmod a+rw config.h
|
2015-05-01 16:56:53 +02:00
|
|
|
cat >>config.h <<EOF
|
|
|
|
#define HERE "@nixos-packaged"
|
|
|
|
#define WWW 0
|
|
|
|
#define OWNER "'$(whoami)'"
|
|
|
|
#define ROOTDIR "'$out/lib/xsokoban'"
|
|
|
|
#define ANYLEVEL 1
|
|
|
|
#define SCOREFILE ".xsokoban-score"
|
|
|
|
#define LOCKFILE ".xsokoban-score-lock"
|
|
|
|
EOF
|
2009-01-11 23:05:19 +01:00
|
|
|
|
2015-05-01 16:56:53 +02:00
|
|
|
sed -i main.c \
|
|
|
|
-e 's/getpass[(][^)]*[)]/PASSWORD/' \
|
|
|
|
-e '/if [(]owner[)]/iowner=1;'
|
|
|
|
'';
|
2014-11-05 10:49:37 +01:00
|
|
|
|
2015-05-01 16:56:53 +02:00
|
|
|
preBuild = ''
|
|
|
|
sed -i Makefile \
|
|
|
|
-e "s@/usr/local/@$out/@" \
|
|
|
|
-e "s@ /bin/@ @"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/bin $out/share $out/man/man1 $out/lib
|
2015-05-01 16:56:53 +02:00
|
|
|
'';
|
2009-01-11 23:05:19 +01:00
|
|
|
|
2015-05-01 16:56:53 +02:00
|
|
|
meta = with stdenv.lib; {
|
2009-01-11 23:05:19 +01:00
|
|
|
description = "X sokoban";
|
2015-05-01 16:56:53 +02:00
|
|
|
license = licenses.publicDomain;
|
|
|
|
maintainers = [ maintainers.raskin ];
|
2009-01-11 23:05:19 +01:00
|
|
|
};
|
|
|
|
}
|