2021-01-15 04:31:39 +00:00
|
|
|
{ lib, stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr
|
2019-02-26 11:45:54 +00:00
|
|
|
, libXrender, fontconfig, freetype, openal, runtimeShell }:
|
2012-09-19 18:56:56 +01:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
let inherit (lib) makeLibraryPath; in
|
2015-10-05 11:23:02 +01:00
|
|
|
|
2012-01-29 22:44:49 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "oilrush";
|
2019-02-26 11:45:54 +00:00
|
|
|
src =
|
2012-01-29 22:44:49 +00:00
|
|
|
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;
|
2018-08-20 20:11:29 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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 21:56:43 +01: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"
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
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
|
2019-02-26 11:45:54 +00:00
|
|
|
of Tower Defense.
|
2012-01-29 22:44:49 +00:00
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://oilrush-game.com/";
|
2021-01-15 04:31:39 +00:00
|
|
|
license = lib.licenses.unfree;
|
|
|
|
#maintainers = with lib.maintainers; [ astsmtl ];
|
|
|
|
platforms = lib.platforms.linux;
|
2013-11-04 23:04:36 +00:00
|
|
|
hydraPlatforms = [];
|
2012-01-29 22:44:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|