2018-02-24 13:12:44 +00:00
|
|
|
{ stdenv, lib, fetchurl, pkgconfig, libGLU_combined
|
2017-11-07 21:42:54 +00:00
|
|
|
, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod
|
2015-05-07 06:56:03 +01:00
|
|
|
|
|
|
|
, use3DOVideos ? false, requireFile ? null, writeText ? null
|
|
|
|
, haskellPackages ? null
|
|
|
|
|
|
|
|
, useRemixPacks ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert use3DOVideos -> requireFile != null && writeText != null
|
|
|
|
&& haskellPackages != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
videos = import ./3dovideo.nix {
|
|
|
|
inherit stdenv requireFile writeText fetchurl haskellPackages;
|
|
|
|
};
|
|
|
|
|
2017-11-07 21:42:54 +00:00
|
|
|
remixPacks = lib.imap1 (num: sha256: fetchurl rec {
|
2015-05-07 06:56:03 +01:00
|
|
|
name = "uqm-remix-disc${toString num}.uqm";
|
|
|
|
url = "mirror://sourceforge/sc2/${name}";
|
|
|
|
inherit sha256;
|
|
|
|
}) [
|
|
|
|
"1s470i6hm53l214f2rkrbp111q4jyvnxbzdziqg32ffr8m3nk5xn"
|
|
|
|
"1pmsq65k8gk4jcbyk3qjgi9yqlm0dlaimc2r8hz2fc9f2124gfvz"
|
|
|
|
"07g966ylvw9k5q9jdzqdczp7c5qv4s91xjlg4z5z27fgcs7rzn76"
|
|
|
|
"1l46k9aqlcp7d3fjkjb3n05cjfkxx8rjlypgqy0jmdx529vikj54"
|
|
|
|
];
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "uqm-${version}";
|
|
|
|
version = "0.7.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-source.tgz";
|
|
|
|
sha256 = "08dj7fsvflxx69an6vpf3wx050mk0ycmdv401yffrrqbgxgmqsd3";
|
|
|
|
};
|
|
|
|
|
|
|
|
content = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-content.uqm";
|
|
|
|
sha256 = "1gx39ns698hyczd4nx73mr0z86bbi4q3h8sw3pxjh1lzla5xpxmq";
|
|
|
|
};
|
|
|
|
|
|
|
|
voice = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-voice.uqm";
|
|
|
|
sha256 = "0yf9ff5sxk229202gsa7ski6wn7a8hkjjyr1yr7mjdxsnh0zik5w";
|
|
|
|
};
|
|
|
|
|
|
|
|
music = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sc2/uqm-${version}-3domusic.uqm";
|
|
|
|
sha256 = "10nbvcrr0lc0mxivxfkcbxnibwk3vwmamabrlvwdsjxd9pk8aw65";
|
|
|
|
};
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-02-24 13:12:44 +00:00
|
|
|
buildInputs = [ SDL SDL_image libpng libvorbis libogg libmikmod libGLU_combined ];
|
2015-05-07 06:56:03 +01:00
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
mkdir -p uqm-${version}/content/packages
|
|
|
|
mkdir -p uqm-${version}/content/addons
|
|
|
|
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"
|
2017-11-07 21:42:54 +00:00
|
|
|
'' + lib.optionalString useRemixPacks (lib.concatMapStrings (disc: ''
|
2015-05-07 06:56:03 +01:00
|
|
|
ln -s "${disc}" "uqm-$version/content/addons/${disc.name}"
|
2017-11-07 21:42:54 +00:00
|
|
|
'') remixPacks) + lib.optionalString use3DOVideos ''
|
2015-05-07 06:56:03 +01:00
|
|
|
ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
|
|
|
|
'';
|
|
|
|
|
2017-11-08 05:33:21 +00:00
|
|
|
# Using _STRINGS_H as include guard conflicts with glibc.
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '/^#/s/_STRINGS_H/_UQM_STRINGS_H/g' src/uqm/comm/*/strings.h
|
|
|
|
'';
|
|
|
|
|
2017-11-07 21:42:54 +00:00
|
|
|
# uqm has a 'unique' build system with a root script incidentally called
|
|
|
|
# 'build.sh'.
|
2015-05-07 06:56:03 +01:00
|
|
|
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 = "Remake of Star Control II";
|
|
|
|
longDescription = ''
|
2017-11-07 21:42:54 +00:00
|
|
|
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!
|
2015-05-07 06:56:03 +01:00
|
|
|
'';
|
|
|
|
homepage = http://sc2.sourceforge.net/;
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2017-11-07 21:42:54 +00:00
|
|
|
maintainers = with lib.maintainers; [ jcumming aszlig ];
|
|
|
|
platforms = with lib.platforms; linux;
|
2015-05-07 06:56:03 +01:00
|
|
|
};
|
|
|
|
}
|