1 # Maintainer: Vi0L0 <vi0l093@gmail.com>
2 # Great Contributor: Shen Miren <dickeny@gmail.com> (build_module/hook idea and code)
3 # Great Contributor: Eduardo "kensai" Romero (previous catalyst and catalyst-utils maintainer)
4 # Contributor: Manuel Gaul <inkaine@hotmail.com> (previous lib32-catalyst-utils maintainer)
5 # Contributor: osmano807
6 # Contributor: csslayer
7 # Contributor: cyberpatrol
8 # Contributor: aidanlinz
11 # Contributor: Enverex & kidoz
13 PKGEXT='.pkg.tar.gz' # imho time to pack this pkg into tar.xz is too long - V
15 pkgname=catalyst-total
18 pkgdesc="AMD/ATI drivers. catalyst-hook + catalyst-utils + lib32-catalyst-utils"
19 arch=('i686' 'x86_64')
20 url="http://www.ati.amd.com"
22 depends=('linux>=3.0' 'linux<3.3' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.12.0' 'netkit-bsd-finger' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama')
23 optdepends=('qt: to run ATi Catalyst Control Center (amdcccle)'
24 'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
25 'opencl-headers: headers necessary for OpenCL development')
26 replaces=('libgl' 'catalyst' 'catalyst-daemon' 'catalyst-hook' 'catalyst-utils' 'libcl')
27 conflicts=('libgl' 'xf86-video-ati' 'xf86-video-radeonhd' 'ati-dri' 'catalyst-test' 'nvidia-utils' 'nvidia' 'catalyst' 'catalyst-daemon' 'catalyst-generator' 'catalyst-hook' 'catalyst-utils' 'libcl')
28 provides=('libgl' "libatical=${pkgver}" "catalyst=${pkgver}" "catalyst-utils=${pkgver}" "catalyst-hook=${pkgver}" 'libcl')
30 if [ "${CARCH}" = "x86_64" ]; then
31 warning "x86_64 system detected"
32 warning "[multilib] repository must be uncommented in /etc/pacman.conf to add lib32-catalyst-utils into the package"
33 if [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
34 warning "OK, lib32-catalyst-utils will be added to the package"
35 depends+=('lib32-libxext' 'lib32-libdrm')
36 conflicts+=('lib32-libgl' 'lib32-nvidia-utils' 'lib32-catalyst-utils')
37 replaces+=('lib32-libgl' 'lib32-ati-fglrx-utils' 'lib32-fglrx-utils' 'lib32-catalyst-utils')
38 provides+=('lib32-libgl' "lib32-catalyst-utils=${pkgver}")
40 warning "lib32-catalyst-utils will NOT be added to the package"
44 install=${pkgname}.install
47 http://www2.ati.com/drivers/linux/ati-driver-installer-${pkgver/./-}-x86.x86_64.run
55 makefile_compat.patch)
57 md5sums=('15c8148f916b2b9d37a5cbb189c6dda6'
58 'af7fb8ee4fc96fd54c5b483e33dc71c4'
59 'bdafe749e046bfddee2d1c5e90eabd83'
60 '4efa8414a8fe9eeb50da38b5522ef81d'
61 'f729bf913613f49b0b9759c246058a87'
62 '9126e1ef0c724f8b57d3ac0fe77efe2f'
63 'cc5ecffd2e815c3ed05f39753ce6dc53'
64 '210fd25311893117fa6bd609eda086e1'
65 '3e1b82bd69774ea808da69c983d6a43b')
68 /bin/sh ./ati-driver-installer-${pkgver/./-}-x86.x86_64.run --extract archive_files
72 ##catalyst-utils section
73 ## Install userspace tools and libraries
75 install -m755 -d "${pkgdir}/etc/ati"
76 install -m755 -d "${pkgdir}/etc/rc.d"
77 install -m755 -d "${pkgdir}/etc/profile.d"
78 install -m755 -d "${pkgdir}/etc/acpi/events"
79 install -m755 -d "${pkgdir}/etc/security/console.apps"
80 install -m755 -d "${pkgdir}/etc/OpenCL/vendors" # since 11.11
82 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/dri"
83 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/drivers"
84 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions"
85 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions/fglrx"
86 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/linux"
87 install -m755 -d "${pkgdir}/usr/lib/dri"
88 install -m755 -d "${pkgdir}/usr/lib/fglrx"
90 install -m755 -d "${pkgdir}/usr/bin"
91 install -m755 -d "${pkgdir}/usr/sbin"
93 install -m755 -d "${pkgdir}/usr/include/X11/extensions"
94 install -m755 -d "${pkgdir}/usr/include/GL"
96 install -m755 -d "${pkgdir}/usr/share/applications"
97 install -m755 -d "${pkgdir}/usr/share/ati/amdcccle"
98 install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
99 install -m755 -d "${pkgdir}/usr/share/man/man8"
100 install -m755 -d "${pkgdir}/usr/share/pixmaps"
103 if [ "${CARCH}" = "i686" ]; then
104 cd "${srcdir}/archive_files/xpic/usr/X11R6/lib/modules" || return 1
105 elif [ "${CARCH}" = "x86_64" ]; then
106 cd "${srcdir}/archive_files/xpic_64a/usr/X11R6/lib64/modules" || return 1
109 install -m755 *.so "${pkgdir}/usr/lib/xorg/modules/" || return 1
110 install -m755 drivers/*.so "${pkgdir}/usr/lib/xorg/modules/drivers/" || return 1
111 install -m755 linux/*.so "${pkgdir}/usr/lib/xorg/modules/linux/" || return 1
112 install -m755 extensions/fglrx/fglrx-libglx.so "${pkgdir}/usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so" || return 1
113 ln -snf /usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so "${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so"
115 # Controlcenter / libraries
116 if [ "${CARCH}" = "i686" ]; then
117 cd "${srcdir}/archive_files/arch/x86/usr" || return 1
119 elif [ "${CARCH}" = "x86_64" ]; then
120 cd "${srcdir}/archive_files/arch/x86_64/usr" || return 1
124 install -m755 X11R6/bin/* "${pkgdir}/usr/bin/" || return 1
125 install -m755 sbin/* "${pkgdir}/usr/sbin/" || return 1
126 install -m755 X11R6/${_lib}/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/fglrx" || return 1
127 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/fglrx/libGL.so.1.2"
128 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/fglrx-libGL.so.1.2"
129 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so.1.2"
130 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so.1"
131 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so"
132 install -m755 X11R6/${_lib}/libAMDXvBA.so.1.0 "${pkgdir}/usr/lib/" || return 1
133 ln -snf libAMDXvBA.so.1.0 "${pkgdir}/usr/lib/libAMDXvBA.so.1"
134 ln -snf libAMDXvBA.so.1.0 "${pkgdir}/usr/lib/libAMDXvBA.so"
135 install -m755 X11R6/${_lib}/libatiadlxx.so "${pkgdir}/usr/lib/" || return 1
136 install -m755 X11R6/${_lib}/libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/" || return 1
137 install -m755 X11R6/${_lib}/libXvBAW.so.1.0 "${pkgdir}/usr/lib/" || return 1
138 ln -snf libXvBAW.so.1.0 "${pkgdir}/usr/lib/libXvBAW.so.1"
139 ln -snf libXvBAW.so.1.0 "${pkgdir}/usr/lib/libXvBAW.so"
140 install -m644 X11R6/${_lib}/*.a "${pkgdir}/usr/lib/" || return 1
141 install -m644 X11R6/${_lib}/*.cap "${pkgdir}/usr/lib/" || return 1
142 install -m755 X11R6/${_lib}/modules/dri/*.so "${pkgdir}/usr/lib/xorg/modules/dri/" || return 1
143 install -m755 ${_lib}/*.so* "${pkgdir}/usr/lib/" || return 1
145 ## QT libs (only 2 files) - un-comment 2 lines below if you don't want to install qt package
146 # install -m755 -d "${pkgdir}/usr/share/ati/${_lib}"
147 # install -m755 share/ati/${_lib}/*.so* "${pkgdir}/usr/share/ati/${_lib}/" || return 1
149 ln -snf /usr/lib/xorg/modules/dri/fglrx_dri.so ${pkgdir}/usr/lib/dri/fglrx_dri.so
150 ln -snf libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/libfglrx_dm.so.1"
151 ln -snf libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/libfglrx_dm.so"
152 ln -snf libatiuki.so.1.0 "${pkgdir}/usr/lib/libatiuki.so.1"
153 ln -snf libatiuki.so.1.0 "${pkgdir}/usr/lib/libatiuki.so"
154 ln -snf libOpenCL.so.1 "${pkgdir}/usr/lib/libOpenCL.so" # since 11.11
157 cd "${srcdir}"/archive_files/common
158 install -m644 etc/ati/* "${pkgdir}/etc/ati/" || return 1
159 chmod 755 "${pkgdir}/etc/ati/authatieventsd.sh" || return 1
161 #security provided with 10.9, is it working fine?
162 install -m644 etc/security/console.apps/amdcccle-su "${pkgdir}/etc/security/console.apps/" || return 1
164 install -m644 usr/X11R6/bin/amdupdaterandrconfig "${pkgdir}/usr/bin/" || return 1
165 install -m644 usr/include/GL/*.h "${pkgdir}/usr/include/GL/" || return 1
166 install -m755 usr/sbin/*.sh "${pkgdir}/usr/sbin/" || return 1
167 install -m644 usr/share/ati/amdcccle/* "${pkgdir}/usr/share/ati/amdcccle/" || return 1
168 install -m644 usr/share/icons/*.xpm "${pkgdir}/usr/share/pixmaps/" || return 1
169 install -m644 usr/share/man/man8/*.8 "${pkgdir}/usr/share/man/man8/" || return 1
170 install -m644 "${srcdir}/amdcccle.desktop" "${pkgdir}/usr/share/applications/" || return 1
173 install -m755 usr/share/doc/fglrx/examples/etc/acpi/*.sh "${pkgdir}/etc/acpi/" || return 1
174 sed -i -e 's/usr\/X11R6/usr/g' "${pkgdir}/etc/acpi/ati-powermode.sh" || return 1
175 install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* "${pkgdir}/etc/acpi/events/" || return 1
177 # Add ATI Events Daemon launcher
178 install -m755 "${srcdir}/atieventsd.sh" "${pkgdir}/etc/rc.d/atieventsd" || return 1
180 # thanks to cerebral, we dont need that damned symlink
181 install -m755 "${srcdir}/catalyst.sh" "${pkgdir}/etc/profile.d/" || return 1
184 install -m644 "${srcdir}/archive_files/LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/" || return 1
186 # since 11.11 : opencl files
187 if [ "${CARCH}" = "i686" ]; then
188 cd "${srcdir}/archive_files/arch/x86" || return 1
190 elif [ "${CARCH}" = "x86_64" ]; then
191 cd "${srcdir}/archive_files/arch/x86_64" || return 1
195 # since 11.11: amd's vendor file for it's opencl library
196 install -m644 etc/OpenCL/vendors/amdocl${_arc}.icd "${pkgdir}/etc/OpenCL/vendors/" || return 1
198 # since 11.11: clinfo binary
199 install -m755 usr/bin/clinfo "${pkgdir}/usr/bin/" || return 1
202 ##catalyst-hook section
203 if [ "${CARCH}" = "i686" ]; then
204 cd "${srcdir}/archive_files/arch/x86/usr" || return 1
206 elif [ "${CARCH}" = "x86_64" ]; then
207 cd "${srcdir}/archive_files/arch/x86_64/usr" || return 1
211 # Prepare modules source files
213 test "${CARCH}" = "i686" && _archdir=x86
214 cd "${srcdir}/archive_files/"
215 install -m755 -d "${pkgdir}/usr/share/ati/build_mod" || return 1
216 install -m644 common/lib/modules/fglrx/build_mod/*.c \
217 "${pkgdir}/usr/share/ati/build_mod/" || return 1
218 install -m644 common/lib/modules/fglrx/build_mod/*.h \
219 "${pkgdir}/usr/share/ati/build_mod/" || return 1
220 install -m644 common/lib/modules/fglrx/build_mod/2.6.x/Makefile \
221 "${pkgdir}/usr/share/ati/build_mod/" || return 1
222 install -m644 arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a \
223 "${pkgdir}/usr/share/ati/build_mod/" || return 1
224 install -m755 -d "${pkgdir}/usr/bin" || return 1
225 install -m755 "${srcdir}/catalyst_build_module" "${pkgdir}/usr/bin" || return 1
227 # modified ati's make.sh script
228 install -m755 "${srcdir}/ati_make.sh" "${pkgdir}/usr/share/ati/build_mod/" || return 1
230 # makefile patch to choose arch_compat_alloc_user_space or older compat_alloc_user_space
231 # works only in combination with ati_make.sh script
232 install -m644 "${srcdir}/makefile_compat.patch" "${pkgdir}/usr/share/ati/build_mod/" || return 1
236 # for ver in ${patch_ver}; do
237 # install -m644 "${srcdir}/${patch_file}" \
238 # "${pkgdir}/usr/share/ati/build_mod/${ver}.patch" || return 1
242 install -m755 -d "${pkgdir}/lib/initcpio/install" || return 1
243 install -m644 "${srcdir}/hook-fglrx" "${pkgdir}/lib/initcpio/install/fglrx" || return 1
245 ##lib32-catalyst-utils section
246 if [ "${CARCH}" = "x86_64" ] && [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
248 install -D -m755 lib32-catalyst.sh ${pkgdir}/etc/profile.d/lib32-catalyst.sh || return 1
250 # Install lib32 libraries
251 cd "${srcdir}/archive_files/arch/x86/usr" || return 1
252 install -dm755 "${pkgdir}/usr/lib32" || return 1
253 install -dm755 "${pkgdir}/usr/lib32/fglrx" || return 1
254 install -dm755 "${pkgdir}/usr/lib32/xorg/modules/dri" || return 1
255 install -m755 lib/*.so* "${pkgdir}/usr/lib32/" || return 1
257 install -m755 X11R6/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/fglrx" || return 1
258 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/fglrx/libGL.so.1.2"
259 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/fglrx-libGL.so.1.2"
260 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/libGL.so.1.2"
261 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/libGL.so.1"
262 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/libGL.so"
263 install -m755 X11R6/lib/libAMDXvBA.so.1.0 "${pkgdir}/usr/lib32/" || return 1
264 install -m755 X11R6/lib/libatiadlxx.so "${pkgdir}/usr/lib32/" || return 1
265 install -m755 X11R6/lib/libfglrx_dm.so.1.0 "${pkgdir}/usr/lib32/" || return 1
266 install -m755 X11R6/lib/libXvBAW.so.1.0 "${pkgdir}/usr/lib32/" || return 1
268 install -m755 X11R6/lib/modules/dri/*.so "${pkgdir}/usr/lib32/xorg/modules/dri/" || return 1
269 ln -snf /usr/lib32/xorg/modules/dri "${pkgdir}/usr/lib32/dri" || return 1
271 cd "$pkgdir/usr/lib32/" || return 1
272 ln -sf libfglrx_dm.so.1.0 libfglrx_dm.so.1 || return 1
273 ln -sf libAMDXvBA.so.1.0 libAMDXvBA.so.1 || return 1
274 ln -sf libXvBAW.so.1.0 libXvBAW.so.1 || return 1
275 ln -sf libatiuki.so.1.0 libatiuki.so.1 || return 1
276 ln -sf libatiuki.so.1.0 libatiuki.so || return 1
277 ln -sf libOpenCL.so.1 libOpenCL.so || return 1 # since 11.11