2013-05-14 21:56:20 +02:00
|
|
|
{ stdenv, fetchurl
|
2012-10-05 08:32:34 +02:00
|
|
|
, pkgconfig, mesa
|
|
|
|
, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod, unzip
|
2013-08-15 10:32:40 +02:00
|
|
|
|
2013-05-14 21:56:20 +02:00
|
|
|
, use3DOVideos ? false, requireFile ? null, writeText ? null
|
2013-08-15 09:34:40 +02:00
|
|
|
, haskellPackages ? null
|
2013-08-15 10:32:40 +02:00
|
|
|
|
|
|
|
, useRemixPacks ? false
|
2012-10-05 08:32:34 +02:00
|
|
|
}:
|
|
|
|
|
2013-05-14 21:56:20 +02:00
|
|
|
assert use3DOVideos -> requireFile != null && writeText != null
|
2013-08-15 09:34:40 +02:00
|
|
|
&& haskellPackages != null;
|
2013-05-14 21:56:20 +02:00
|
|
|
|
2013-08-15 10:32:40 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2013-05-14 21:56:20 +02:00
|
|
|
let
|
|
|
|
videos = import ./3dovideo.nix {
|
2013-08-15 09:34:40 +02:00
|
|
|
inherit stdenv requireFile writeText fetchurl haskellPackages;
|
2013-05-14 21:56:20 +02:00
|
|
|
};
|
2013-08-15 10:32:40 +02:00
|
|
|
|
|
|
|
remixPacks = imap (num: sha256: fetchurl rec {
|
|
|
|
name = "uqm-remix-disc${toString num}.uqm";
|
|
|
|
url = "mirror://sourceforge/sc2/${name}";
|
|
|
|
inherit sha256;
|
|
|
|
}) [
|
|
|
|
"1s470i6hm53l214f2rkrbp111q4jyvnxbzdziqg32ffr8m3nk5xn"
|
|
|
|
"1pmsq65k8gk4jcbyk3qjgi9yqlm0dlaimc2r8hz2fc9f2124gfvz"
|
|
|
|
"07g966ylvw9k5q9jdzqdczp7c5qv4s91xjlg4z5z27fgcs7rzn76"
|
|
|
|
"1l46k9aqlcp7d3fjkjb3n05cjfkxx8rjlypgqy0jmdx529vikj54"
|
|
|
|
];
|
|
|
|
|
2013-05-14 21:56:20 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2012-10-05 08:32:34 +02:00
|
|
|
name = "uqm-${version}";
|
|
|
|
version = "0.7.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2013-01-14 12:00:32 +01:00
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-source.tgz";
|
2013-08-15 09:42:34 +02:00
|
|
|
sha256 = "08dj7fsvflxx69an6vpf3wx050mk0ycmdv401yffrrqbgxgmqsd3";
|
2012-10-05 08:32:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
content = fetchurl {
|
2013-01-14 12:00:32 +01:00
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-content.uqm";
|
2013-08-15 09:42:34 +02:00
|
|
|
sha256 = "1gx39ns698hyczd4nx73mr0z86bbi4q3h8sw3pxjh1lzla5xpxmq";
|
2012-10-05 08:32:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
voice = fetchurl {
|
2013-01-14 12:00:32 +01:00
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-voice.uqm";
|
2013-08-15 09:42:34 +02:00
|
|
|
sha256 = "0yf9ff5sxk229202gsa7ski6wn7a8hkjjyr1yr7mjdxsnh0zik5w";
|
2012-10-05 08:32:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
music = fetchurl {
|
2013-01-14 12:00:32 +01:00
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-3domusic.uqm";
|
2013-08-15 09:42:34 +02:00
|
|
|
sha256 = "10nbvcrr0lc0mxivxfkcbxnibwk3vwmamabrlvwdsjxd9pk8aw65";
|
2012-10-05 08:32:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* 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
|
2013-08-15 10:37:21 +02:00
|
|
|
ln -s "$content" "uqm-${version}/content/packages/uqm-0.7.0-content.uqm"
|
|
|
|
ln -s "$music" "uqm-${version}/content/addons/uqm-0.7.0-3domusic.uqm"
|
|
|
|
ln -s "$voice" "uqm-${version}/content/addons/uqm-0.7.0-voice.uqm"
|
2013-08-15 10:32:40 +02:00
|
|
|
'' + optionalString useRemixPacks (concatMapStrings (disc: ''
|
2013-08-15 10:37:21 +02:00
|
|
|
ln -s "${disc}" "uqm-$version/content/addons/${disc.name}"
|
2013-08-15 10:32:40 +02:00
|
|
|
'') remixPacks) + optionalString use3DOVideos ''
|
2013-05-14 21:56:20 +02:00
|
|
|
ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
|
|
|
|
'';
|
2012-10-05 08:32:34 +02:00
|
|
|
|
|
|
|
/* 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
|
2013-05-14 21:56:20 +02:00
|
|
|
'';
|
2012-10-05 08:32:34 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
./build.sh uqm
|
2013-05-14 21:56:20 +02:00
|
|
|
'';
|
2012-10-05 08:32:34 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
./build.sh uqm install
|
|
|
|
sed -i $out/bin/uqm -e "s%/usr/local/games/%$out%g"
|
2013-05-14 21:56:20 +02:00
|
|
|
'';
|
2012-10-05 08:32:34 +02:00
|
|
|
|
|
|
|
meta = {
|
2012-10-05 18:36:36 +02:00
|
|
|
description = "Remake of Star Control II";
|
|
|
|
longDescription = ''
|
|
|
|
The goals for the The Ur-Quan Masters project are:
|
|
|
|
- to bring Star Control II to modern platforms, thereby making a lot of people happy
|
|
|
|
- to make game translations easy, thereby making even more people happy
|
|
|
|
- to adapt the code so that people can more easily make their own spin-offs, thereby making zillions more people happy!
|
|
|
|
'';
|
2012-10-05 08:32:34 +02:00
|
|
|
homepage = http://sc2.sourceforge.net/;
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2013-08-15 10:40:35 +02:00
|
|
|
maintainers = with maintainers; [ jcumming aszlig ];
|
2012-10-05 08:32:34 +02:00
|
|
|
};
|
|
|
|
}
|