updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / amdstream / PKGBUILD
blob0a1ce016c678467783e5cac661428688bd468b68
1 # Maintainer: Vojtech Kral <kral.vojtech at gmail>
2 # Contributor: pfdm
3 # Contributor: Vi0L0
4 # Contributor: caust1c
6 # TODO: license in proper dir
9 pkgname=amdstream
10 pkgver=2.6
11 pkgrel=1
12 _profiler_ver=2.4
14 pkgdesc='AMD Accelerated Parallel Processing (APP) SDK, formerly known as ATI Stream, now wtih limited OpenCL 1.2 support'
15 arch=('i686' 'x86_64')
16 url="http://developer.amd.com/sdks/AMDAPPSDK/Pages/default.aspx"
17 license=("custom")
18 install=install
20 provides=('opencl')
21 depends=('libcl' 'libgl' 'llvm' 'gcc-libs' 'mesa' 'glut' 'glew')
22 optdepends=('opencl-headers: for development'
23             'catalyst: for OpenCL on AMD GPU')
24 makedepends=('perl' 'llvm')
26 #Architecture resolution
27 _arch="${CARCH/i6/x}"
28 _bits=${_arch/x86/32}
29 _bits=${_bits/32_/}
30 [ "$CARCH" = 'x86_64' ] && _hash='3042dafb0fbe3e61585b53f23f9d2d568888df01f39cbb12ee74118dca2845ba' \
31                         || _hash='b50516cf4372c61199698bc204fa12feafea83b0c87bfdcd002639422ede7e0f'
33 #Sources
34 source=("http://developer.amd.com/Downloads/AMD-APP-SDK-v${pkgver}-lnx${_bits}.tgz" \
35         '01-implicit-linking.patch')
37 #sha256sums
38 sha256sums=($_hash '25781556b6441c26449e5577ea068eda74fb2dc520004897c64482cedb6fac0e' )
40 _subdir="AMD-APP-SDK-v2.6-RC3-lnx${_bits}"
42 #Install path
43 _ipath='opt/amdstream'
45 build()
47   cd "${srcdir}"
48   tar xf ${_subdir}.tgz
49   cd "${_subdir}"
50   patch -p0 < ../../01-implicit-linking.patch
51   make -j1   # With -j other than one, build fails (at least on ceratin configurations).
54 package()
56   cd "${srcdir}/${_subdir}"
58   #Install SDK
59   mkdir -p "${pkgdir}/${_ipath}"
60   cp -r {glut_notice.txt,docs,include} "${pkgdir}/${_ipath}/"
61   mkdir -p "${pkgdir}/${_ipath}/"{bin,lib,samples/opencl/bin}
62   cp -r "./bin/${_arch}/clinfo" "${pkgdir}/${_ipath}/bin/clinfo"
63   cp -r "./lib/${_arch}/"* "${pkgdir}/${_ipath}/lib/"
64   find ./samples/opencl/ -mindepth 1 -maxdepth 1 -type d -not -name bin -exec cp -r {} "${pkgdir}/${_ipath}/samples/opencl" \;
65   cp -r "./samples/opencl/bin/${_arch}/"* "${pkgdir}/${_ipath}/samples/opencl/bin"
67   #Install Profiler
68   cp "./tools/AMDAPPProfiler-${_profiler_ver}/${_arch}/"* "${pkgdir}/${_ipath}/bin/"
69   cp "./tools/AMDAPPProfiler-${_profiler_ver}/CLPerfMarker/bin/${_arch}/"* "${pkgdir}/${_ipath}/bin/"
70   mkdir -p "${pkgdir}/${_ipath}/docs/AMDAPPProfiler"
71   cp "./tools/AMDAPPProfiler-${_profiler_ver}/html/"* "${pkgdir}/${_ipath}/docs/AMDAPPProfiler/"
72   cp "./tools/AMDAPPProfiler-${_profiler_ver}/AMDAPPProfiler.html" "${pkgdir}/${_ipath}/docs/AMDAPPProfiler-ReleaseNotes.html"
73   mkdir -p "${pkgdir}/usr/bin"
74   ln -s "/${_ipath}/bin/sprofile" "${pkgdir}/usr/bin/sprofile"
76   #Licenses
77   mkdir -p "${pkgdir}/${_ipath}/licenses"
78   mkdir -p "${pkgdir}/usr/share/licenses"
79   install -m644 ./LICENSE-llvm.txt "${pkgdir}/${_ipath}/licenses/"
80   install -m644 ./LICENSE-llvm.txt "${pkgdir}/usr/share/licenses/"
81   install -m644 "./tools/AMDAPPProfiler-${_profiler_ver}/License.txt" "${pkgdir}/${_ipath}/licenses/LICENSE-profiler.txt"
82   install -m644 "./tools/AMDAPPProfiler-${_profiler_ver}/License.txt" "${pkgdir}/usr/share/licenses/LICENSE-profiler.txt"
84   #Register ICD
85   mkdir -p "${pkgdir}/etc/OpenCL/vendors"
86   echo "/${_ipath}/lib/libamdocl${_bits}.so" > "${pkgdir}/etc/OpenCL/vendors/amd.icd"
87   # The OpenCL ICD specifications: http://www.khronos.org/registry/cl/extensions/khr/cl_khr_icd.txt
89   #Install includes
90   mkdir -p "${pkgdir}/usr/include/"{CAL,OpenVideo}
91   install -m644 './include/CAL/'{calcl.h,cal_ext.h,cal_ext_counter.h,cal.h} "${pkgdir}/usr/include/CAL/"
92   install -m644 './include/OpenVideo/'{OVDecode.h,OVDecodeTypes.h} "${pkgdir}/usr/include/OpenVideo/"
94   #Symlink binaries
95   mkdir -p "${pkgdir}/usr/bin"
96   ln -s "/${_ipath}/bin/clinfo" "${pkgdir}/usr/bin/clinfo"
98   #Env vars
99   mkdir -p "${pkgdir}/etc/profile.d"
100   cd "${pkgdir}/etc/profile.d"
101   echo '#!/bin/sh' > amdstream.sh
102   echo "export AMDAPPSDKROOT=/${_ipath}/" >> amdstream.sh
103   echo "export AMDAPPSDKSAMPLESROOT=/${_ipath}/" >> amdstream.sh
105   #Fix modes
106   find "${pkgdir}/${_ipath}/" -type f -exec chmod 644 {} \;
107   chmod 755 "${pkgdir}/${_ipath}/bin/"*
108   chmod 755 "${pkgdir}/${_ipath}/lib/"*
109   find "${pkgdir}/${_ipath}/samples/opencl/bin" -type f -not -name "*.*" -exec chmod 755 {} \;