2012-09-19 17:56:56 +00:00
|
|
|
{ stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr
|
2012-01-29 22:44:49 +00:00
|
|
|
, libXrender, fontconfig, freetype, openal }:
|
2012-09-19 17:56:56 +00:00
|
|
|
|
2017-02-09 01:52:13 +00:00
|
|
|
let inherit (stdenv.lib) makeLibraryPath; in
|
2015-10-05 10:23:02 +00:00
|
|
|
|
2012-01-29 22:44:49 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "oilrush";
|
|
|
|
src =
|
|
|
|
let
|
2012-09-19 17:56:56 +00: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;
|
2018-08-20 19:11:29 +00:00
|
|
|
arch = if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "x86"
|
2012-01-29 22:44:49 +00:00
|
|
|
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
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
launcher_$arch
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libNetwork_$arch.so
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtCoreUnigine_$arch.so.4
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtGuiUnigine_$arch.so.4
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtNetworkUnigine_$arch.so.4
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtWebKitUnigine_$arch.so.4
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libQtXmlUnigine_$arch.so.4
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 22:44:49 +00:00
|
|
|
libRakNet_$arch.so
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
|
2012-01-29 22:44:49 +00:00
|
|
|
libUnigine_$arch.so
|
2016-04-30 20:56:43 +00:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/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 10:23:02 +00: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 04:19:00 +00: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
|
|
|
};
|
|
|
|
|
|
|
|
}
|