Want more features on Pastebin? Sign Up, it's FREE!
Guest

nvidia-pf PKGBUILD

By: Thaodan on Nov 17th, 2012  |  syntax: Bash  |  size: 2.74 KB  |  views: 51  |  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. # Maintainer : Luca Bennati <lucak3 AT gmail DOT com>
  2.  
  3. pkgname=nvidia-pf
  4. pkgver=310.19
  5. pkgrel=1
  6. _goodkver=3.6
  7. _badkver=3.7
  8. _kernver=${_goodkver}-pf
  9. _extramodules=extramodules-${_kernver}
  10. _SYSSRC="/usr/lib/modules/${_kernver}/build"
  11. _pf_kernel=$(pacman -Qqo /boot/vmlinuz-linux-pf)
  12. #_pf_headers=$(pacman -Qqo ${_SYSSRC})
  13. _cpu=$(sed -e "s/linux-pf//" <<<${_pf_kernel})
  14.  
  15. pkgdesc="NVIDIA drivers for linux-pf."
  16. arch=('i686' 'x86_64')
  17. url="http://www.nvidia.com/"
  18. makedepends=("linux-pf-headers>=${_goodkver}" "linux-pf-headers<${_badkver}")
  19. depends=("linux-pf>=${_goodkver}" "linux-pf<${_badkver}" "nvidia-utils=${pkgver}")
  20. if [[ ${_cpu} ]]; then
  21.         true && pkgdesc="NVIDIA drivers for linux-pf${_cpu}."
  22.         true && makedepends=("linux-pf-headers${_cpu}>=${_goodkver}" "linux-pf-headers${_cpu}<${_badkver}")
  23.         true && depends=("linux-pf${_cpu}>=${_goodkver}" "linux-pf${_cpu}<${_badkver}" "nvidia-utils=${pkgver}")
  24. fi
  25. conflicts=( 'nvidia-96xx' 'nvidia-173xx' 'nvidia-pf-core2' 'nvidia-pf-k8'
  26.             'nvidia-pf-atom' 'nvidia-pf-psc' 'nvidia-pf-p4' 'nvidia-pf-p3'
  27.             'nvidia-pf-pm' 'nvidia-pf-k7')
  28. license=('custom')
  29. install=nvidia.install
  30. options=(!strip)
  31.  
  32. if [ "$CARCH" = "i686" ]; then
  33.     _arch='x86'
  34.     _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
  35.     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
  36.     md5sums=('2adbdd38540b3a8955714760e05f575d')
  37. elif [ "$CARCH" = "x86_64" ]; then
  38.     _arch='x86_64'
  39.     _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
  40.     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
  41.     md5sums=('0ba08d32852e442ebba5ba22c7abed36')
  42.  
  43. fi
  44.  
  45.  
  46. build() {
  47.     cd "${srcdir}"
  48.     [[ -d "${_pkg}" ]] && rm -rf "${_pkg}"
  49.     sh "${_pkg}.run" --extract-only
  50.     cd "${_pkg}/kernel"
  51.     [[ ${_cpu} ]] && msg "Found optimized linux-pf${_cpu}, building ${pkgname}${_cpu}."
  52.     make SYSSRC=${_SYSSRC} module
  53. }
  54.  
  55. package() {
  56. if [[ ${_cpu} ]]; then
  57.     true && pkgname=${pkgname}${_cpu}
  58.     true && conflicts=(${conflicts[@]/nvidia-pf${_cpu}/} 'nvidia-pf')
  59. fi
  60.     install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
  61.         "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
  62.     install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
  63.     echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia-pf.conf"
  64.     echo "blacklist nvidiafb" >> "${pkgdir}/usr/lib/modprobe.d/nvidia-pf.conf"
  65.     sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" \
  66.             -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
  67.     gzip -9 "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
  68.     install -D -m644 "${srcdir}/${_pkg}/LICENSE" \
  69.         "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  70. }
clone this paste RAW Paste Data