blob: 604b99bf7c26441dd0d0014391df479753af94e6 (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
# Maintainer: Vi0L0 <vi0l093@gmail.com>
# Previous Maintainer: Michael Krause <mk-arch@spline.de>
# Contributor: kralyk
# Contributor: pfdm
# Contributor: caust1c
# Contributor: kralyk (download execution)
# PKGEXT=".tar.gz" # time to pack this pkg into tar.xz is long, unfortunatelly yaourt got problems when ext is different than .pkg.tar.xz - V
pkgbase=amdapp-sdk
pkgname=('amdapp-sdk' 'amdapp-sdk-opencv' 'amdapp-sdk-nocatalyst' 'amdapp-sdk-docs')
pkgver=3.0
pkgrel=22
arch=('i686' 'x86_64')
url="http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/"
license=("custom")
options=('staticlibs' 'libtool' '!strip' '!upx')
groups=('amdapp')
makedepends=('perl' 'llvm' 'apache-ant' 'wget')
_dirname='AMD-APP-SDKInstaller-v3.0.130.136-GA-linux'
_scriptname='AMD-APP-SDK-v3.0.130.136-GA-linux'
#Architecture resolution
if [ "$CARCH" = 'i686' ]; then
_bits=32
_arch=x86
# _tarbits=x86
# _tarbits=32-1
else _bits=64
_arch=x86_64
# _tarbits=x64
# _tarbits=64
fi
[ "$CARCH" = 'i686' ] && _hash='181fb9815e735c90ca5713acc27a6f9ed7f85135d2f2a085bed7b4c7ed157b94' \
|| _hash='0aa436acd334b686820bd3caab9f09014608741b92e3996d3642d0b148ede0f7'
#Sources
source=(
# "http://developer.amd.com/wordpress/media/files/AMD-APP-SDK-linux-v2.9-1.599.381-GA-${_tarbits}.tar.bz2"
# "http://developer.amd.com/wordpress/media/files/${_dirname}${_bits}.tar.bz2"
'amd.icd'
'amd_i686.icd'
'amdapp-sdk.sh'
'amdapp-sdk.conf')
#sha256sums
sha256sums=(
'0b7465f250f667a240ea4a46ae07e9f193f7ede4975c611fd77b06cb98478169'
'77cb18c5a588e02c73c2406e1057461b6c030b97534154aa3163cbfb9b7e97b7'
'dffe3d16ae07fafe6571c37f97f73e694891a7ea7888fc7f0a5d0e42b997e50f'
'c871a5044dd19e710b9ff058faa4e40f9b825b27d3928d535bc452116dba3b95')
_agr_url='http://developer.amd.com/amd-license-agreement-appsdk/'
_tarball="${_dirname}${_bits}.tar.bz2"
_subdir="${_dirname}${_bits}"
#Install path
_ipath='opt/AMDAPP/SDK'
_wget()
{
wget -c -t 3 --waitretry=3 -O - $@
}
prepare() {
warning "Installing this package means that you have red, understood and ACCEPTED"
warning "the license agreement posted at http://developer.amd.com/amd-license-agreement-appsdk/"
warning ""
warning "will sleep 5 sec to make sure you red it :P"
sleep 5
warning "Download will take not much time and echo some random letters"
if [ ! -e ${_tarball} ]; then
fbase=$(echo -n $_tarball | base64)
echo -n '[nonce1] '
_wget -nv "$url" > 'nonce1'
nonce1=$(sed -n -e "/${fbase}/s/.*_nonce\" value=\"\([[:alnum:]]*\)\".*/\1/p;" 'nonce1')
post_id=$(sed -n -e "/post_id/s/.*value=\"\([[:alnum:]]*\)\".*/\1/p;" 'nonce1' | head -n 1)
echo -n '[nonce2] '
postdata1="amd_developer_central_downloads_page_nonce=${nonce1}&_wp_http_referer=%2Ftools-and-sdks%2Fopencl-zone%2Famd-accelerated-parallel-processing-app-sdk%2F&f=${fbase/=/%3D}&post_id=${post_id}"
nonce2=$(_wget -nv --post-data "${postdata1}" "${_agr_url}" | sed -n -e "/${fbase}/s/.*_nonce\" value=\"\([[:alnum:]]*\)\".*/\1/p;")
echo -n '[tarball] '
postdata2="amd_developer_central_nonce=${nonce2}&_wp_http_referer=%2Famd-license-agreement-appsdk%2F&f=${fbase/=/%3D}"
_wget --post-data "${postdata2}" "${_agr_url}" -O "${_tarball}"
fi
msg "Validating ${_tarball} files with sha256sum ..."
echo "${_hash} ${_tarball}" | sha256sum -c || exit 1
msg "Extracting ${_tarball} ..."
bsdtar -jxf "${_tarball}"
cd ${srcdir}
# tar xf ${_subdir}.tgz
# cd ${_subdir}
# patch -p0 < ../../01-implicit-linking.patch
# patch -p0 < ${srcdir}/02-readlink-include.patch
# . /etc/profile.d/aparapi.sh
}
build() {
#----------- >8 --------------
# cd ${srcdir}/${_subdir}
# # FIXME - dependency has to move into Makefile
# make -j1
#----------- >8 --------------
# bash AMD-APP-SDK-v2.9-1.599.381-GA-linux${_bits}.sh --noexec --target ${srcdir}/${_subdir}
bash ${_scriptname}${_bits}.sh --noexec --target ${srcdir}/${_subdir}
}
package_amdapp-sdk() {
pkgdesc="AMD Accelerated Parallel Processing (APP) SDK, 3.0 with OpenCL 2.0 support."
install=amdapp-sdk.install
provides=('opencl' 'amdstream')
depends=('opencl-icd-loader' 'libgl' 'llvm' 'gcc-libs' 'mesa' 'glut' 'glew' 'glu')
conflicts=('amdstream')
optdepends=(
'opencl-headers: for development'
'catalyst: for OpenCL on AMD GPU'
'libxext: to run some samples'
'libsm: to run some samples'
'libgl: (or nvidia/catalyst-utils) to run some samples'
)
cd ${srcdir}/${_subdir}
#Install SDK
install -m755 -d ${pkgdir}/${_ipath}
cp -r include ${pkgdir}/${_ipath}
install -m755 -d ${pkgdir}/${_ipath}/{bin,samples/opencl/bin,samples/bolt/bin}
cp -r ./bin/${_arch}/* ${pkgdir}/${_ipath}/bin
# cp -r ./lib/${_arch}/* ${pkgdir}/${_ipath}/lib
find ./samples/opencl/ -mindepth 1 -maxdepth 1 -type d -not -name bin -exec cp -r {} ${pkgdir}/${_ipath}/samples/opencl \;
cp -r ./samples/opencl/bin/${_arch}/* ${pkgdir}/${_ipath}/samples/opencl/bin
# Bolt
find ./samples/opencl/ -mindepth 1 -maxdepth 1 -type d -not -name bin -exec cp -r {} ${pkgdir}/${_ipath}/samples/bolt \;
cp -r ./samples/bolt/bin/${_arch}/* ${pkgdir}/${_ipath}/samples/bolt/bin
#----------- >8 --------------
# next 4 lines commented in 2.9.1 -V
# #Install includes
# install -m755 -d ${pkgdir}/usr/include/OpenVideo
# # install -m644 ./include/OpenVideo/{OVDecode.h,OVDecodeTypes.h} ${pkgdir}/usr/include/OpenVideo
# install -m644 ./include/OpenVideo/OpenVideo/* ${pkgdir}/usr/include/OpenVideo # why not this way? V
#Symlink binaries -- doesn't needed? -V
# mkdir -p "${pkgdir}/usr/bin"
# ln -s "/${_ipath}/bin/clinfo" "${pkgdir}/usr/bin/clinfo"
#----------- >8 --------------
#Fix modes
find ${pkgdir}/${_ipath} -type f -exec chmod 644 {} \;
chmod 755 ${pkgdir}/${_ipath}/bin/*
find ${pkgdir}/${_ipath}/samples/opencl/bin -type f -not -name "*.*" -exec chmod 755 {} \;
find ${pkgdir}/${_ipath}/samples/bolt/bin -type f -not -name "*.*" -exec chmod 755 {} \;
#AMDAPPSDKROOT env var
install -m755 -d ${pkgdir}/etc/profile.d
install -m755 ${srcdir}/amdapp-sdk.sh ${pkgdir}/etc/profile.d
sed -i -e "s|PATH|${_ipath}|" ${pkgdir}/etc/profile.d/amdapp-sdk.sh
#License
install -m755 -d ${pkgdir}/usr/share/licenses/amdapp-sdk
install -m644 ${srcdir}/${_subdir}/APPSDK-EULA-linux.txt ${pkgdir}/usr/share/licenses/amdapp-sdk/
}
package_amdapp-sdk-nocatalyst() {
pkgdesc="AMD Accelerated Parallel Processing (APP) SDK, 3.0 with OpenCL 2.0 support. Libs and ICD for non-catalyst users."
install=amdapp-sdk-nocatalyst.install
depends=('amdapp-sdk')
conflicts=('catalyst-utils')
#LDCONF
install -m755 -d ${pkgdir}/etc/ld.so.conf.d
install -m755 ${srcdir}/amdapp-sdk.conf ${pkgdir}/etc/ld.so.conf.d
sed -i -e "s|PATH|${_ipath}|" ${pkgdir}/etc/ld.so.conf.d/amdapp-sdk.conf
#Register ICD
install -m755 -d ${pkgdir}/etc/OpenCL/vendors
if [ "$CARCH" = 'i686' ]; then
install -m755 ${srcdir}/amd_i686.icd ${pkgdir}/etc/OpenCL/vendors/amd.icd
else
install -m755 ${srcdir}/amd.icd ${pkgdir}/etc/OpenCL/vendors
fi
sed -i -e "s|PATH|${_ipath}|" ${pkgdir}/etc/OpenCL/vendors/amd.icd
sed -i -e "s|BITS|${_bits}|" ${pkgdir}/etc/OpenCL/vendors/amd.icd
# The OpenCL ICD specifications: http://www.khronos.org/registry/cl/extensions/khr/cl_khr_icd.txt
#Place libs
install -m755 -d ${pkgdir}/${_ipath}/lib
cp -r ${srcdir}/${_subdir}/lib/${_arch}/* ${pkgdir}/${_ipath}/lib
chmod 755 ${pkgdir}/${_ipath}/lib/*
#License
install -m755 -d ${pkgdir}/usr/share/licenses
ln -s amdapp-sdk ${pkgdir}/usr/share/licenses/${pkgname}
}
package_amdapp-sdk-opencv() {
pkgdesc="AMD Accelerated Parallel Processing (APP) SDK, 3.0 with OpenCL 2.0 support. OpenCVUtils and opencv samples"
depends=('opencl-icd-loader' 'libgl' 'llvm' 'gcc-libs' 'mesa' 'glut' 'glew' 'opencv')
install=amdapp-sdk-opencv.install
cd ${srcdir}/${_subdir}
install -m755 -d ${pkgdir}/${_ipath}/samples/opencv/bin
find ./samples/opencv/ -mindepth 1 -maxdepth 1 -type d -not -name bin -exec cp -r {} ${pkgdir}/${_ipath}/samples/opencv \;
cp -r ./samples/opencv/bin/${_arch}/* ${pkgdir}/${_ipath}/samples/opencv/bin
find ${pkgdir}/${_ipath}/samples/opencv/bin -type f -not -name "*.*" -exec chmod 755 {} \;
#License
install -m755 -d ${pkgdir}/usr/share/licenses
ln -s amdapp-sdk ${pkgdir}/usr/share/licenses/${pkgname}
}
package_amdapp-sdk-docs() {
pkgdesc="AMD Accelerated Parallel Processing (APP) SDK, 3.0 with OpenCL 2.0 support. Documentation"
install=amdapp-sdk-docs.install
cd ${srcdir}/${_subdir}
install -m755 -d ${pkgdir}/usr/share/doc/amdapp-sdk
cp -r ./docs/* ${pkgdir}/usr/share/doc/amdapp-sdk
#License
install -m755 -d ${pkgdir}/usr/share/licenses
ln -s amdapp-sdk ${pkgdir}/usr/share/licenses/${pkgname}
}
|