Merge pull request #21202 from kierdavis/unigine-valley
unigine-valley: refactor
This commit is contained in:
commit
104c3db659
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "1.0";
|
version = "1.0";
|
||||||
pkgversion = "1";
|
|
||||||
|
|
||||||
arch = if stdenv.system == "x86_64-linux" then
|
arch = if stdenv.system == "x86_64-linux" then
|
||||||
"x64"
|
"x64"
|
||||||
|
@ -26,8 +25,8 @@ let
|
||||||
abort "Unsupported platform";
|
abort "Unsupported platform";
|
||||||
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
name = "unigine-valley-${version}-${pkgversion}";
|
name = "unigine-valley-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://assets.unigine.com/d/Unigine_Valley-${version}.run";
|
url = "http://assets.unigine.com/d/Unigine_Valley-${version}.run";
|
||||||
|
@ -35,6 +34,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
sourceRoot = "Unigine_Valley-${version}";
|
sourceRoot = "Unigine_Valley-${version}";
|
||||||
|
instPath = "lib/unigine/valley";
|
||||||
|
|
||||||
buildInputs = [file makeWrapper];
|
buildInputs = [file makeWrapper];
|
||||||
|
|
||||||
|
@ -56,22 +56,16 @@ in
|
||||||
./extractor.run --target $sourceRoot
|
./extractor.run --target $sourceRoot
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# The executable loads libGPUMonitor_${arch}.so "manually" (i.e. not through the ELF interpreter).
|
|
||||||
# However, it still uses the RPATH to look for it.
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
# Patch ELF files.
|
# Patch ELF files.
|
||||||
elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1)
|
elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1)
|
||||||
for elf in $elfs; do
|
for elf in $elfs; do
|
||||||
echo "Patching $elf"
|
|
||||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true
|
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePhase = "";
|
|
||||||
buildPhase = "";
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
instdir=$out/opt/unigine/valley
|
instdir=$out/${instPath}
|
||||||
|
|
||||||
# Install executables and libraries
|
# Install executables and libraries
|
||||||
mkdir -p $instdir/bin
|
mkdir -p $instdir/bin
|
||||||
|
@ -94,10 +88,12 @@ in
|
||||||
--prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath
|
--prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
stripDebugList = ["${instPath}/bin"];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "The Unigine Valley GPU benchmarking tool";
|
description = "The Unigine Valley GPU benchmarking tool";
|
||||||
homepage = "http://unigine.com/products/benchmarks/valley/";
|
homepage = "http://unigine.com/products/benchmarks/valley/";
|
||||||
license = stdenv.lib.licenses.unfree; # see also: /nix/store/*-unigine-valley-1.0/opt/unigine/valley/documentation/License.pdf
|
license = stdenv.lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
|
||||||
maintainers = [ stdenv.lib.maintainers.kierdavis ];
|
maintainers = [ stdenv.lib.maintainers.kierdavis ];
|
||||||
platforms = ["x86_64-linux" "i686-linux"];
|
platforms = ["x86_64-linux" "i686-linux"];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue