1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Contributor: Vojtech "kralyk" Kral

pkgname='libopencl'
pkgver=1.2
pkgrel=1
_amdstream_ver=2.8

pkgdesc='OpenCL library and ICD loader'
arch=('i686' 'x86_64')
url="http://developer.amd.com/sdks/AMDAPPSDK/Pages/default.aspx"
license=("custom")
install='install'

provides=('libcl')
conflicts=('libcl' 'nvidia-utils')

#Architecture resolution & sum
_arch="${CARCH/i6/x}"
_bits=${_arch/x86/32}
_bits=${_bits/32_/}
[ "$CARCH" = 'x86_64' ] && sha256sums=('d9c120367225bb1cd21abbcf77cb0a69cfb4bb6932d0572990104c566aab9681') \
                        || sha256sums=('99610737f21b2f035e0eac4c9e776446cc4378a614c7667de03a82904ab2d356')

#Sources
source=("http://developer.amd.com/wordpress/media/2012/11/AMD-APP-SDK-v${_amdstream_ver}-lnx${_bits}.tgz")

package()
{
  #Extract files
  _inner="AMD-APP-SDK-v2.8-RC-lnx${_bits}"
  bsdtar xf "${_inner}.tgz" "${_inner}/lib/${_arch}/libOpenCL.so.1" "${_inner}/docs/opencl/LICENSES"

  #Install libOpenCL
  install -Dm 755 "${_inner}/lib/${_arch}/libOpenCL.so.1" "${pkgdir}/usr/lib/libOpenCL.so.1"
  ln -s 'libOpenCL.so.1' "${pkgdir}/usr/lib/libOpenCL.so"

  #Install license
  install -Dm 644 "${_inner}/docs/opencl/LICENSES" "${pkgdir}/usr/share/licenses/libopencl/LICENSES"
}