1 { lib, stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr
2 , libXrender, fontconfig, freetype, openal, runtimeShell }:
4 let inherit (lib) makeLibraryPath; in
10 url = config.oilrush.url or null;
11 sha256 = config.oilrush.sha256 or null;
13 assert url != null && sha256 != null;
14 fetchurl { inherit url sha256; };
16 arch = if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
17 else lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "x86";
21 "$shell" "$src" --tar xf
25 for f in launcher_$arch libQtCoreUnigine_$arch.so.4 OilRush_$arch
27 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f
29 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
31 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
33 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
34 libQtCoreUnigine_$arch.so.4
35 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
36 libQtGuiUnigine_$arch.so.4
37 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
38 libQtNetworkUnigine_$arch.so.4
39 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\
40 libQtWebKitUnigine_$arch.so.4
41 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
42 libQtXmlUnigine_$arch.so.4
43 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\
45 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
47 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\
52 mkdir -p "$out/opt/oilrush"
53 cp -r * "$out/opt/oilrush"
55 cat << EOF > "$out/bin/oilrush"
57 LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH
59 exec ./launcher_$arch.sh "\$@"
61 chmod +x "$out/bin/oilrush"
64 description = "A naval strategy game";
66 Oil Rush is a real-time naval strategy game based on group control. It
67 combines the strategic challenge of a classical RTS with the sheer fun
70 homepage = "http://oilrush-game.com/";
71 license = lib.licenses.unfree;
72 #maintainers = with lib.maintainers; [ astsmtl ];
73 platforms = lib.platforms.linux;