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

nvidia - PKGBUILD

By: Thaodan on Oct 15th, 2012  |  syntax: Bash  |  size: 1.68 KB  |  views: 203  |  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.  
  5. pkgname=nvidia-bumblebee
  6. pkgver=304.51
  7. _extramodules=extramodules-3.6-ARCH
  8. pkgrel=2
  9. pkgdesc="NVIDIA drivers for linux. Packaged for Bumblebee"
  10. arch=('i686' 'x86_64')
  11. url="http://www.nvidia.com/"
  12. depends=('linux>=3.6' 'linux<3.7' "nvidia-utils-bumblebee=${pkgver}")
  13. provides=("nvidia=${pkgver}")
  14. makedepends=('linux-headers>=3.6' 'linux-headers<3.7')
  15. conflicts=('nvidia' 'nvidia-96xx' 'nvidia-173xx' 'dkms-nvidia')
  16. license=('custom')
  17. install=nvidia.install
  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=('4fde294e139a31528ea7f6efd8885a09')
  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=('2ca10e05cd3b5d2a87caaaad9fd93c06')
  30. fi
  31.  
  32. build() {
  33.     _kernver="$(cat /usr/lib/modules/${_extramodules}/version || true)"
  34.     cd "${srcdir}"
  35.     sh "${_pkg}.run" --extract-only
  36.     cd "${_pkg}/kernel"
  37.     make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
  38. }
  39.  
  40. package() {
  41.     install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
  42.         "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
  43.     install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
  44.     echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nouveau_blacklist.conf"
  45.     sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
  46.     gzip "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
  47. }