5 # Build-time dependencies
12 # Runtime dependencies
28 if stdenv.hostPlatform.system == "x86_64-linux" then
30 else if stdenv.hostPlatform.system == "i686-linux" then
33 throw "Unsupported platform ${stdenv.hostPlatform.system}";
36 stdenv.mkDerivation rec {
37 pname = "unigine-valley";
41 url = "https://assets.unigine.com/d/Unigine_Valley-${version}.run";
42 sha256 = "sha256-XwyL0kMRGFURgrq79fHCD7FOekB4lpckDcr1RkQ2YPQ=";
45 sourceRoot = "Unigine_Valley-${version}";
46 instPath = "lib/unigine/valley";
48 nativeBuildInputs = [ file makeWrapper imagemagick copyDesktopItems ];
50 libPath = lib.makeLibraryPath [
51 stdenv.cc.cc # libstdc++.so.6
67 chmod +x extractor.run
68 ./extractor.run --target $sourceRoot
75 elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1)
77 patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true
84 instdir=$out/${instPath}
85 mkdir -p $out/share/icons/hicolor $out/share/applications $out/bin $instdir/bin
87 # Install executables and libraries
88 install -m 0755 bin/browser_${arch} $instdir/bin
89 install -m 0755 bin/libApp{Stereo,Surround,Wall}_${arch}.so $instdir/bin
90 install -m 0755 bin/libGPUMonitor_${arch}.so $instdir/bin
91 install -m 0755 bin/libQt{Core,Gui,Network,WebKit,Xml}Unigine_${arch}.so.4 $instdir/bin
92 install -m 0755 bin/libUnigine_${arch}.so $instdir/bin
93 install -m 0755 bin/valley_${arch} $instdir/bin
94 install -m 0755 valley $instdir
95 install -m 0755 valley $out/bin/valley
98 cp -R data documentation $instdir
100 # Install and wrap executable
101 wrapProgram $out/bin/valley \
103 --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath
106 convert $out/lib/unigine/valley/data/launcher/icon.png -resize 128x128 $out/share/icons/Valley.png
107 for RES in 16 24 32 48 64 128 256
109 mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
110 convert $out/lib/unigine/valley/data/launcher/icon.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/Valley.png
120 genericName = "A GPU Stress test tool from the UNIGINE";
122 desktopName = "Valley Benchmark";
126 stripDebugList = [ "${instPath}/bin" ];
129 description = "Unigine Valley GPU benchmarking tool";
130 homepage = "https://unigine.com/products/benchmarks/valley/";
131 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
132 license = lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
134 platforms = [ "x86_64-linux" "i686-linux" ];
135 mainProgram = "valley";