This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

PKGBUILD

By: a guest on May 6th, 2012  |  syntax: None  |  size: 4.28 KB  |  views: 70  |  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. # $Id$
  2. # Maintainer: Samsagax <samsagax@gmail.com>
  3. # Contributor: Thomas Baechler <thomas@archlinux.org>
  4. # Contributor: James Rayner <iphitus@gmail.com>
  5. pkgname=nvidia-utils-bumblebee
  6. #pkgname=('nvidia-utils-bumblebee' 'opencl-nvidia')
  7. pkgver=295.49
  8. pkgrel=0
  9. arch=('i686' 'x86_64')
  10. url="http://www.nvidia.com/"
  11. pkgdesc="NVIDIA drivers utilities and libraries. With LibGL and xorg modules installed in a different directory."
  12. depends=('xorg-server' 'libxvmc')
  13. optdepends=('gtk2: nvidia-settings' 'pkg-config: nvidia-xconfig'
  14.             'opencl-nvidia: OpenCL support')
  15. provides=("nvidia-utils=${pkgver}")
  16. conflicts=('nvidia-utils')
  17. license=('custom')
  18. options=('!strip')
  19.  
  20. if [ "$CARCH" = "i686" ]; then
  21.     _arch='x86'
  22.     _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
  23.     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
  24.     md5sums=('fd998f870d20b30b8d636ffce79d9e6c')
  25. elif [ "$CARCH" = "x86_64" ]; then
  26.     _arch='x86_64'
  27.     _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
  28.     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
  29.     md5sums=('84b92aa6eec13a38e8748264138acc56')
  30. fi
  31.  
  32. create_links() {
  33.     # create soname links
  34.     while read -d '' _lib; do
  35.         _soname="$(dirname "${_lib}")/$(readelf -d "${_lib}" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
  36.         [[ -e "${_soname}" ]] || ln -s "$(basename "${_lib}")" "${_soname}"
  37.         [[ -e "${_soname/.[0-9]*/}" ]] || ln -s "$(basename "${_soname}")" "${_soname/.[0-9]*/}"
  38.     done < <(find "${pkgdir}" -type f -name '*.so*' -print0)
  39. }
  40.  
  41. build() {
  42.     cd "${srcdir}"
  43.     sh "${_pkg}.run" --extract-only
  44. }
  45.  
  46. package() {
  47.     cd "${srcdir}/${_pkg}"
  48.     # X driver
  49.     install -D -m755 nvidia_drv.so "${pkgdir}/usr/lib/xorg/modules/drivers/nvidia_drv.so"
  50.     # GLX extension module for X
  51.     install -D -m755 "libglx.so.${pkgver}" "${pkgdir}/usr/lib/nvidia-bumblebee/xorg/modules/extensions/libglx.so.${pkgver}"
  52.     ln -s "libglx.so.${pkgver}" "${pkgdir}/usr/lib/nvidia-bumblebee/xorg/modules/extensions/libglx.so"  # X doesn't find glx otherwise
  53.     # OpenGL library
  54.     install -D -m755 "libGL.so.${pkgver}" "${pkgdir}/usr/lib/nvidia-bumblebee/libGL.so.${pkgver}"
  55.     # OpenGL core library
  56.     install -D -m755 "libnvidia-glcore.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-glcore.so.${pkgver}"
  57.     # XvMC
  58.     install -D -m644 libXvMCNVIDIA.a "${pkgdir}/usr/lib/libXvMCNVIDIA.a"
  59.     install -D -m755 "libXvMCNVIDIA.so.${pkgver}" "${pkgdir}/usr/lib/libXvMCNVIDIA.so.${pkgver}"
  60.     # VDPAU
  61.     install -D -m755 "libvdpau_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/vdpau/libvdpau_nvidia.so.${pkgver}"
  62.     # nvidia-tls library
  63.     install -D -m755 "tls/libnvidia-tls.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-tls.so.${pkgver}"
  64.     install -D -m755 "libnvidia-cfg.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-cfg.so.${pkgver}"
  65.  
  66.     install -D -m755 "libnvidia-ml.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-ml.so.${pkgver}"
  67.  
  68.     # nvidia-xconfig
  69.     install -D -m755 nvidia-xconfig "${pkgdir}/usr/bin/nvidia-xconfig"
  70.     install -D -m644 nvidia-xconfig.1.gz "${pkgdir}/usr/share/man/man1/nvidia-xconfig.1.gz"
  71.     # nvidia-settings
  72.     install -D -m755 nvidia-settings "${pkgdir}/usr/bin/nvidia-settings"
  73.     install -D -m644 nvidia-settings.1.gz "${pkgdir}/usr/share/man/man1/nvidia-settings.1.gz"
  74.     install -D -m644 nvidia-settings.desktop "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
  75.     install -D -m644 nvidia-settings.png "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"
  76.     sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
  77.     # nvidia-bug-report
  78.     install -D -m755 nvidia-bug-report.sh "${pkgdir}/usr/bin/nvidia-bug-report.sh"
  79.     # nvidia-smi
  80.     install -D -m755 nvidia-smi "${pkgdir}/usr/bin/nvidia-smi"
  81.     install -D -m644 nvidia-smi.1.gz "${pkgdir}/usr/share/man/man1/nvidia-smi.1.gz"
  82.  
  83.  
  84.     install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/nvidia/LICENSE"
  85.     ln -s nvidia "${pkgdir}/usr/share/licenses/nvidia-utils"
  86.     install -D -m644 README.txt "${pkgdir}/usr/share/doc/nvidia/README"
  87.     install -D -m644 NVIDIA_Changelog "${pkgdir}/usr/share/doc/nvidia/NVIDIA_Changelog"
  88.     ln -s nvidia "${pkgdir}/usr/share/doc/nvidia-utils"
  89.  
  90.     create_links
  91. }
clone this paste RAW Paste Data