Peaceseeker

lib32-opencl-nvidia

Dec 14th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. # Maintainer: Peace4all <markspost at rocketmail dot com>
  2. # Contributor: Thomas Baechler <[email protected]>
  3. # Contributor: James Rayner <[email protected]>
  4.  
  5. pkgname=lib32-opencl-nvidia
  6. pkgdesc="OpenCL implemention for NVIDIA (32-bit)"
  7. pkgver=313.18
  8. pkgrel=1
  9. arch=('x86_64')
  10. url="http://www.nvidia.com/"
  11. license=('custom')
  12. depends=('zlib' 'opencl-nvidia' 'lib32-nvidia-utils')
  13. optdepends=('opencl-headers: headers necessary for OpenCL development')
  14. options=('!strip')
  15.  
  16. _arch='x86'
  17. _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
  18. source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
  19. md5sums=('780c37c28a6e06e9571cafe348b7da64')
  20.  
  21. create_links() {
  22. # create soname links
  23. while read -d '' _lib; do
  24. _soname="$(dirname "${_lib}")/$(LC_ALL=C readelf -d "${_lib}" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
  25. [[ -e "${_soname}" ]] || ln -s "$(basename "${_lib}")" "${_soname}"
  26. [[ -e "${_soname/.[0-9]*/}" ]] || ln -s "$(basename "${_soname}")" "${_soname/.[0-9]*/}"
  27. done < <(find "${pkgdir}" -type f -name '*.so*' -print0)
  28. }
  29.  
  30. build() {
  31. cd "${srcdir}"
  32. sh "${_pkg}.run" --extract-only
  33. }
  34.  
  35. package() {
  36.  
  37. cd "${srcdir}/${_pkg}"
  38.  
  39. install -D -m755 "libnvidia-opencl.so.${pkgver}" \
  40. "${pkgdir}/usr/lib32/libnvidia-opencl.so.${pkgver}"
  41.  
  42. create_links
  43.  
  44. # create a link to 'libnvidia-compiler.so'
  45. # which is included in the official 'lib32-nvidia-utils' package
  46. # but with no link of its own included in that package ?
  47. # maybe that package should be queried about this.
  48. ln -s "/usr/lib32/libnvidia-compiler.so.${pkgver}" \
  49. "$pkgdir/usr/lib32/libnvidia-compiler.so"
  50. }
Advertisement
Add Comment
Please, Sign In to add comment