From 1745266d327b9534a8b546845b186fab8174433f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 31 Jan 2009 20:09:54 +0000 Subject: [PATCH] Added GNU Chess and XBoard svn path=/nixpkgs/trunk/; revision=13923 --- pkgs/games/gnuchess/default.nix | 31 +++++++++++++++++++++++++++++++ pkgs/games/xboard/default.nix | 32 ++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 10 ++++++++++ 3 files changed, 73 insertions(+) create mode 100644 pkgs/games/gnuchess/default.nix create mode 100644 pkgs/games/xboard/default.nix diff --git a/pkgs/games/gnuchess/default.nix b/pkgs/games/gnuchess/default.nix new file mode 100644 index 000000000000..ff86ad268932 --- /dev/null +++ b/pkgs/games/gnuchess/default.nix @@ -0,0 +1,31 @@ +a : +let + fetchurl = a.fetchurl; + + version = a.lib.getAttr ["version"] "5.07" a; + buildInputs = with a; [ + flex + ]; +in +rec { + src = fetchurl { + url = "mirror://gnu/chess/gnuchess-${version}.tar.gz"; + sha256 = "0zh15m35fzbsrk1aann9pwlkv54dwb00snx99pk3xbg5bwkf125k"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be removed if not needed */ + phaseNames = ["doConfigure" "preBuild" "doMakeInstall"]; + + preBuild = a.FullDepEntry ('' + sed -i src/input.c -e 's/static pthread_t/pthread_t/' + sed -i "s@gnuchess@$out/bin/gnuchess@" -i src/gnuchessx + '') ["minInit" "doUnpack"]; + + name = "gnuchess-" + version; + meta = { + description = "GNU Chess playing program"; + }; +} diff --git a/pkgs/games/xboard/default.nix b/pkgs/games/xboard/default.nix new file mode 100644 index 000000000000..b4258c1c14b5 --- /dev/null +++ b/pkgs/games/xboard/default.nix @@ -0,0 +1,32 @@ +a : +let + fetchurl = a.fetchurl; + + version = a.lib.getAttr ["version"] "4.2.7" a; + buildInputs = with a; [ + libX11 xproto libXt libXaw libSM libICE libXmu + libXext gnuchess + ]; +in +rec { + src = fetchurl { + url = "http://ftp.gnu.org/gnu/xboard/xboard-${version}.tar.gz"; + sha256 = "0fwdzcav8shvzi7djphrlav29vwxnx63spzsldlhrglr7qpg28av"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be removed if not needed */ + phaseNames = ["doConfigure" "preBuild" "doMakeInstall"]; + + preBuild = a.FullDepEntry('' + sed -e '/FIRST_CHESS_PROGRAM/s@gnuchessx@${a.gnuchess}/bin/gnuchessx@' -i xboard.h + sed -e '/SECOND_CHESS_PROGRAM/s@gnuchessx@${a.gnuchess}/bin/gnuchessx@' -i xboard.h + '') ["doUnpack" "minInit"]; + + name = "xboard-" + version; + meta = { + description = "XBoard - a chess board compatible with GNU Chess"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cbd4fda153c0..a6758fcb8d57 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8430,6 +8430,10 @@ let inherit fetchurl stdenv SDL openal freealut zlib libpng python; }; + gnuchess = builderDefsPackage (import ../games/gnuchess) { + flex = flex2535; + }; + lincity = builderDefsPackage (import ../games/lincity) { inherit (xlibs) libX11 libXext xextproto libICE libSM xproto; @@ -8503,6 +8507,12 @@ let inherit fetchurl stdenv xlibs mesa; }; + xboard = builderDefsPackage (import ../games/xboard) { + inherit (xlibs) libX11 xproto libXt libXaw libSM + libICE libXmu libXext; + inherit gnuchess; + }; + xsokoban = builderDefsPackage (import ../games/xsokoban) { inherit (xlibs) libX11 xproto libXpm libXt; };