unigine-valley: add desktop icon and change libGL to libglvnd
This commit is contained in:
parent
b235fa2abc
commit
b7642726f9
|
@ -1,10 +1,15 @@
|
||||||
{ lib, stdenv, fetchurl
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchurl
|
||||||
|
|
||||||
# Build-time dependencies
|
# Build-time dependencies
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, file
|
, file
|
||||||
|
, makeDesktopItem
|
||||||
|
, imagemagick
|
||||||
|
, copyDesktopItems
|
||||||
|
|
||||||
# Runtime dependencies
|
# Runtime dependencies
|
||||||
, fontconfig
|
, fontconfig
|
||||||
, freetype
|
, freetype
|
||||||
, libX11
|
, libX11
|
||||||
|
@ -12,104 +17,120 @@
|
||||||
, libXinerama
|
, libXinerama
|
||||||
, libXrandr
|
, libXrandr
|
||||||
, libXrender
|
, libXrender
|
||||||
, libGL
|
, libglvnd
|
||||||
, openal}:
|
, openal
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "1.0";
|
version = "1.0";
|
||||||
|
|
||||||
arch = if stdenv.hostPlatform.system == "x86_64-linux" then
|
arch =
|
||||||
"x64"
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
||||||
else if stdenv.hostPlatform.system == "i686-linux" then
|
"x64"
|
||||||
"x86"
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
||||||
else
|
"x86"
|
||||||
throw "Unsupported platform ${stdenv.hostPlatform.system}";
|
else
|
||||||
|
throw "Unsupported platform ${stdenv.hostPlatform.system}";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "unigine-valley";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = fetchurl {
|
stdenv.mkDerivation rec {
|
||||||
url = "http://assets.unigine.com/d/Unigine_Valley-${version}.run";
|
pname = "unigine-valley";
|
||||||
sha256 = "5f0c8bd2431118551182babbf5f1c20fb14e7a40789697240dcaf546443660f4";
|
inherit version;
|
||||||
};
|
|
||||||
|
|
||||||
sourceRoot = "Unigine_Valley-${version}";
|
src = fetchurl {
|
||||||
instPath = "lib/unigine/valley";
|
url = "https://m11-assets.unigine.com/d/Unigine_Valley-${version}.run";
|
||||||
|
sha256 = "5f0c8bd2431118551182babbf5f1c20fb14e7a40789697240dcaf546443660f4";
|
||||||
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [file makeWrapper];
|
sourceRoot = "Unigine_Valley-${version}";
|
||||||
|
instPath = "lib/unigine/valley";
|
||||||
|
|
||||||
libPath = lib.makeLibraryPath [
|
nativeBuildInputs = [ file makeWrapper imagemagick copyDesktopItems ];
|
||||||
stdenv.cc.cc # libstdc++.so.6
|
|
||||||
fontconfig
|
|
||||||
freetype
|
|
||||||
libX11
|
|
||||||
libXext
|
|
||||||
libXinerama
|
|
||||||
libXrandr
|
|
||||||
libXrender
|
|
||||||
libGL
|
|
||||||
openal
|
|
||||||
];
|
|
||||||
|
|
||||||
unpackPhase = ''
|
libPath = lib.makeLibraryPath [
|
||||||
runHook preUnpack
|
stdenv.cc.cc # libstdc++.so.6
|
||||||
|
fontconfig
|
||||||
|
freetype
|
||||||
|
libX11
|
||||||
|
libXext
|
||||||
|
libXinerama
|
||||||
|
libXrandr
|
||||||
|
libXrender
|
||||||
|
libglvnd
|
||||||
|
openal
|
||||||
|
];
|
||||||
|
|
||||||
cp $src extractor.run
|
unpackPhase = ''
|
||||||
chmod +x extractor.run
|
runHook preUnpack
|
||||||
./extractor.run --target $sourceRoot
|
|
||||||
|
|
||||||
runHook postUnpack
|
cp $src extractor.run
|
||||||
'';
|
chmod +x extractor.run
|
||||||
|
./extractor.run --target $sourceRoot
|
||||||
|
|
||||||
patchPhase = ''
|
runHook postUnpack
|
||||||
runHook prePatch
|
'';
|
||||||
|
|
||||||
# Patch ELF files.
|
postPatch = ''
|
||||||
elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1)
|
# Patch ELF files.
|
||||||
for elf in $elfs; do
|
elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1)
|
||||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true
|
for elf in $elfs; do
|
||||||
done
|
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
runHook postPatch
|
installPhase = ''
|
||||||
'';
|
runHook preInstall
|
||||||
|
|
||||||
installPhase = ''
|
instdir=$out/${instPath}
|
||||||
runHook preInstall
|
mkdir -p $out/share/icons/hicolor $out/share/applications $out/bin $instdir/bin
|
||||||
|
|
||||||
instdir=$out/${instPath}
|
# Install executables and libraries
|
||||||
|
install -m 0755 bin/browser_${arch} $instdir/bin
|
||||||
|
install -m 0755 bin/libApp{Stereo,Surround,Wall}_${arch}.so $instdir/bin
|
||||||
|
install -m 0755 bin/libGPUMonitor_${arch}.so $instdir/bin
|
||||||
|
install -m 0755 bin/libQt{Core,Gui,Network,WebKit,Xml}Unigine_${arch}.so.4 $instdir/bin
|
||||||
|
install -m 0755 bin/libUnigine_${arch}.so $instdir/bin
|
||||||
|
install -m 0755 bin/valley_${arch} $instdir/bin
|
||||||
|
install -m 0755 valley $instdir
|
||||||
|
install -m 0755 valley $out/bin/valley
|
||||||
|
|
||||||
# Install executables and libraries
|
# Install other files
|
||||||
mkdir -p $instdir/bin
|
cp -R data documentation $instdir
|
||||||
install -m 0755 bin/browser_${arch} $instdir/bin
|
|
||||||
install -m 0755 bin/libApp{Stereo,Surround,Wall}_${arch}.so $instdir/bin
|
|
||||||
install -m 0755 bin/libGPUMonitor_${arch}.so $instdir/bin
|
|
||||||
install -m 0755 bin/libQt{Core,Gui,Network,WebKit,Xml}Unigine_${arch}.so.4 $instdir/bin
|
|
||||||
install -m 0755 bin/libUnigine_${arch}.so $instdir/bin
|
|
||||||
install -m 0755 bin/valley_${arch} $instdir/bin
|
|
||||||
install -m 0755 valley $instdir
|
|
||||||
|
|
||||||
# Install other files
|
# Install and wrap executable
|
||||||
cp -R data documentation $instdir
|
wrapProgram $out/bin/valley \
|
||||||
|
--chdir "$instdir" \
|
||||||
|
--prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath
|
||||||
|
|
||||||
# Install and wrap executable
|
# Make desktop Icon
|
||||||
mkdir -p $out/bin
|
convert $out/lib/unigine/valley/data/launcher/icon.png -resize 128x128 $out/share/icons/Valley.png
|
||||||
install -m 0755 valley $out/bin/valley
|
for RES in 16 24 32 48 64 128 256
|
||||||
wrapProgram $out/bin/valley \
|
do
|
||||||
--chdir "$instdir" \
|
mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
|
||||||
--prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath
|
convert $out/lib/unigine/valley/data/launcher/icon.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/Valley.png
|
||||||
|
done
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
stripDebugList = ["${instPath}/bin"];
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "Valley";
|
||||||
|
exec = "valley";
|
||||||
|
genericName = "A GPU Stress test tool from the UNIGINE";
|
||||||
|
icon = "Valley";
|
||||||
|
desktopName = "Valley Benchmark";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
stripDebugList = [ "${instPath}/bin" ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "The Unigine Valley GPU benchmarking tool";
|
||||||
|
homepage = "https://unigine.com/products/benchmarks/valley/";
|
||||||
|
license = lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
|
||||||
|
maintainers = [ lib.maintainers.kierdavis ];
|
||||||
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "The Unigine Valley GPU benchmarking tool";
|
|
||||||
homepage = "https://unigine.com/products/benchmarks/valley/";
|
|
||||||
license = lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
|
|
||||||
maintainers = [ lib.maintainers.kierdavis ];
|
|
||||||
platforms = ["x86_64-linux" "i686-linux"];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue