From 0d1d1bd7e2bf2c825ea7685ec1427d7dfc79113c Mon Sep 17 00:00:00 2001 From: Kier Davis Date: Thu, 8 Dec 2016 16:25:39 +0000 Subject: [PATCH 1/4] unigine-valley: 1.0-1 -> 1.0 (remove unnecessary release version) The upstream version is "1.0", so that's what the version of the Nix package should be too. When I packaged this I wasn't aware that a Nix package could update without its version number increasing, so I added an extra "release version" (like Arch Linux packages). Of course, this isn't necessary. --- pkgs/applications/graphics/unigine-valley/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/unigine-valley/default.nix b/pkgs/applications/graphics/unigine-valley/default.nix index 8fef29fa107..d2b3756cecb 100644 --- a/pkgs/applications/graphics/unigine-valley/default.nix +++ b/pkgs/applications/graphics/unigine-valley/default.nix @@ -16,7 +16,6 @@ let version = "1.0"; - pkgversion = "1"; arch = if stdenv.system == "x86_64-linux" then "x64" @@ -27,7 +26,7 @@ let in stdenv.mkDerivation { - name = "unigine-valley-${version}-${pkgversion}"; + name = "unigine-valley-${version}"; src = fetchurl { url = "http://assets.unigine.com/d/Unigine_Valley-${version}.run"; From c3f49dcaf07f00a7f29d65f2429490089b24b3df Mon Sep 17 00:00:00 2001 From: Kier Davis Date: Thu, 8 Dec 2016 16:50:54 +0000 Subject: [PATCH 2/4] unigine-valley: install files to a more idiomatic location Previously, the entire installation was copied to $out/opt/unigine/valley. Using $out/lib instead of $out/opt would be more consistent with other Nix packages. --- pkgs/applications/graphics/unigine-valley/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/unigine-valley/default.nix b/pkgs/applications/graphics/unigine-valley/default.nix index d2b3756cecb..9ff603f405e 100644 --- a/pkgs/applications/graphics/unigine-valley/default.nix +++ b/pkgs/applications/graphics/unigine-valley/default.nix @@ -70,7 +70,7 @@ in buildPhase = ""; installPhase = '' - instdir=$out/opt/unigine/valley + instdir=$out/lib/unigine/valley # Install executables and libraries mkdir -p $instdir/bin @@ -96,7 +96,7 @@ in meta = { description = "The Unigine Valley GPU benchmarking tool"; 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: /nix/store/*-unigine-valley-1.0/lib/unigine/valley/documentation/License.pdf maintainers = [ stdenv.lib.maintainers.kierdavis ]; platforms = ["x86_64-linux" "i686-linux"]; }; From aa53e1d17e2274d45a419c58ff13b83058f882ac Mon Sep 17 00:00:00 2001 From: Kier Davis Date: Thu, 8 Dec 2016 17:00:25 +0000 Subject: [PATCH 3/4] unigine-valley: exclude non-ELF files from stripping during fix-up --- pkgs/applications/graphics/unigine-valley/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/graphics/unigine-valley/default.nix b/pkgs/applications/graphics/unigine-valley/default.nix index 9ff603f405e..01eda33217c 100644 --- a/pkgs/applications/graphics/unigine-valley/default.nix +++ b/pkgs/applications/graphics/unigine-valley/default.nix @@ -93,6 +93,8 @@ in --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath ''; + stripDebugList = ["lib/unigine/valley/bin"]; + meta = { description = "The Unigine Valley GPU benchmarking tool"; homepage = "http://unigine.com/products/benchmarks/valley/"; From d1226333e22a5cccd5247a323b7e70e809ee5efb Mon Sep 17 00:00:00 2001 From: Kier Davis Date: Fri, 16 Dec 2016 10:22:24 +0000 Subject: [PATCH 4/4] unigine-valley: clean up --- .../graphics/unigine-valley/default.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/graphics/unigine-valley/default.nix b/pkgs/applications/graphics/unigine-valley/default.nix index 01eda33217c..1bb57538cd5 100644 --- a/pkgs/applications/graphics/unigine-valley/default.nix +++ b/pkgs/applications/graphics/unigine-valley/default.nix @@ -25,7 +25,7 @@ let abort "Unsupported platform"; in - stdenv.mkDerivation { + stdenv.mkDerivation rec { name = "unigine-valley-${version}"; src = fetchurl { @@ -34,6 +34,7 @@ in }; sourceRoot = "Unigine_Valley-${version}"; + instPath = "lib/unigine/valley"; buildInputs = [file makeWrapper]; @@ -55,22 +56,16 @@ in ./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 = '' # Patch ELF files. elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1) for elf in $elfs; do - echo "Patching $elf" patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true done ''; - configurePhase = ""; - buildPhase = ""; - installPhase = '' - instdir=$out/lib/unigine/valley + instdir=$out/${instPath} # Install executables and libraries mkdir -p $instdir/bin @@ -93,12 +88,12 @@ in --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath ''; - stripDebugList = ["lib/unigine/valley/bin"]; + stripDebugList = ["${instPath}/bin"]; meta = { description = "The Unigine Valley GPU benchmarking tool"; homepage = "http://unigine.com/products/benchmarks/valley/"; - license = stdenv.lib.licenses.unfree; # see also: /nix/store/*-unigine-valley-1.0/lib/unigine/valley/documentation/License.pdf + license = stdenv.lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf maintainers = [ stdenv.lib.maintainers.kierdavis ]; platforms = ["x86_64-linux" "i686-linux"]; };