1 { lib, stdenv, fetchurl, libX11, xorgproto, libXpm, libXt }:
3 stdenv.mkDerivation rec {
8 url = "https://www.cs.cornell.edu/andru/release/${pname}-${version}.tar.gz";
9 sha256 = "006lp8y22b9pi81x1a9ldfgkl1fbmkdzfw0lqw5y9svmisbafbr9";
12 buildInputs = [ libX11 xorgproto libXpm libXt ];
14 env.NIX_CFLAGS_COMPILE = "-I${libXpm.dev}/include/X11";
16 hardeningDisable = [ "format" ];
19 substituteInPlace Makefile.in --replace 4755 0755
23 sed -e 's/getline/my_getline/' -i score.c
27 #define HERE "@nixos-packaged"
29 #define OWNER "$(whoami)"
30 #define ROOTDIR "$out/lib/xsokoban"
32 #define SCOREFILE ".xsokoban-score"
33 #define LOCKFILE ".xsokoban-score-lock"
37 -e 's/getpass[(][^)]*[)]/PASSWORD/' \
38 -e '/if [(]owner[)]/iowner=1;'
43 -e "s@/usr/local/@$out/@" \
45 mkdir -p $out/bin $out/share $out/man/man1 $out/lib
49 description = "X sokoban";
50 mainProgram = "xsokoban";
51 license = licenses.publicDomain;
52 maintainers = [ maintainers.raskin ];
53 platforms = platforms.linux;