From f921baec94c0072135e2dc1c96af685312eb18d6 Mon Sep 17 00:00:00 2001 From: Karn Kallio Date: Wed, 6 Feb 2013 10:46:25 +0100 Subject: [PATCH] nvidia-x11: fix build with the latest Linux kernel --- pkgs/os-specific/linux/nvidia-x11/default.nix | 2 ++ .../linux/nvidia-x11/version-test.patch | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 pkgs/os-specific/linux/nvidia-x11/version-test.patch diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index e3630db2d5b6..c965ef01c72b 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation { builder = ./builder.sh; + patches = [ ./version-test.patch ]; + src = if stdenv.system == "i686-linux" then fetchurl { diff --git a/pkgs/os-specific/linux/nvidia-x11/version-test.patch b/pkgs/os-specific/linux/nvidia-x11/version-test.patch new file mode 100644 index 000000000000..9b6908ee5c0a --- /dev/null +++ b/pkgs/os-specific/linux/nvidia-x11/version-test.patch @@ -0,0 +1,19 @@ +diff -Naur NVIDIA-Linux-x86_64-310.32-no-compat32/kernel/conftest.sh NVIDIA-patched/kernel/conftest.sh +--- NVIDIA-Linux-x86_64-310.32-no-compat32/kernel/conftest.sh 2013-01-14 18:11:17.000000000 -0430 ++++ NVIDIA-patched/kernel/conftest.sh 2013-02-05 14:44:50.757999124 -0430 +@@ -1699,11 +1699,13 @@ + # kernel older than 2.6.6, that's all we require to + # build the module. + # ++ VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3) + PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3) + SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3) + +- if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \ +- -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then ++ if [ -n "$VERSION" -a -n "$PATCHLEVEL" -a -n "$SUBLEVEL" \ ++ -a "$VERSION" -ge 3 -o "$VERSION" -eq 2 -a "$PATCHLEVEL" -ge 7 \ ++ -o "$PATCHLEVEL" -eq 6 -a "$SUBLEVEL" -ge 6 ]; then + SELECTED_MAKEFILE=Makefile.kbuild + RET=0 + fi