3
0
Fork 0
forked from mirrors/nixpkgs

Adding Xconq turn-based strategy

svn path=/nixpkgs/trunk/; revision=27306
This commit is contained in:
Michael Raskin 2011-05-28 15:36:56 +00:00
parent e0a4f988a4
commit 9f3e6006e8
3 changed files with 76 additions and 1 deletions

View file

@ -26,6 +26,7 @@ let inherit (builtins) head tail trace; in
else if (hasSuffixHack ".zip" s) || (hasSuffixHack ".ZIP" s) then "zip"
else if (hasSuffixHack "-cvs-export" s) then "cvs-dir"
else if (hasSuffixHack ".nar.bz2" s) then "narbz2"
else if (hasSuffixHack ".rpm" s) then "rpm"
# Mostly for manually specified directories..
else if (hasSuffixHack "/" s) then "dir"
@ -234,7 +235,12 @@ let inherit (builtins) head tail trace; in
" else if (archiveType s) == "narbz2" then "
bzip2 <${s} | nix-store --restore \$PWD/\$(basename ${s} .nar.bz2)
cd \$(basename ${s} .nar.bz2)
" else if (archiveType s) == "plain-bz2" then "
" else if (archiveType s) == "rpm" then ''
rpm2cpio ${s} > ${s}.cpio
cpio -iv < ${s}.cpio
test -f *.tar.* && tar -xvf *.tar.*
test -d */ && cd */
'' else if (archiveType s) == "plain-bz2" then "
mkdir \$PWD/\$(basename ${s} .bz2)
NAME=\$(basename ${s} .bz2)
bzip2 -d <${s} > \$PWD/\$(basename ${s} .bz2)/\${NAME#*-}

View file

@ -0,0 +1,67 @@
x@{builderDefsPackage
, rpm, cpio, xproto, libX11, libXmu, libXaw, libXt, tcl, tk, libXext
, makeWrapper
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
buildInputs = map (n: builtins.getAttr n x)
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
sourceInfo = rec {
baseName="xconq";
version="7.5.0-0pre.0.20050612";
name="${baseName}-${version}";
extension="src.rpm";
project="${baseName}";
url="mirror://sourceforge/project/${project}/${baseName}/${name}/${baseName}-${version}.${extension}";
hash="0i41dz95af2pzmmjz0sc1n0wdxy7gjqlfcl503hw1xd5zza2lw2j";
};
in
rec {
src = a.fetchurl {
url = sourceInfo.url;
sha256 = sourceInfo.hash;
};
inherit (sourceInfo) name version;
inherit buildInputs;
/* doConfigure should be removed if not needed */
phaseNames = ["addInputs" "doUnpack" "fixMakefiles" "fixCfiles" "doConfigure"
"doMakeInstall" "doWrap"];
doWrap = a.makeManyWrappers ''$out/bin/*'' ''--prefix TCLLIBPATH : "${tk}/lib"'';
fixMakefiles = a.fullDepEntry ''
find . -name 'Makefile.in' -exec sed -re 's@^ ( *)(cd|[&][&])@ \1\2@' -i '{}' ';'
find . -name 'Makefile.in' -exec sed -e '/chown/d; /chgrp/d' -i '{}' ';'
sed -e '/^ * *[$][(]tcltkdir[)]\/[*][.][*]/d' -i tcltk/Makefile.in
'' ["minInit" "doUnpack"];
fixCfiles = a.fullDepEntry ''
sed -re 's@[(]int[)]color@(long)color@' -i tcltk/tkmap.c
'' ["minInit" "doUnpack"];
configureFlags = [
"--enable-alternate-scoresdir=scores"
"--with-tclconfig=${tcl}/lib"
"--with-tkconfig=${tk}/lib"
];
meta = {
description = "A programmable turn-based strategy game";
maintainers = with a.lib.maintainers;
[
raskin
];
platforms = with a.lib.platforms;
linux;
license = a.lib.licenses.gpl2;
};
passthru = {
};
}) x

View file

@ -7456,6 +7456,8 @@ let
inherit gnuchess texinfo;
};
xconq = callPackage ../games/xconq {};
xsokoban = builderDefsPackage (import ../games/xsokoban) {
inherit (xlibs) libX11 xproto libXpm libXt;
};