2012-09-19 19:56:56 +02:00
|
|
|
{ stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr
|
2019-02-26 12:45:54 +01:00
|
|
|
, libXrender, fontconfig, freetype, openal, runtimeShell }:
|
2012-09-19 19:56:56 +02:00
|
|
|
|
2017-02-09 02:52:13 +01:00
|
|
|
let inherit (stdenv.lib) makeLibraryPath; in
|
2015-10-05 12:23:02 +02:00
|
|
|
|
2012-01-29 23:44:49 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "oilrush";
|
2019-02-26 12:45:54 +01:00
|
|
|
src =
|
2012-01-29 23:44:49 +01:00
|
|
|
let
|
2012-09-19 19:56:56 +02:00
|
|
|
url = config.oilrush.url or null;
|
|
|
|
sha256 = config.oilrush.sha256 or null;
|
2012-01-29 23:44:49 +01:00
|
|
|
in
|
|
|
|
assert url != null && sha256 != null;
|
|
|
|
fetchurl { inherit url sha256; };
|
|
|
|
shell = stdenv.shell;
|
2018-08-20 21:11:29 +02:00
|
|
|
arch = if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "x86"
|
2012-01-29 23:44:49 +01: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 19:11:30 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f
|
2012-01-29 23:44:49 +01:00
|
|
|
done
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 23:44:49 +01:00
|
|
|
launcher_$arch
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 23:44:49 +01:00
|
|
|
libNetwork_$arch.so
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 23:44:49 +01:00
|
|
|
libQtCoreUnigine_$arch.so.4
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 23:44:49 +01:00
|
|
|
libQtGuiUnigine_$arch.so.4
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 23:44:49 +01:00
|
|
|
libQtNetworkUnigine_$arch.so.4
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
|
2012-01-29 23:44:49 +01:00
|
|
|
libQtWebKitUnigine_$arch.so.4
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 23:44:49 +01:00
|
|
|
libQtXmlUnigine_$arch.so.4
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
|
2012-01-29 23:44:49 +01:00
|
|
|
libRakNet_$arch.so
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
|
2012-01-29 23:44:49 +01:00
|
|
|
libUnigine_$arch.so
|
2016-04-30 22:56:43 +02:00
|
|
|
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
|
2012-01-29 23:44:49 +01:00
|
|
|
OilRush_$arch
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
cd ..
|
|
|
|
mkdir -p "$out/opt/oilrush"
|
|
|
|
cp -r * "$out/opt/oilrush"
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cat << EOF > "$out/bin/oilrush"
|
2019-02-26 12:45:54 +01:00
|
|
|
#!${runtimeShell}
|
2015-10-05 12:23:02 +02:00
|
|
|
LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH
|
2012-01-29 23:44:49 +01: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
|
2019-02-26 12:45:54 +01:00
|
|
|
of Tower Defense.
|
2012-01-29 23:44:49 +01:00
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://oilrush-game.com/";
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2012-01-29 23:44:49 +01:00
|
|
|
#maintainers = with stdenv.lib.maintainers; [ astsmtl ];
|
2013-11-05 00:04:36 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
hydraPlatforms = [];
|
2012-01-29 23:44:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|