summaryrefslogtreecommitdiffstats
path: root/extra/nvidia/Pkgfile
blob: 4569519493359167a3a0ac920bc96c4fe6a522af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Description: Pilotes pour les cartes graphiques NVIDIA
# URL: http://www.nvidia.com/object/unix.html
# Maintainer: NuTyX core team
# Packager: thierryn1 at hispeed dot ch
# Depends on:

name=nvidia
version=185.18.31
release=2
_kernel=2.6.30.5
[ "`uname -m`" == "i686"   ] && _ARCH=x86
[ "`uname -m`" == "x86_64"   ] && _ARCH=x86_64
source=(http://us.download.nvidia.com/XFree86/Linux-${_ARCH}/$version/NVIDIA-Linux-${_ARCH}-$version-pkg1.run\
	)

build() {
	sh NVIDIA-Linux-${_ARCH}-$version-pkg1.run --extract-only
	cd NVIDIA-Linux-${_ARCH}-$version-pkg1/usr/src/nv
	ln -s Makefile.kbuild Makefile
	make SYSSRC=/usr/src/kernel/linux-${_kernel} module

	# install kernel module
	mkdir -p $PKG/lib/modules/${_kernel}/kernel/drivers/video
	install -m644 nvidia.ko $PKG/lib/modules/${_kernel}/kernel/drivers/video
	
	
	# make utilities
	cd ../../

        mkdir -p $PKG/usr/{lib,bin,share/applications,share/pixmaps,share/man/man1}
        mkdir -p $PKG/usr/lib/xorg/modules/{extensions,drivers}
        mkdir -p $PKG/usr/share/licenses/nvidia

	# Install libraries
	cp -a X11R6/lib/* $PKG/usr/lib/xorg/
        cp -a lib/* $PKG/usr/lib/
	sed -i -e 's|__LIBGL_PATH__|/usr/lib|' $PKG/usr/lib/libGL.la
	ln -sf libGLcore.so.$version $PKG/usr/lib/libGLcore.so
	ln -sf /usr/lib/libGLcore.so $PKG/usr/lib/xorg/modules/extensions/libGLcore.so

	# additional symlinks required by gl-select
	ln -s libGL.so.$version $PKG/usr/lib/libGL_so_1_2_nvidia
	ln -s libglx.so.$version $PKG/usr/lib/xorg/modules/extensions/libglx_so_nvidia
	
	# Copy includes
	mkdir -p $PKG/usr/include/nvidia
	cp -r include/GL $PKG/usr/include/nvidia/

        install -m644 share/man/man1/* $PKG/usr/share/man/man1/
        rm $PKG/usr/share/man/man1/nvidia-installer.1.gz

        install X11R6/lib/* $PKG/usr/lib/xorg/
        install -m644 share/applications/nvidia-settings.desktop $PKG/usr/share/applications/

        # fix nvidia .desktop file
        sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i \
        $PKG/usr/share/applications/nvidia-settings.desktop

        install -m644 share/pixmaps/nvidia-settings.png $PKG/usr/share/pixmaps/
        install -m755 bin/nvidia-{settings,xconfig,bug-report.sh} $PKG/usr/bin/
}