Author: raskin
Date: Sat May 28 15:36:56 2011
New Revision: 27306
URL: https://svn.nixos.org/websvn/nix/?rev=27306&sc=1

Log:
Adding Xconq turn-based strategy

Added:
   nixpkgs/trunk/pkgs/games/xconq/
   nixpkgs/trunk/pkgs/games/xconq/default.nix
Modified:
   nixpkgs/trunk/pkgs/build-support/builder-defs/builder-defs.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/build-support/builder-defs/builder-defs.nix
==============================================================================
--- nixpkgs/trunk/pkgs/build-support/builder-defs/builder-defs.nix      Fri May 
27 05:39:44 2011        (r27305)
+++ nixpkgs/trunk/pkgs/build-support/builder-defs/builder-defs.nix      Sat May 
28 15:36:56 2011        (r27306)
@@ -26,6 +26,7 @@
                 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 @@
         " 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#*-}

Added: nixpkgs/trunk/pkgs/games/xconq/default.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/games/xconq/default.nix  Sat May 28 15:36:56 2011        
(r27306)
@@ -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
+

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix       Fri May 27 05:39:44 
2011        (r27305)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix       Sat May 28 15:36:56 
2011        (r27306)
@@ -7456,6 +7456,8 @@
     inherit gnuchess texinfo;
   };
 
+  xconq = callPackage ../games/xconq {};
+
   xsokoban = builderDefsPackage (import ../games/xsokoban) {
     inherit (xlibs) libX11 xproto libXpm libXt;
   };
_______________________________________________
nix-commits mailing list
nix-comm...@cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to