diff options
author | Jack Cummings <jack@mudshark.org> | 2012-10-04 23:32:34 -0700 |
---|---|---|
committer | Jack Cummings <jack@mudshark.org> | 2012-10-04 23:32:34 -0700 |
commit | 22ece175a061e4b1323869007c550bfa02a7972a (patch) | |
tree | 30931d571faf5203900cbd76a638a23ae2b127f5 /pkgs/games/uqm | |
parent | bc9bff1da42f35afc982e66dd60b7c66263b32c4 (diff) |
- openttd 1.2.2, rili 2.0.1, widelands-build17, uqm-0.7.0
Diffstat (limited to 'pkgs/games/uqm')
-rw-r--r-- | pkgs/games/uqm/default.nix | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix new file mode 100644 index 0000000000000..3be95849e32f0 --- /dev/null +++ b/pkgs/games/uqm/default.nix @@ -0,0 +1,71 @@ +{stdenv, fetchurl +, pkgconfig, mesa +, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod, unzip +}: + +stdenv.mkDerivation rec { + name = "uqm-${version}"; + version = "0.7.0"; + + src = fetchurl { + url = "mirror://sf/sc2/uqm-${version}-source.tgz"; + sha256 = "a3695c5f7f0be7ec9c0f80ec569907b382023a1fee6e635532bd53b7b53bb221"; + }; + + content = fetchurl { + url = "mirror://sf/sc2/uqm-${version}-content.uqm"; + sha256 = "b8f6db8ba29f0628fb1d5c233830896b19f441aee3744bda671ea264b44da3bf"; + }; + + voice = fetchurl { + url = "mirror://sf/sc2/uqm-${version}-voice.uqm"; + sha256 = "bcccf801b4ba37594ff6217b292744ea586ee2d447e927804842ccae8b73c979"; + }; + + music = fetchurl { + url = "mirror://sf/sc2/uqm-${version}-3domusic.uqm"; + sha256 = "c57085e64dad4bddf8a679a9aa2adf63f2156d5f6cbabe63af80519033dbcb82"; + }; + + + /* uses pthread_cancel(), which requires libgcc_s.so.1 to be + loadable at run-time. Adding the flag below ensures that the + library can be found. Obviously, though, this is a hack. */ + NIX_LDFLAGS="-lgcc_s"; + + buildInputs = [SDL SDL_image libpng libvorbis libogg libmikmod unzip pkgconfig mesa]; + + postUnpack = '' + mkdir -p uqm-${version}/content/packages + mkdir -p uqm-${version}/content/addons + cp $content uqm-${version}/content/packages/uqm-0.7.0-content.uqm + cp $music uqm-${version}/content/addons/uqm-0.7.0-3domusic.uqm + cp $voice uqm-${version}/content/addons/uqm-0.7.0-voice.uqm + ''; + + /* uqm has a 'unique' build system with a root script incidentally called + * 'build.sh'. */ + + configurePhase = '' + echo "INPUT_install_prefix_VALUE='$out'" >> config.state + echo "INPUT_install_bindir_VALUE='$out/bin'" >> config.state + echo "INPUT_install_libdir_VALUE='$out/lib'" >> config.state + echo "INPUT_install_sharedir_VALUE='$out/share'" >> config.state + PREFIX=$out ./build.sh uqm config + ''; + + buildPhase = '' + ./build.sh uqm + ''; + + installPhase = '' + ./build.sh uqm install + sed -i $out/bin/uqm -e "s%/usr/local/games/%$out%g" + ''; + + meta = { + description = ''Urquan Masters is an open source clone of the Classic top-down space battle Star Cotnrol ''; + homepage = http://sc2.sourceforge.net/; + license = "GPLv2"; + }; +} |