1 # Contributor: Thomas Baechler <thomas@archlinux.org>
2 # Contributor: James Rayner <iphitus@gmail.com>
3 # Maintainer: Jonathan Schmidt <j.schmidt@archlinux.us>
5 pkgname=nvidia-utils-glselect
8 pkgdesc="NVIDIA drivers utilities and libraries with libgl compatibility through glselect."
10 [ "$CARCH" = "i686" ] && ARCH=x86
11 [ "$CARCH" = "x86_64" ] && ARCH=x86_64
12 url="http://www.nvidia.com/"
13 depends=('xorg-server')
14 optdepends=('gtk2: nvidia-settings' 'pkgconfig: nvidia-xconfig')
15 conflicts=('nvidia-utils')
16 provides=("nvidia-utils=$pkgver")
18 install=nvidia.install
19 source=("http://download.nvidia.com/XFree86/Linux-${ARCH}/${pkgver}/NVIDIA-Linux-${ARCH}-${pkgver}-pkg0.run" 'glselect')
21 md5sums=('2e80419f6f9ac16beecd839874d0c5ab' '128787899ce0e0c08ae8e129a0663de4')
22 [ "$CARCH" = "x86_64" ] && md5sums=('3d3e956366f9df0e4c64d2e0299d1029' '128787899ce0e0c08ae8e129a0663de4')
26 sh NVIDIA-Linux-${ARCH}-${pkgver}-pkg0.run --extract-only
27 cd NVIDIA-Linux-${ARCH}-${pkgver}-pkg0/usr/
29 mkdir -p $pkgdir/usr/{lib,bin,share/applications,share/pixmaps,share/man/man1}
30 mkdir -p $pkgdir/usr/lib/xorg/modules/{extensions,drivers}
31 mkdir -p $pkgdir/usr/lib/vdpau
32 mkdir -p $pkgdir/usr/share/licenses/nvidia
33 mkdir -p $pkgdir/usr/include/cuda
35 install -m644 include/cuda/cuda*.h $pkgdir/usr/include/cuda/
37 install lib/{libGLcore,libGL,libnvidia-cfg,libcuda,tls/libnvidia-tls}.so.${pkgver} $pkgdir/usr/lib/ || return 1
38 install -m755 lib/vdpau/libvdpau_nvidia.so.${pkgver} "${pkgdir}/usr/lib/vdpau/" || return 1
39 ln -sf libvdpau_nvidia.so.${pkgver} "${pkgdir}/usr/lib/vdpau/libvdpau_nvidia.so.1"
41 install -m644 share/man/man1/* $pkgdir/usr/share/man/man1/ || return 1
42 rm $pkgdir/usr/share/man/man1/nvidia-installer.1.gz || return 1
43 install X11R6/lib/libXv* $pkgdir/usr/lib/ || return 1
44 install -m644 share/applications/nvidia-settings.desktop $pkgdir/usr/share/applications/ || return 1
45 # fix nvidia .desktop file
46 sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i $pkgdir/usr/share/applications/nvidia-settings.desktop
47 install -m644 share/pixmaps/nvidia-settings.png $pkgdir/usr/share/pixmaps/ || return 1
48 install X11R6/lib/modules/drivers/nvidia_drv.so $pkgdir/usr/lib/xorg/modules/drivers || return 1
49 install X11R6/lib/modules/extensions/libglx.so.$pkgver $pkgdir/usr/lib/xorg/modules/extensions || return 1
50 install -m755 bin/nvidia-{settings,xconfig,bug-report.sh} $pkgdir/usr/bin/ || return 1
52 ln -s libGLcore.so.$pkgver libGLcore.so.1 || return 1
53 ln -s libnvidia-cfg.so.$pkgver libnvidia-cfg.so.1 || return 1
54 ln -s libnvidia-tls.so.$pkgver libnvidia-tls.so.1 || return 1
55 ln -s libcuda.so.$pkgver libcuda.so.1 || return 1
56 ln -s libcuda.so.$pkgver libcuda.so || return 1
57 ln -s libXvMCNVIDIA.so.$pkgver libXvMCNVIDIA_dynamic.so.1 || return 1
59 install -m644 $srcdir/NVIDIA-Linux-${ARCH}-${pkgver}-pkg0/LICENSE $pkgdir/usr/share/licenses/nvidia/ || return 1
60 ln -s nvidia $startdir/pkg/usr/share/licenses/nvidia-utils || return 1
62 install -D -m644 $srcdir/NVIDIA-Linux-${ARCH}-${pkgver}-pkg0/usr/share/doc/README.txt $pkgdir/usr/share/doc/nvidia/README || return 1
64 find $pkgdir/usr -type d -exec chmod 755 {} \;
65 chmod 644 $pkgdir/usr/lib/libXvMCNVIDIA.a
67 # Allow gl lib link switching with glselect
68 install $srcdir/glselect $pkgdir/usr/bin/ || return 1