Author: raskin
Date: Sun Dec 26 13:14:15 2010
New Revision: 25278
URL: https://svn.nixos.org/websvn/nix/?rev=25278&sc=1

Log:
Adding sauerbraten

Added:
   nixpkgs/trunk/pkgs/games/sauerbraten/
   nixpkgs/trunk/pkgs/games/sauerbraten/default.nix
Modified:
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Added: nixpkgs/trunk/pkgs/games/sauerbraten/default.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/games/sauerbraten/default.nix    Sun Dec 26 13:14:15 
2010        (r25278)
@@ -0,0 +1,77 @@
+...@{builderdefspackage
+  , fetchsvn, mesa, SDL, SDL_image, SDL_mixer
+  , libpng, zlib, libjpeg, imagemagick, libX11
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    ["fetchsvn"];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="sauerbraten";
+    version="3331";
+    name="${baseName}-r${version}";
+    url="https://sauerbraten.svn.sourceforge.net/svnroot/sauerbraten";;
+    hash="0904hk9rz2x941c9587bfxa4rca81260j3m2hjjrp984w67x2w7y";
+  };
+in
+rec {
+  srcDrv = a.fetchsvn {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+    rev = sourceInfo.version;
+  };
+
+  src = srcDrv + "/";
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  phaseNames = ["setVars" "doMakeInstall" "doCreateScripts"];
+
+  setVars = a.noDepEntry ''
+    export NIX_LDFLAGS="$NIX_LDFLAGS -lX11"
+  '';
+
+  doUnpack = a.fullDepEntry ''
+    ensureDir $out/share/sauerbraten/build-dir
+    ln -s  $out/share/sauerbraten/build-dir
+    cd $out/share/sauerbraten/build-dir
+    (cd ${src}; find . -type d) | tail -n +2 | xargs -L 1 mkdir
+    (cd ${src}; find . -type f) | while read; do ln -s ${src}/"$REPLY" 
"$(dirname "$REPLY")"; done
+    cd src
+    ls
+    make clean
+    sed -e '/[.]h[.]gch/,/-o/s...@-o@-x c++-header -o@' -i Makefile
+  '' ["minInit" "addInputs" "defEnsureDir"];
+
+  doCreateScripts = a.fullDepEntry ''
+    cd ..
+    ensureDir $out/bin
+    echo '#! /bin/sh' >> $out/bin/sauerbraten_server
+    echo 'cd "'"$out"'/share/sauerbraten/build-dir"' >> 
$out/bin/sauerbraten_server
+    echo './bin_unix/native_server "$@"' >> $out/bin/sauerbraten_server
+    echo '#! /bin/sh' >> $out/bin/sauerbraten_client
+    echo 'cd "'"$out"'/share/sauerbraten/build-dir"' >> 
$out/bin/sauerbraten_client
+    echo './bin_unix/native_client "$@"' >> $out/bin/sauerbraten_client
+    chmod a+x $out/bin/sauerbraten_*
+  '' ["minInit" "defEnsureDir"];
+      
+  meta = {
+    description = "";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      # raskin: tested amd64-linux;
+      # not setting platforms because it is 0.5+ GiB of game data
+      [];
+    license = "freeware"; # as an aggregate - data files have different 
licenses
+                          # code is under zlib license
+  };
+}) x
+

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix       Sat Dec 25 18:06:36 
2010        (r25277)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix       Sun Dec 26 13:14:15 
2010        (r25278)
@@ -6784,6 +6784,8 @@
 
   rogue = callPackage ../games/rogue { };
 
+  sauerbraten = callPackage ../games/sauerbraten {};
+
   scummvm = callPackage ../games/scummvm { };
 
   scorched3d = callPackage ../games/scorched3d {
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to