diff options
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/anki/default.nix | 2 | ||||
-rw-r--r-- | pkgs/games/dwarf-fortress/default.nix | 88 | ||||
-rw-r--r-- | pkgs/games/dwarf-therapist/default.nix | 60 | ||||
-rw-r--r-- | pkgs/games/gsb/default.nix | 74 | ||||
-rw-r--r-- | pkgs/games/sdlmame/default.nix | 44 | ||||
-rw-r--r-- | pkgs/games/spring/default.nix | 4 | ||||
-rw-r--r-- | pkgs/games/worldofgoo/default.nix | 1 |
7 files changed, 230 insertions, 43 deletions
diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index b904a6b5dcdb..7437e2e2262c 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -66,6 +66,6 @@ stdenv.mkDerivation rec { * even practicing guitar chords! ''; license = "GPLv3"; - platforms = stdenv.lib.platforms.all; + platforms = stdenv.lib.platforms.mesaPlatforms; }; } diff --git a/pkgs/games/dwarf-fortress/default.nix b/pkgs/games/dwarf-fortress/default.nix index 24c0b40edb3c..6e53aff65a57 100644 --- a/pkgs/games/dwarf-fortress/default.nix +++ b/pkgs/games/dwarf-fortress/default.nix @@ -1,13 +1,14 @@ -{stdenv, fetchurl, SDL, SDL_image, SDL_ttf, gtk, glib, mesa, openal, glibc, libsndfile}: +{ stdenv, fetchurl, SDL, SDL_image, SDL_ttf, gtk, glib, mesa, openal, glibc, libsndfile +, copyDataDirectory ? false }: assert stdenv.system == "i686-linux"; stdenv.mkDerivation rec { - name = "dwarf-fortress-0.31.25"; + name = "dwarf-fortress-0.34.11"; src = fetchurl { - url = "http://www.bay12games.com/dwarves/df_31_25_linux.tar.bz2"; - sha256 = "0d3klvf5n99j38pdhx9mak78px65aw47smck82jb92la97drmcg3"; + url = "http://www.bay12games.com/dwarves/df_34_11_linux.tar.bz2"; + sha256 = "1qk9vmdxzs0li81c8bglpj3m7aw9k71x1slf58hv2bz7hdndl3kj"; }; phases = "unpackPhase patchPhase installPhase"; @@ -22,10 +23,10 @@ stdenv.mkDerivation rec { mkdir -p $out/share/df_linux cp -r * $out/share/df_linux cp $permission $out/share/df_linux/nix_permission - + patchelf --set-interpreter ${glibc}/lib/ld-linux.so.2 $out/share/df_linux/libs/Dwarf_Fortress ln -s ${libsndfile}/lib/libsndfile.so $out/share/df_linux/libs/ - + cat > $out/bin/dwarf-fortress << EOF #!${stdenv.shell} export DF_DIR="\$HOME/.config/df_linux" @@ -33,39 +34,48 @@ stdenv.mkDerivation rec { then export DF_DIR="\$XDG_DATA_HOME/df_linux" fi - # Recreate a directory sturctor reflecting the original distribution in the user directory - - # Link in the static stuff - mkdir -p \$DF_DIR - ln -sf $out/share/df_linux/libs \$DF_DIR/ - ln -sf $out/share/df_linux/raw \$DF_DIR/ - ln -sf $out/share/df_linux/df \$DF_DIR/ - - # Delete old data directory - rm -rf \$DF_DIR/data - - # Link in the static data directory - mkdir \$DF_DIR/data - for i in $out/share/df_linux/data/* - do - ln -s \$i \$DF_DIR/data/ - done - - # index initial_movies, announcement, dipscript and help files are as of 0.31.16 opened in read/write mode instead of read-only mode - # this is a hack to work around this - # Should I just apply this to the whole data directory? - for i in index initial_movies announcement dipscript help - do - rm \$DF_DIR/data/\$i - cp -rf $out/share/df_linux/data/\$i \$DF_DIR/data/ - chmod -R u+w \$DF_DIR/data/\$i - done - - # link in persistant data - mkdir -p \$DF_DIR/save - ln -s \$DF_DIR/save \$DF_DIR/data/ - - # now run Dwarf Fortress! + # Recreate a directory structure reflecting the original + # distribution in the user directory (for modding support) + ${if copyDataDirectory then '' + if [ ! -d "\$DF_DIR" ]; + then + mkdir -p \$DF_DIR + cp -r $out/share/df_linux/* \$DF_DIR/ + chmod -R u+rw \$DF_DIR/ + fi + '' else '' + # Link in the static stuff + mkdir -p \$DF_DIR + ln -sf $out/share/df_linux/libs \$DF_DIR/ + ln -sf $out/share/df_linux/raw \$DF_DIR/ + ln -sf $out/share/df_linux/df \$DF_DIR/ + + # Delete old data directory + rm -rf \$DF_DIR/data + + # Link in the static data directory + mkdir \$DF_DIR/data + for i in $out/share/df_linux/data/* + do + ln -s \$i \$DF_DIR/data/ + done + + # index initial_movies, announcement, dipscript and help files are as of 0.31.16 opened in read/write mode instead of read-only mode + # this is a hack to work around this + # Should I just apply this to the whole data directory? + for i in index initial_movies announcement dipscript help + do + rm \$DF_DIR/data/\$i + cp -rf $out/share/df_linux/data/\$i \$DF_DIR/data/ + chmod -R u+w \$DF_DIR/data/\$i + done + + # link in persistant data + mkdir -p \$DF_DIR/save + ln -s \$DF_DIR/save \$DF_DIR/data/ + ''} + + # now run Dwarf Fortress! export LD_LIBRARY_PATH=\$DF_DIR/df_linux/libs/:${SDL}/lib:${SDL_image}/lib/:${SDL_ttf}/lib/:${gtk}/lib/:${glib}/lib/:${mesa}/lib/:${openal}/lib/ \$DF_DIR/df "\$@" EOF diff --git a/pkgs/games/dwarf-therapist/default.nix b/pkgs/games/dwarf-therapist/default.nix new file mode 100644 index 000000000000..8ac84a96aeb5 --- /dev/null +++ b/pkgs/games/dwarf-therapist/default.nix @@ -0,0 +1,60 @@ +{ stdenv, coreutils, fetchhg, qt4, dwarf_fortress, bash, makeWrapper }: + +stdenv.mkDerivation rec { + name = "dwarf-therapist-${rev}"; + rev = "eeeac8544d94"; + + src = fetchhg { + url = "https://code.google.com/r/splintermind-attributes/"; + tag = rev; + sha256 = "0a9m967q6p2q3plrl6qysg1xrdmg65jzil6awjh2wr3g10x2x15z"; + }; + + # Needed for hashing + dwarfBinary = "${dwarf_fortress}/share/df_linux/libs/Dwarf_Fortress"; + + buildInputs = [ coreutils qt4 dwarf_fortress makeWrapper ]; + enableParallelBuilding = false; + + preConfigure = '' + substituteInPlace dwarftherapist.pro \ + --replace /usr/bin $out/bin \ + --replace /usr/share $out/share \ + --replace "INSTALLS += doc" "" + ''; + + preBuild = '' + # Log to current directory, otherwise it crashes if log/ doesn't + # exist Note: Whis is broken because we cd to the nix store in the + # wrapper-script + substituteInPlace src/dwarftherapist.cpp \ + --replace "log/run.log" "dwarf-therapist.log" + ''; + + buildPhase = '' + qmake INSTALL_PREFIX=$out; + make; + ''; + + postInstall = '' + # DwarfTherapist assumes it's run in $out/share/dwarftherapist and + # therefore uses many relative paths. + rm $out/bin/dwarftherapist + wrapProgram $out/bin/DwarfTherapist \ + --run "cd $out/share/dwarftherapist" + ''; + + postFixup = '' + # Fix checksum of memory access directives + substituteInPlace $out/share/dwarftherapist/etc/memory_layouts/linux/v034.11.ini \ + --replace "e966ee88" $(md5sum ${dwarfBinary} | cut -c1-8) + ''; + + meta = { + description = "Tool to manage dwarves in in a running game of Dwarf Fortress"; + maintainers = with stdenv.lib.maintainers; [ the-kenny ]; + license = "MIT"; + platforms = stdenv.lib.platforms.linux; + homepage = https://code.google.com/r/splintermind-attributes/; + }; +} diff --git a/pkgs/games/gsb/default.nix b/pkgs/games/gsb/default.nix new file mode 100644 index 000000000000..52c3830c22a4 --- /dev/null +++ b/pkgs/games/gsb/default.nix @@ -0,0 +1,74 @@ +{ stdenv, config, requireFile +, curl3, SDL, SDL_image, libpng12, libjpeg62, libvorbis, libogg, openal, mesa +, libX11, libXext, libXft, fontconfig, zlib }: + +assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; + +stdenv.mkDerivation rec { + name = "gsb-1.56.0"; + + goBuyItNow = '' + We cannot download the full version automatically, as you require a license. + Once you bought a license, you need to add your downloaded version to the nix store. + You can do this by using "nix-prefetch-url file://gsb1324679796.tar.gz" in the + directory where you saved it. + ''; + + src = requireFile { + message = goBuyItNow; + name = "gsb1324679796.tar.gz"; + sha256 = "12jsz9v55w9zxwiz4kbm6phkv60q3c2kyv5imsls13385pzwcs8i"; + }; + + arch = if stdenv.system == "i686-linux" then "x86" else "x86_64"; + + phases = "unpackPhase installPhase"; + + # XXX: stdenv.lib.makeLibraryPath doesn't pick up /lib64 + libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.gcc stdenv.gcc.libc ] + + ":" + stdenv.lib.makeLibraryPath [ SDL SDL_image libjpeg62 libpng12 mesa ] + + ":" + stdenv.lib.makeLibraryPath [ curl3 openal libvorbis libogg ] + + ":" + stdenv.lib.makeLibraryPath [ libX11 libXext libXft fontconfig zlib ] + + ":" + stdenv.gcc.gcc + "/lib64"; + + installPhase = '' + ensureDir $out/libexec/positech/GSB/ + ensureDir $out/bin + + patchelf \ + --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-rpath $libPath \ + ./GSB.bin.$arch + + cp -r * $out/libexec/positech/GSB/ + rm -rf $out/libexec/positech/GSB/lib64/ + rm -rf $out/libexec/positech/GSB/lib/ + + #makeWrapper doesn't do cd. :( + + cat > $out/bin/GSB << EOF + #!/bin/sh + cd $out/libexec/positech/GSB + exec ./GSB.bin.$arch + EOF + chmod +x $out/bin/GSB + ''; + + meta = { + description = "Gratuitous Space Battles"; + longDescription = '' + a strategy / management / simulation game that does away with all the + base building and delays and gets straight to the meat and potatoes of + science-fiction games : The big space battles fought by huge spaceships with + tons of laser beams and things going 'zap!', 'ka-boom!' and 'ka-pow!'. In GSB + you put your ships together from modular components, arrange them into fleets, + give your ships orders of engagement and then hope they emerge victorious from + battle (or at least blow to bits in aesthetically pleasing ways). + ''; + homepage = http://www.positech.co.uk/gratuitousspacebattles/index.html; + license = [ "unfree" ]; + maintainers = with stdenv.lib.maintainers; [ jcumming ]; + platforms = [ "x86_64-linux" "i686-linux" ] ; + }; + +} diff --git a/pkgs/games/sdlmame/default.nix b/pkgs/games/sdlmame/default.nix new file mode 100644 index 000000000000..bd6e90111785 --- /dev/null +++ b/pkgs/games/sdlmame/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchurl, alsaLib, qt48, SDL, fontconfig, freetype, SDL_ttf, xlibs }: + +assert stdenv.system == "x86_64-linux" || stdenv.system == "1686-linux"; + +stdenv.mkDerivation rec { + version = "0.150.u0-1"; + name = "sdlmame-${version}"; + + src = if stdenv.system == "x86_64-linux" + then fetchurl { + url = "ftp://ftp.archlinux.org/community/os/x86_64/${name}-x86_64.pkg.tar.xz"; + sha256 = "0393xnzrzq53szmicn96lvapm66wmlykdxaa1n7smx8a0mcz0kah"; + } + else fetchurl { + url = "ftp://ftp.archlinux.org/community/os/i686/${name}-i686.pkg.tar.xz"; + sha256 = "0js67w2szd0qs7ycgxb3bbmcdziv1fywyd9ihra2f6bq5rhcs2jp"; + }; + + buildPhase = '' + sed -i "s|/usr|$out|" bin/sdlmame + ''; + + installPhase = '' + patchelf \ + --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-rpath "${alsaLib}/lib:${qt48}/lib:${SDL}/lib:${fontconfig}/lib:${freetype}/lib:${SDL_ttf}/lib:${xlibs.libX11}/lib:${xlibs.libXinerama}/lib:${stdenv.gcc.gcc}/lib" \ + share/sdlmame/sdlmame + + mkdir -p "$out/bin" + cp -r bin/sdlmame "$out/bin" + cp -r share "$out" + ''; + + dontPatchELF = true; + dontStrip = true; + + meta = with stdenv.lib; { + homepage = http://sdlmame.lngn.net; + description = "A port of the popular Multiple Arcade Machine Emulator using SDL with OpenGL support."; + license = "MAME"; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/games/spring/default.nix b/pkgs/games/spring/default.nix index ba45360ccb6d..109cb239d2be 100644 --- a/pkgs/games/spring/default.nix +++ b/pkgs/games/spring/default.nix @@ -27,9 +27,9 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { homepage = http://springrts.com/; - description = "A powerful real-time strategy(RTS) game engine"; + description = "A powerful real-time strategy (RTS) game engine"; license = licenses.gpl2; maintainers = [ maintainers.phreedom maintainers.qknight ]; - platforms = platforms.unix; + platforms = platforms.mesaPlatforms; }; } diff --git a/pkgs/games/worldofgoo/default.nix b/pkgs/games/worldofgoo/default.nix index 216ec0d8041a..13e7e487c8f0 100644 --- a/pkgs/games/worldofgoo/default.nix +++ b/pkgs/games/worldofgoo/default.nix @@ -77,7 +77,6 @@ stdenv.mkDerivation rec { homepage = http://worldofgoo.com; license = [ "unfree" ]; maintainers = with stdenv.lib.maintainers; [ jcumming ]; - platforms = [ "x86_64-linux"] ; }; } |