nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 77 lines 3.1 kB view raw
1{ lib, stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr 2, libXrender, fontconfig, freetype, openal, runtimeShell }: 3 4let inherit (lib) makeLibraryPath; in 5 6stdenv.mkDerivation { 7 name = "oilrush"; 8 src = 9 let 10 url = config.oilrush.url or null; 11 sha256 = config.oilrush.sha256 or null; 12 in 13 assert url != null && sha256 != null; 14 fetchurl { inherit url sha256; }; 15 shell = stdenv.shell; 16 arch = if stdenv.hostPlatform.system == "x86_64-linux" then "x64" 17 else lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "x86"; 18 unpackPhase = '' 19 mkdir oilrush 20 cd oilrush 21 "$shell" "$src" --tar xf 22 ''; 23 patchPhase = '' 24 cd bin 25 for f in launcher_$arch libQtCoreUnigine_$arch.so.4 OilRush_$arch 26 do 27 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f 28 done 29 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXrender fontconfig freetype ]}\ 30 launcher_$arch 31 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib\ 32 libNetwork_$arch.so 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\ 44 libRakNet_$arch.so 45 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\ 46 libUnigine_$arch.so 47 patchelf --set-rpath ${stdenv.cc.cc.lib}/lib64:${makeLibraryPath [ stdenv.cc.cc libX11 libXext libXinerama libXrandr ]}\ 48 OilRush_$arch 49 ''; 50 installPhase = '' 51 cd .. 52 mkdir -p "$out/opt/oilrush" 53 cp -r * "$out/opt/oilrush" 54 mkdir -p "$out/bin" 55 cat << EOF > "$out/bin/oilrush" 56 #!${runtimeShell} 57 LD_LIBRARY_PATH=.:${makeLibraryPath [ openal ]}:\$LD_LIBRARY_PATH 58 cd "$out/opt/oilrush" 59 exec ./launcher_$arch.sh "\$@" 60 EOF 61 chmod +x "$out/bin/oilrush" 62 ''; 63 meta = { 64 description = "A naval strategy game"; 65 longDescription = '' 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 68 of Tower Defense. 69 ''; 70 homepage = "http://oilrush-game.com/"; 71 license = lib.licenses.unfree; 72 #maintainers = with lib.maintainers; [ astsmtl ]; 73 platforms = lib.platforms.linux; 74 hydraPlatforms = []; 75 }; 76 77}