diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2017-01-10 20:08:22 +0100 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2017-01-10 20:08:31 +0100 |
commit | 15ef9bc87d2e74366f3d6bfe4818cee6d33a1aa6 (patch) | |
tree | 94c651ac7d735aec8934d73d256a44f3335866a6 /pkgs/games/xsok | |
parent | e4fb2bb0c51f6e7fadef6f46b2fe50a6f02e0a38 (diff) |
xsok: init at 1.02
Diffstat (limited to 'pkgs/games/xsok')
-rw-r--r-- | pkgs/games/xsok/default.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/games/xsok/default.nix b/pkgs/games/xsok/default.nix new file mode 100644 index 0000000000000..57c2ca2dfd867 --- /dev/null +++ b/pkgs/games/xsok/default.nix @@ -0,0 +1,47 @@ +{stdenv, fetchurl, libX11, imake, libXt, libXaw, libXpm, libXext +, withNethackLevels ? true +}: +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + pname = "xsok"; + version = "1.02"; + + src = fetchurl { + url = "http://http.debian.net/debian/pool/main/x/xsok/xsok_1.02.orig.tar.gz"; + sha256 = "0f4z53xsy4w8x8zp5jya689xp3rcfpi5wri2ip0qa8nk3sw7zj73"; + }; + + nethackLevels = fetchurl { + url = "https://www.electricmonk.nl/data/nethack/nethack.def"; + sha256 = "057ircp13hfpy513c7wpyp986hsvhqs7km98w4k39f5wkvp3dj02"; + }; + + buildInputs = [libX11 libXt libXaw libXpm libXext]; + nativeBuildInputs = [imake]; + + NIX_CFLAGS_COMPILE=" -isystem ${libXpm.dev}/include/X11 "; + + preConfigure = '' + sed -e "s@/usr/@$out/share/@g" -i src/Imakefile + sed -e "s@/var/games/xsok@./.xsok/@g" -i src/Imakefile + sed -e '/chown /d' -i src/Imakefile + sed -e '/chmod /d' -i src/Imakefile + sed -e '/InstallAppDefaults/d' -i src/Imakefile + ''; + + makeFlags = ["BINDIR=$(out)/bin"]; + + postInstall = stdenv.lib.optionalString withNethackLevels '' + gzip < ${nethackLevels} > "$out/share/games/lib/xsok/Nethack.def.gz" + echo Nethack > "$out/share/games/lib/xsok/gametypes" + ''; + + meta = { + inherit version; + description = "A generic Sokoban game for X11"; + license = stdenv.lib.licenses.gpl2Plus; + maintainers = [stdenv.lib.maintainers.raskin]; + platforms = stdenv.lib.platforms.linux; + homepage = "https://tracker.debian.org/pkg/xsok"; + }; +} |