1 # Maintainer: Vojtech Kral <kral.vojtech at gmail>
6 # TODO: license in proper dir
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"
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
30 [ "$CARCH" = 'x86_64' ] && _hash='3042dafb0fbe3e61585b53f23f9d2d568888df01f39cbb12ee74118dca2845ba' \
31 || _hash='b50516cf4372c61199698bc204fa12feafea83b0c87bfdcd002639422ede7e0f'
34 source=("http://developer.amd.com/Downloads/AMD-APP-SDK-v${pkgver}-lnx${_bits}.tgz" \
35 '01-implicit-linking.patch')
38 sha256sums=($_hash '25781556b6441c26449e5577ea068eda74fb2dc520004897c64482cedb6fac0e' )
40 _subdir="AMD-APP-SDK-v2.6-RC3-lnx${_bits}"
43 _ipath='opt/amdstream'
50 patch -p0 < ../../01-implicit-linking.patch
51 make -j1 # With -j other than one, build fails (at least on ceratin configurations).
56 cd "${srcdir}/${_subdir}"
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"
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"
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"
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
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/"
95 mkdir -p "${pkgdir}/usr/bin"
96 ln -s "/${_ipath}/bin/clinfo" "${pkgdir}/usr/bin/clinfo"
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
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 {} \;