1 {lib, stdenv, fetchurl, libX11, imake, libXt, libXaw, libXpm, libXext
2 , withNethackLevels ? true
4 stdenv.mkDerivation rec {
9 url = "http://http.debian.net/debian/pool/main/x/xsok/xsok_1.02.orig.tar.gz";
10 sha256 = "0f4z53xsy4w8x8zp5jya689xp3rcfpi5wri2ip0qa8nk3sw7zj73";
13 nethackLevels = fetchurl {
14 url = "https://www.electricmonk.nl/data/nethack/nethack.def";
15 sha256 = "057ircp13hfpy513c7wpyp986hsvhqs7km98w4k39f5wkvp3dj02";
18 buildInputs = [libX11 libXt libXaw libXpm libXext];
19 nativeBuildInputs = [imake];
21 env.NIX_CFLAGS_COMPILE = " -isystem ${libXpm.dev}/include/X11 ";
24 sed -e "s@/usr/@$out/share/@g" -i src/Imakefile
25 sed -e "s@/var/games/xsok@./.xsok/@g" -i src/Imakefile
26 sed -e '/chown /d' -i src/Imakefile
27 sed -e '/chmod /d' -i src/Imakefile
28 sed -e '/InstallAppDefaults/d' -i src/Imakefile
29 sed -e 's/CC = gcc/CC = cc/g' -i src/Imakefile
32 makeFlags = ["BINDIR=$(out)/bin"];
34 postInstall = lib.optionalString withNethackLevels ''
35 gzip < ${nethackLevels} > "$out/share/games/lib/xsok/Nethack.def.gz"
36 echo Nethack > "$out/share/games/lib/xsok/gametypes"
40 description = "A generic Sokoban game for X11";
42 license = lib.licenses.gpl2Plus;
43 maintainers = [lib.maintainers.raskin];
44 platforms = lib.platforms.unix;
45 homepage = "https://tracker.debian.org/pkg/xsok";