nixpkgs/pkgs/os-specific/linux/nvidia-x11/patchlevel.patch
Lluís Batlle i Rossell 972006aa43 Making nvidia 96.x build on linux 3.4. I took patches from AUR.
svn path=/nixpkgs/trunk/; revision=34552
2012-06-18 18:15:26 +00:00

60 lines
2.6 KiB
Diff

diff -pur 96.43.20-t1/conftest.sh 96.43.20-t2/conftest.sh
--- 96.43.20-t1/conftest.sh 2012-06-16 17:14:47.206589267 +0400
+++ 96.43.20-t2/conftest.sh 2012-06-16 15:35:45.049203248 +0400
@@ -1303,10 +1303,14 @@ case "$5" in
MAKEFILE=$HEADERS/../Makefile
if [ -f $MAKEFILE ]; then
+ VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
- if [ -z "$PATCHLEVEL" ]; then
+ if [ -z "$PATCHLEVEL" -o -z "$VERSION" ]; then
exit 1
+ elif [ "$VERSION" = '3' ]; then
+ echo 6
+ exit 0
else
echo $PATCHLEVEL
exit 0
@@ -1426,10 +1430,11 @@ case "$5" in
# 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 \
+ if [ "$VERSION" = '2' -a -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
-a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
SELECTED_MAKEFILE=Makefile.kbuild
RET=0
@@ -1525,11 +1530,12 @@ case "$5" in
# This source tree is not configured, but includes
# the top-level Makefile.
#
+ 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 -n "$SUBLEVEL" ]; then
- echo 2.$PATCHLEVEL.$SUBLEVEL
+ if [ -n "$VERSION" -a -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
+ echo $VERSION.$PATCHLEVEL.$SUBLEVEL
RET=0
fi
fi
diff -pur 96.43.20-t1/Makefile.kbuild 96.43.20-t2/Makefile.kbuild
--- 96.43.20-t1/Makefile.kbuild 2011-07-18 10:51:11.000000000 +0400
+++ 96.43.20-t2/Makefile.kbuild 2012-06-16 17:08:11.694605133 +0400
@@ -132,7 +132,7 @@ MODULE_ROOT := /lib/modules/$(KERNEL_UNA
#
TOPDIR ?= $(KERNEL_SOURCES)
-PATCHLEVEL ?= $(shell $(CONFTEST) kernel_patch_level)
+PATCHLEVEL := $(shell $(CONFTEST) kernel_patch_level)
#
# Linux 2.4 uses the .o module extension. Linux 2.6, however, uses the .ko