2012-09-19 18:56:56 +01:00
|
|
|
{ stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr
|
2012-01-29 22:44:49 +00:00
|
|
|
, libXrender, fontconfig, freetype, openal }:
|
2012-09-19 18:56:56 +01:00
|
|
|
|
2015-10-05 11:23:02 +01:00
|
|
|
with { inherit (stdenv.lib) makeLibraryPath; };
|
|
|
|
|
2012-01-29 22:44:49 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "oilrush";
|
|
|
|
src =
|
|
|
|
let
|
2012-09-19 18:56:56 +01:00
|
|
|
url = config.oilrush.url or null;
|
|
|
|
sha256 = config.oilrush.sha256 or null;
|
2012-01-29 22:44:49 +00:00
|
|
|
in
|
|
|
|
assert url != null && sha256 != null;
|
|
|
|
fetchurl { inherit url sha256; };
|
|
|
|
shell = stdenv.shell;
|
|
|
|
arch = if stdenv.system == "x86_64-linux" then "x64"
|
|
|
|
else if stdenv.system == "i686-linux" then "x86"
|
|
|
|
else "";
|
|
|
|
unpackPhase = ''
|
|
|
|
mkdir oilrush
|
|
|
|
cd oilrush
|
|
|
|
"$shell" "$src" --tar xf
|
|
|
|
'';
|
|
|
|
patchPhase = ''
|
|
|
|
cd bin
|
|
|
|
for f in launcher_$arch libQtCoreUnigine_$arch.so.4 OilRush_$arch
|
|
|
|
do
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f
|
2012-01-29 22:44:49 +00:00
|
|
|
done
|
2015-10-05 11:23:02 +01:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
launcher_$arch
|
2015-01-15 04:25:26 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libNetwork_$arch.so
|
2015-01-15 04:25:26 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtCoreUnigine_$arch.so.4
|
2015-10-05 11:23:02 +01:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtGuiUnigine_$arch.so.4
|
2015-01-15 04:25:26 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtNetworkUnigine_$arch.so.4
|
2015-10-05 11:23:02 +01:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtWebKitUnigine_$arch.so.4
|
2015-01-15 04:25:26 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtXmlUnigine_$arch.so.4
|
2015-01-15 04:25:26 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libRakNet_$arch.so
|
2015-10-05 11:23:02 +01:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
libUnigine_$arch.so
|
2015-10-05 11:23:02 +01:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
OilRush_$arch
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
cd ..
|
|
|
|
mkdir -p "$out/opt/oilrush"
|
|
|
|
cp -r * "$out/opt/oilrush"
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cat << EOF > "$out/bin/oilrush"
|
|
|
|
#! /bin/sh
|
2015-10-05 11:23:02 +01:00
|
|
|
LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH
|
2012-01-29 22:44:49 +00:00
|
|
|
cd "$out/opt/oilrush"
|
|
|
|
exec ./launcher_$arch.sh "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x "$out/bin/oilrush"
|
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
description = "A naval strategy game";
|
|
|
|
longDescription = ''
|
|
|
|
Oil Rush is a real-time naval strategy game based on group control. It
|
|
|
|
combines the strategic challenge of a classical RTS with the sheer fun
|
|
|
|
of Tower Defense.
|
|
|
|
'';
|
|
|
|
homepage = http://oilrush-game.com/;
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2012-01-29 22:44:49 +00:00
|
|
|
#maintainers = with stdenv.lib.maintainers; [ astsmtl ];
|
2013-11-04 23:04:36 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
hydraPlatforms = [];
|
2012-01-29 22:44:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|