wok view nvidia-96xx/receipt @ rev 24102
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 17 10:35:57 2021 +0000 (2021-09-17) |
parents | 02c70d036ea0 |
children | 8ea0030e77cb |
line source
1 # SliTaz package receipt.
3 PACKAGE="nvidia-96xx"
4 VERSION="96.43.23"
5 CATEGORY="network"
6 MAINTAINER="psychomaniak@xakep.ru"
7 LICENSE="other"
8 SHORT_DESC="NVIDIA-legacy drivers (from Geforce MX200 to 7950) (non-free)"
9 WEB_SITE="http://www.nvidia.com/"
10 SOURCE="NVIDIA-Linux-x86-${VERSION}-pkg0"
11 TARBALL="${SOURCE}.run"
12 WGET_URL="http://download.nvidia.com/XFree86/Linux-x86/$VERSION/$TARBALL"
13 RUN_OPTS="--extract-only"
14 TAGS="drivers graphic video"
15 PROVIDE="mesa"
17 DEPENDS="linux xorg-server gtk+ cairo linux-agp linux-drm"
18 BUILD_DEPENDS="linux-module-headers coreutils-file-summarize xz"
20 current_version()
21 {
22 wget -O - http://download.nvidia.com/XFree86/Linux-x86 2>/dev/null | \
23 sed '/href=.96/!d;s|.*>96|96|;s|/.*||' | sort -Vr | sed q
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 cd $src/usr/src/nv/
30 # Only use .unblocked_ioctl since 2.6.36
31 sed -i 's|\.ioctl|// &|' nv.c
32 make SYSSRC="/usr/src/linux" module 2>&1 | sed s'/ERROR:/error:/' &&
33 xz nvidia.ko
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 EXTRAVERSION=_${kvers}
41 mkdir -p $fs/usr/share $fs/usr/lib/X11 $fs/usr/share/licenses/$PACKAGE
42 mkdir -p $fs/lib/modules/$kvers-slitaz/kernel/drivers/video
43 mkdir -p $fs/usr/share/doc/$PACKAGE
45 # Compress and install module
46 cp $src/usr/src/nv/nvidia.ko.xz \
47 $fs/lib/modules/$kvers-slitaz/kernel/drivers/video/
49 chown root $fs/lib/modules/$kvers-slitaz/kernel/drivers/video/nvidia.ko.xz
50 chmod 0644 $fs/lib/modules/$kvers-slitaz/kernel/drivers/video/nvidia.ko.xz
52 cp -a $src/LICENSE $fs/usr/share/licenses/$PACKAGE
53 cp -a $src/usr/bin $fs/usr
54 cp -a $src/nvidia-installer $fs/usr/bin
55 cp -a $src/usr/lib/*.so* $fs/usr/lib/
56 cp -a $src/usr/lib/tls $fs/usr/lib/
57 cp -a $src/usr/share/pixmaps $fs/usr/share
58 cp -a $src/usr/share/doc/* $fs/usr/share/doc/$PACKAGE/
59 cp -a $src/usr/X11R6/lib/* $fs/usr/lib/X11
61 # Links
62 for i in $(find $fs -iname *.so*); do
63 ln -s $(basename $i) $(dirname $i)/$(basename ${i/so.${VERSION}/so/})
64 ln -s $(basename $i) $(dirname $i)/$(basename ${i/so.${VERSION}/so.1/})
65 done
67 # exclude from files.list (for tazpkg's "find-depends")
68 cd $fs/usr/lib
69 for i in $(ls libGL.so*) ; do mv -f $i ${i//./-.-} ; done
70 }
72 pre_install()
73 {
74 title 'PROPRIETARY LICENSE'
75 echo 'You are installing a package with proprietary license.'
76 echo 'You must accept the license.'
77 footer
78 }
80 post_install()
81 {
82 # Restore excluded from files.list (for tazpkg's "find-depends")
83 cd $1/usr/lib
84 for i in $(ls libGL.so*) ; do mv -f $i ${i//-.-/.} ; done
86 newline
87 chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
89 # correct .desktop file file
90 sed -i 's:__UTILS_PATH__/::' "$1/usr/share/applications/nvidia-settings.desktop"
91 sed -i 's:__PIXMAP_PATH__/::' "$1/usr/share/applications/nvidia-settings.desktop"
93 title 'NVIDIA LICENSE INFORMATION'
94 echo "For installing this package, you have to accept the $PACKAGE license."
95 echo "The license is stored in /usr/share/licenses/$PACKAGE "
96 echo -n "Would you like to read the license (y/N) : "; read anser
97 if [ "$anser" = 'y' ]; then
98 more /usr/share/licenses/"$PACKAGE"/LICENSE
99 echo
100 fi
101 separator
102 echo -n "Do you accept the license (y/N) : "; read anser
103 if [ "$anser" = 'N' ]; then
104 echo "You did not accept the license, Removing the pkg."
105 tazpkg remove "$PACKAGE"
106 fi
107 }
109 TAZBB_NO_INSTALL="because this is not hardware neutral"