wok-current view nvidia/receipt @ rev 7710

merge
author fireflyoo <lufeng369@gmail.com>
date Sun Dec 19 23:29:00 2010 +0800 (2010-12-19)
parents 5d335118e140
children 98aea7827eeb
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 linux-module-headers"
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 cd $WOK/$PACKAGE
22 [ -f $SOURCES_REPOSITORY/$TARBALL ] || wget $WGET_URL -P $SOURCES_REPOSITORY
24 chmod +x $SOURCES_REPOSITORY/$TARBALL
25 sh $SOURCES_REPOSITORY/$TARBALL --extract-only
27 cd $SOURCE/usr/src/nv/
28 sed -i 's|\.ioctl|// &|' nv.c # only use .unblocked_ioctl since 2.6.36
29 make SYSSRC="/usr/src/linux" module
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
36 EXTRAVERSION=_$KERNEL_VERSION
37 _pkg="$WOK/$PACKAGE/$SOURCE"
39 mkdir -p $fs/usr/share $fs/usr/lib/X11 $fs/usr/share/licenses/$PACKAGE \
40 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video \
41 $fs/usr/share/doc/$PACKAGE
43 # Compress and install module
44 lzma e $_pkg/usr/src/nv/nvidia.ko \
45 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
46 chown root $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
47 chmod 0644 $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/drivers/video/nvidia.ko.gz
49 cp -a $_pkg/LICENSE $fs/usr/share/licenses/$PACKAGE
50 cp -a $_pkg/usr/bin $fs/usr
51 cp -a $_pkg/nvidia-installer $fs/usr/bin
52 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib/
53 cp -a $_pkg/usr/lib/tls $fs/usr/lib/
54 cp -a $_pkg/usr/share/pixmaps $fs/usr/share
55 cp -a $_pkg/usr/share/doc/* $fs/usr/share/doc/$PACKAGE/
56 cp -a $_pkg/usr/X11R6/lib/* $fs/usr/lib/X11
58 ln -s libglx.so.$VERSION $fs/usr/lib/X11/modules/extensions/libglx.so
59 ln -s libGL.so.$VERSION $fs/usr/lib/libGL.so
60 ln -s libGL.so.$VERSION $fs/usr/lib/libGL.so.1
61 ln -s libGLcore.so.$VERSION $fs/usr/lib/libGLcore.so.1
62 ln -s libnvidia-cfg.so.$VERSION $fs/usr/lib/libnvidia-cfg.so.1
63 ln -s libnvidia-tls.so.$VERSION $fs/usr/lib/libnvidia-tls.so.1
64 ln -s libcuda.so.$VERSION $fs/usr/lib/libcuda.so.1
65 ln -s libcuda.so.$VERSION $fs/usr/lib/libcuda.so
66 ln -s libvdpau.so.$VERSION $fs/usr/lib/libvdpau.so.1
67 ln -s libvdpau_nvidia.so.$VERSION $fs/usr/lib/libvdpau_nvidia.so.1
68 ln -s libXvMCNVIDIA.so.$VERSION $fs/usr/lib/X11/libXvMCNVIDIA_dynamic.so.1
69 }
71 pre_install()
72 {
73 echo ""
74 echo -e "\033[1m PROPRIETARY LICENSE:\033[0m $2"
75 echo "================================================================================"
76 echo "You are installing a package with proprietary license."
77 echo "You must accept the license."
78 echo "================================================================================"
79 echo ""
81 }
83 post_install()
84 {
85 echo "Processing post-install commands..."
86 chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
88 # correct .desktop file file
89 sed -i 's:__UTILS_PATH__/::' $1/usr/share/applications/nvidia-settings.desktop
90 sed -i 's:__PIXMAP_PATH__/::' $1/usr/share/applications/nvidia-settings.desktop
92 echo ""
93 echo -e "\033[1m NVIDIA LICENSE INFORMATION:\033[0m $2"
94 echo "================================================================================"
95 echo "For installing this package, you have to accept the $PACKAGE license."
96 echo "The license is stored in /usr/share/licenses/$PACKAGE "
97 echo -n "Would you like to read the license (y/N) : "; read anser
98 if [ "$anser" = "y" ]; then
99 cat /usr/share/licenses/"$PACKAGE"/LICENSE | more
100 echo ""
101 fi
102 echo "================================================================================"
103 echo -n "Do you accept the license (y/N) : "; read anser
104 if [ "$anser" = "N" ]; then
105 echo "You did not accept the license, Removing the pkg."
106 tazpkg remove "$PACKAGE"
107 fi
109 }
111 post_remove()
112 {
113 echo "Processing post-remove commands..."
114 depmod -a
115 }
117 TAZBB_NO_INSTALL="because this is not hardware neutral"