wok-6.x view nvidia/receipt @ rev 7418

nvidia: only use .unblocked_ioctl since 2.6.36
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Nov 28 12:56:09 2010 +0100 (2010-11-28)
parents f027a129902c
children 2d215b2df1eb
line source
1 # SliTaz package receipt.
3 PACKAGE="nvidia"
4 VERSION="195.36.15"
5 CATEGORY="x-window"
6 MAINTAINER="jozee@slitaz.org"
7 SHORT_DESC="NVIDIA drivers (non-free)"
8 DEPENDS="linux xorg-server gtk+ cairo linux-agp linux-drm"
9 BUILD_DEPENDS="$DEPENDS"
10 WEB_SITE="http://www.nvidia.com/"
11 SOURCE="NVIDIA-Linux-x86-${VERSION}-pkg0"
12 TARBALL="${SOURCE}.run"
13 TAGS="drivers graphic video"
15 # Rules to configure and make the package.
17 compile_rules() {
18 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
19 WGET_URL="http://download.nvidia.com/XFree86/Linux-x86/$VERSION/$TARBALL"
21 [ -d $WOK/linux/taz ] || tazwok cook linux
23 cd $WOK/$PACKAGE
24 [ -f $SOURCES_REPOSITORY/$TARBALL ] || wget $WGET_URL -P $SOURCES_REPOSITORY
26 chmod +x $SOURCES_REPOSITORY/$TARBALL
27 sh $SOURCES_REPOSITORY/$TARBALL --extract-only
29 cd $SOURCE/usr/src/nv/
30 sed -i 's|\.ioctl|// &|' nv.c # only use .unblocked_ioctl since 2.6.36
31 make SYSSRC="$WOK/linux/linux-$KERNEL_VERSION" module
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
38 EXTRAVERSION=_$KERNEL_VERSION
39 _pkg="$WOK/$PACKAGE/$SOURCE"
41 mkdir -p $fs/usr/share $fs/usr/lib/X11 $fs/usr/share/licenses/$PACKAGE \
42 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video \
43 $fs/usr/share/doc/$PACKAGE
45 # Compress and install module
46 lzma e $_pkg/usr/src/nv/nvidia.ko \
47 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
48 chown root $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
49 chmod 0644 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
51 cp -a $_pkg/LICENSE $fs/usr/share/licenses/$PACKAGE
52 cp -a $_pkg/usr/bin $fs/usr
53 cp -a $_pkg/nvidia-installer $fs/usr/bin
54 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib/
55 cp -a $_pkg/usr/lib/tls $fs/usr/lib/
56 cp -a $_pkg/usr/share/pixmaps $fs/usr/share
57 cp -a $_pkg/usr/share/doc/* $fs/usr/share/doc/$PACKAGE/
58 cp -a $_pkg/usr/X11R6/lib/* $fs/usr/lib/X11
60 cd $fs/usr/lib/X11/modules/extensions
61 ln -s libglx.so.$VERSION libglx.so
63 cd $fs/usr/lib/
64 ln -s libGL.so.$VERSION libGL.so
65 ln -s libGL.so.$VERSION libGL.so.1
66 ln -s libGLcore.so.$VERSION libGLcore.so.1
67 ln -s libnvidia-cfg.so.$VERSION libnvidia-cfg.so.1
68 ln -s libnvidia-tls.so.$VERSION libnvidia-tls.so.1
69 ln -s libcuda.so.$VERSION libcuda.so.1
70 ln -s libcuda.so.$VERSION libcuda.so
71 ln -s libvdpau.so.$VERSION libvdpau.so.1
72 ln -s libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so.1
74 cd $fs/usr/lib/X11
75 ln -s libXvMCNVIDIA.so.$VERSION libXvMCNVIDIA_dynamic.so.1
77 }
79 pre_install()
80 {
81 echo ""
82 echo -e "\033[1m PROPRIETARY LICENSE:\033[0m $2"
83 echo "================================================================================"
84 echo "You are installing a package with proprietary license."
85 echo "You must accept the license."
86 echo "================================================================================"
87 echo ""
89 }
91 post_install()
92 {
93 echo "Processing post-install commands..."
94 chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
96 # correct .desktop file file
97 sed -i 's:__UTILS_PATH__/::' $1/usr/share/applications/nvidia-settings.desktop
98 sed -i 's:__PIXMAP_PATH__/::' $1/usr/share/applications/nvidia-settings.desktop
100 echo ""
101 echo -e "\033[1m NVIDIA LICENSE INFORMATION:\033[0m $2"
102 echo "================================================================================"
103 echo "For installing this package, you have to accept the $PACKAGE license."
104 echo "The license is stored in /usr/share/licenses/$PACKAGE "
105 echo -n "Would you like to read the license (y/N) : "; read anser
106 if [ "$anser" = "y" ]; then
107 cat /usr/share/licenses/"$PACKAGE"/LICENSE | more
108 echo ""
109 fi
110 echo "================================================================================"
111 echo -n "Do you accept the license (y/N) : "; read anser
112 if [ "$anser" = "N" ]; then
113 echo "You did not accept the license, Removing the pkg."
114 tazpkg remove "$PACKAGE"
115 fi
117 }
119 post_remove()
120 {
121 echo "Processing post-remove commands..."
122 depmod -a
123 }
125 TAZBB_NO_INSTALL="because this is not hardware neutral"