Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 30th, 2010  |  syntax: None  |  size: 5.32 KB  |  views: 149  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pkgname=nvidia-utils-256xx
  2. pkgver=256.29
  3. pkgrel=1
  4. pkgdesc="NVIDIA beta drivers utilities and libraries."
  5. arch=('x86_64')
  6. [ "$CARCH" = "x86_64" ] && ARCH=x86_64 && _srcname=NVIDIA-Linux-x86_64-${pkgver}
  7. url="http://www.nvidia.com/"
  8. depends=('xorg-server')
  9. optdepends=('gtk2: nvidia-settings' 'pkgconfig: nvidia-xconfig')
  10. conflicts=('libgl' 'nvidia-utils' 'nvidia-utils-beta')
  11. provides=('libgl' 'lib32-libgl')
  12. license=('custom')
  13. install=nvidia.install
  14. source=("ftp://download.nvidia.com/XFree86/Linux-${ARCH}/${pkgver}/${_srcname}.run")
  15.  
  16. build() {
  17.         cd $srcdir
  18.  
  19.         if [ -d ${srcdir}/${_srcname} ]; then
  20.           rm -rf ${srcdir}/${_srcname}
  21.         fi     
  22.         # Extract the source
  23.         sh ${_srcname}.run --extract-only
  24. }
  25.  
  26. package() {
  27.  
  28.         cd ${srcdir}/${_srcname}
  29.         # Create install dirs
  30.         mkdir -p $pkgdir/usr/{lib,bin,share/applications,share/pixmaps,share/man/man1}
  31.         mkdir -p $pkgdir/usr/lib/xorg/modules/{extensions,drivers}
  32.         mkdir -p $pkgdir/usr/lib/vdpau
  33.         mkdir -p $pkgdir/usr/share/licenses/nvidia
  34.         mkdir -p $pkgdir/usr/include/{cuda,CL}
  35.         mkdir -p $pkgdir/etc/OpenCL/vendors
  36.         mkdir -p $pkgdir/etc/X11/xorg.conf.d
  37.         mkdir -p $pkgdir/opt/lib32/usr/lib
  38.         mkdir -p $pkgdir/opt/lib32/usr/lib/tls
  39.         mkdir -p $pkgdir/opt/lib32/usr/lib/vdpau
  40.  
  41.         # Install OpenCL configuration
  42.         install nvidia.icd $pkgdir/etc/OpenCL/vendors
  43.  
  44.         # Install headers
  45.         install -m644 cuda*.h $pkgdir/usr/include/cuda/
  46.         install -m644 cl*.h $pkgdir/usr/include/CL/
  47.         install -m644 gl*.h $pkgdir/usr/include
  48.        
  49.         # Install libraries
  50.         install {libGL,libnvidia-cfg,libnvidia-compiler,libnvidia-glcore,libcuda,tls/libnvidia-tls,libnvidia-wfb}.so.${pkgver} $pkgdir/usr/lib/ || return 1
  51.         install -m755 libvdpau_nvidia.so.${pkgver} "${pkgdir}/usr/lib/vdpau/" || return 1
  52.         install -m755 libOpenCL.so.1.0.0 $pkgdir/usr/lib || return 1
  53.         install {libXvMCNVIDIA.a,libXvMCNVIDIA.so.${pkgver}} $pkgdir/usr/lib/ || return 1
  54.         install nvidia_drv.so $pkgdir/usr/lib/xorg/modules/drivers || return 1
  55.         install libglx.so.$pkgver $pkgdir/usr/lib/xorg/modules/extensions || return 1
  56.    
  57.     # Install 32bit libraries
  58.     install 32/*.so.${pkgver} $pkgdir/opt/lib32/usr/lib/
  59.     install 32/tls/*.so.${pkgver} $pkgdir/opt/lib32/usr/lib/tls/
  60.  
  61.         # Install manpages
  62.         install -m644 nvidia-{settings,xconfig,smi}.1.gz $pkgdir/usr/share/man/man1/ || return 1
  63.  
  64.         # Install license
  65.         install -m644 LICENSE $pkgdir/usr/share/licenses/nvidia/ || return 1
  66.         ln -s nvidia $startdir/pkg/usr/share/licenses/nvidia-utils || return 1
  67.        
  68.         # Install readme
  69.         install -D -m644 README.txt $pkgdir/usr/share/doc/nvidia/README || return 1
  70.        
  71.         # Install .desktop file
  72.         install -m644 nvidia-settings.desktop $pkgdir/usr/share/applications/ || return 1
  73.         # Fix nvidia .desktop file
  74.         sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i $pkgdir/usr/share/applications/nvidia-settings.desktop
  75.  
  76.         # Install pixmaps
  77.         install -m644 nvidia-settings.png $pkgdir/usr/share/pixmaps/ || return 1
  78.        
  79.         # Install binaries
  80.         install -m755 nvidia-{settings,xconfig,smi,bug-report.sh} $pkgdir/usr/bin/ || return 1
  81.  
  82.         # Create symlinks
  83.         cd $pkgdir/usr/lib/
  84.         ln -s libOpenCL.so.1.0.0 libOpenCL.so.1 || return 1
  85.         ln -s libOpenCL.so.1 libOpenCL.so || return 1
  86.         ln -s libGL.so.$pkgver libGL.so.1 || return 1
  87.         ln -s libGL.so.$pkgver libGL.so || return 1
  88.         ln -s libnvidia-glcore.so.$pkgver libnvidia-glcore.so.1 || return 1
  89.         ln -s libnvidia-glcore.so.$pkgver libnvidia-glcore.so || return 1
  90.         ln -s libnvidia-cfg.so.$pkgver libnvidia-cfg.so.1 || return 1
  91.         ln -s libnvidia-cfg.so.$pkgver libnvidia-cfg.so || return 1
  92.         ln -s libnvidia-compiler.so.$pkgver libnvidia-compiler.so.1 || return 1
  93.         ln -s libnvidia-compiler.so.$pkgver libnvidia-compiler.so || return 1
  94.         ln -s libnvidia-tls.so.$pkgver libnvidia-tls.so.1 || return 1
  95.         ln -s libnvidia-tls.so.$pkgver libnvidia-tls.so || return 1
  96.         ln -s libcuda.so.$pkgver libcuda.so.1 || return 1
  97.         ln -s libcuda.so.$pkgver libcuda.so || return 1
  98.         ln -s libvdpau_nvidia.so.$pkgver vdpau/libvdpau_nvidia.so.1 || return 1
  99.         ln -s libvdpau_nvidia.so.$pkgver vdpau/libvdpau_nvidia.so || return 1
  100.         ln -s libXvMCNVIDIA.so.$pkgver libXvMCNVIDIA_dynamic.so.1 || return 1
  101.         cd $pkgdir/usr/lib/xorg/modules/extensions
  102.         ln -s libglx.so.$pkgver libglx.so || return 1
  103.     cd $pkgdir/opt/lib32/usr/lib
  104.         ln -s libOpenCL.so.1.0.0 libOpenCL.so.1 || return 1
  105.         ln -s libOpenCL.so.1 libOpenCL.so || return 1
  106.         ln -s libGL.so.$pkgver libGL.so.1 || return 1
  107.         ln -s libGL.so.$pkgver libGL.so || return 1
  108.         ln -s libnvidia-glcore.so.$pkgver libnvidia-glcore.so.1 || return 1
  109.         ln -s libnvidia-glcore.so.$pkgver libnvidia-glcore.so || return 1
  110.         ln -s libnvidia-compiler.so.$pkgver libnvidia-compiler.so.1 || return 1
  111.         ln -s libnvidia-compiler.so.$pkgver libnvidia-compiler.so || return 1
  112.         ln -s libnvidia-tls.so.$pkgver libnvidia-tls.so.1 || return 1
  113.         ln -s libnvidia-tls.so.$pkgver libnvidia-tls.so || return 1
  114.         ln -s libcuda.so.$pkgver libcuda.so.1 || return 1
  115.         ln -s libcuda.so.$pkgver libcuda.so || return 1
  116.         ln -s libvdpau_nvidia.so.$pkgver vdpau/libvdpau_nvidia.so.1 || return 1
  117.         ln -s libvdpau_nvidia.so.$pkgver vdpau/libvdpau_nvidia.so || return 1
  118.  
  119.         find $pkgdir/usr -type d -exec chmod 755 {} \;
  120.         chmod 644 $pkgdir/usr/lib/libXvMCNVIDIA.a || return 1
  121.  
  122.         # Install nvidia file for xorg autodection
  123.         install -D -m644 $srcdir/20-nvidia.conf $pkgdir/etc/X11/xorg.conf.d/20-nvidia.conf || return 1
  124. }