From 329a70500595e17729931781f411ec8a9964ee3d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 17 Jul 2013 11:14:26 +0200 Subject: [PATCH] nvidia-x11: Fix the library-only build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, introduce a function ‘versionAtLeast’ which is probably more natural than ‘versionOlder’. --- pkgs/lib/strings.nix | 4 ++++ pkgs/os-specific/linux/nvidia-x11/default.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix index ed668e2b9270..024a9ac7d7a2 100644 --- a/pkgs/lib/strings.nix +++ b/pkgs/lib/strings.nix @@ -163,6 +163,10 @@ rec { versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1; + # Return true iff string v1 denotes a version equal to or newer than v2. + versionAtLeast = v1: v2: !versionOlder v1 v2; + + # Get the version of the specified derivation, as specified in its # ‘name’ attribute. getVersion = drv: (builtins.parseDrvName drv.name).version; diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index e4e9a2c02057..9e750629b829 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { patches = [ ./version-test.patch ] - ++ optional (!versionOlder kernelDev.version "3.10") kernel310patch; + ++ optional (!libsOnly && versionAtLeast kernelDev.version "3.10") kernel310patch; src = if stdenv.system == "i686-linux" then