nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 138 lines 3.5 kB view raw
1{ 2 lib, 3 stdenv, 4 config, 5 fetchurl, 6 libX11, 7 libXext, 8 libXinerama, 9 libXrandr, 10 libXrender, 11 fontconfig, 12 freetype, 13 openal, 14 runtimeShell, 15}: 16 17let 18 inherit (lib) makeLibraryPath; 19in 20 21stdenv.mkDerivation { 22 name = "oilrush"; 23 src = 24 let 25 url = config.oilrush.url or null; 26 sha256 = config.oilrush.sha256 or null; 27 in 28 assert url != null && sha256 != null; 29 fetchurl { inherit url sha256; }; 30 shell = stdenv.shell; 31 arch = 32 if stdenv.hostPlatform.system == "x86_64-linux" then 33 "x64" 34 else 35 lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "x86"; 36 unpackPhase = '' 37 mkdir oilrush 38 cd oilrush 39 "$shell" "$src" --tar xf 40 ''; 41 patchPhase = '' 42 cd bin 43 for f in launcher_$arch libQtCoreUnigine_$arch.so.4 OilRush_$arch 44 do 45 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f 46 done 47 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${ 48 makeLibraryPath [ 49 stdenv.cc.cc 50 libX11 51 libXext 52 libXrender 53 fontconfig 54 freetype 55 ] 56 }\ 57 launcher_$arch 58 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${lib.getLib stdenv.cc.cc}/lib\ 59 libNetwork_$arch.so 60 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${lib.getLib stdenv.cc.cc}/lib\ 61 libQtCoreUnigine_$arch.so.4 62 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${ 63 makeLibraryPath [ 64 stdenv.cc.cc 65 libX11 66 libXext 67 libXrender 68 fontconfig 69 freetype 70 ] 71 }\ 72 libQtGuiUnigine_$arch.so.4 73 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${lib.getLib stdenv.cc.cc}/lib\ 74 libQtNetworkUnigine_$arch.so.4 75 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${ 76 makeLibraryPath [ 77 stdenv.cc.cc 78 libX11 79 libXext 80 libXrender 81 fontconfig 82 freetype 83 ] 84 }\ 85 libQtWebKitUnigine_$arch.so.4 86 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${lib.getLib stdenv.cc.cc}/lib\ 87 libQtXmlUnigine_$arch.so.4 88 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${lib.getLib stdenv.cc.cc}/lib\ 89 libRakNet_$arch.so 90 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${ 91 makeLibraryPath [ 92 stdenv.cc.cc 93 libX11 94 libXext 95 libXinerama 96 libXrandr 97 ] 98 }\ 99 libUnigine_$arch.so 100 patchelf --set-rpath ${lib.getLib stdenv.cc.cc}/lib64:${ 101 makeLibraryPath [ 102 stdenv.cc.cc 103 libX11 104 libXext 105 libXinerama 106 libXrandr 107 ] 108 }\ 109 OilRush_$arch 110 ''; 111 installPhase = '' 112 cd .. 113 mkdir -p "$out/opt/oilrush" 114 cp -r * "$out/opt/oilrush" 115 mkdir -p "$out/bin" 116 cat << EOF > "$out/bin/oilrush" 117 #!${runtimeShell} 118 LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH 119 cd "$out/opt/oilrush" 120 exec ./launcher_$arch.sh "\$@" 121 EOF 122 chmod +x "$out/bin/oilrush" 123 ''; 124 meta = { 125 description = "Naval strategy game"; 126 longDescription = '' 127 Oil Rush is a real-time naval strategy game based on group control. It 128 combines the strategic challenge of a classical RTS with the sheer fun 129 of Tower Defense. 130 ''; 131 homepage = "http://oilrush-game.com/"; 132 license = lib.licenses.unfree; 133 platforms = lib.platforms.linux; 134 hydraPlatforms = [ ]; 135 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; 136 }; 137 138}