2 #NOTE: before building please download FirePro_8.85.7.3_Linux_X32X64_129438.zip using this site:
3 #http://support.amd.com/us/gpudownload/fire/Pages/fire_linux.aspx
4 # and move it next to this PKGBUILD
7 # Maintainer: Vi0L0 <vi0l093@gmail.com>
8 # Great Contributor: Eduardo "kensai" Romero (previous maintainer)
9 # Great Contributor: Shen Miren <dickeny@gmail.com> (build_module/hook idea and code)
13 pkgname=catalyst-firepro
17 pkgdesc="AMD/ATI drivers for FirePro/GL/MV brand cards. catalyst-hook + catalyst-utils + lib32-catalyst-utils"
18 arch=('i686' 'x86_64')
19 url="http://www.ati.amd.com"
21 depends=('xorg-server>=1.7.0' 'xorg-server<1.11.0' 'linux>=3.0' 'linux<3.3' 'linux-headers' 'netkit-bsd-finger' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make')
22 optdepends=('qt: to run ATi Catalyst Control Center (amdcccle)')
23 replaces=('catalyst' 'catalyst-nostock' 'libgl')
24 conflicts=('catalyst' 'catalyst-test' 'catalyst-utils' 'nvidia' 'libgl' 'xf86-video-ati' 'xf86-video-radeonhd' 'ati-dri')
25 provides=("catalyst-utils=${_reldate}" 'libgl' "libatical=${_reldate}" "catalyst=${_reldate}")
27 if [ "${CARCH}" = "x86_64" ]; then
28 warning "x86_64 system detected"
29 warning "[multilib] repository must be uncommented in /etc/pacman.conf to add lib32-catalyst-utils to the package"
30 if [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
31 warning "OK, lib32-catalyst-utils will be added to the package"
32 depends+=('lib32-libxext' 'lib32-libdrm')
33 conflicts+=('lib32-libgl' 'lib32-nvidia-utils' 'lib32-catalyst-utils')
34 replaces+=('lib32-ati-fglrx-utils' 'lib32-fglrx-utils' 'lib32-libgl' 'lib32-catalyst-utils')
35 provides+=('lib32-libgl' "lib32-catalyst-utils=${pkgver}")
37 warning "lib32-catalyst-utils will NOT be added to the package"
41 install=${pkgname}.install
44 http://www2.ati.com/drivers/firepro/FirePro_8.85.7.3_Linux_X32X64_129438.zip
56 md5sums=('78146c50c4e89d40ab60c1d6011a29da'
57 'bdafe749e046bfddee2d1c5e90eabd83'
58 'af7fb8ee4fc96fd54c5b483e33dc71c4'
59 '4efa8414a8fe9eeb50da38b5522ef81d'
60 'f729bf913613f49b0b9759c246058a87'
61 'a1fd06cc63ef1e04b177f4a8b2ac1016'
62 '638a9bc437b2bf5145ede67b36426b1e'
63 '210fd25311893117fa6bd609eda086e1'
64 '3e1b82bd69774ea808da69c983d6a43b'
65 '6a6b2133aa6ef3bcd377731b19c0553a'
66 'eb24250f8e537273bae9dbd79a022d61')
70 msg "Unpacking archive ..."
71 /bin/sh ./fglrx-8.85.7.3/ati-driver-installer-8.85.7.3-x86.x86_64.run --extract archive_files
75 ##catalyst-utils section
76 ## Install userspace tools and libraries
78 install -m755 -d "${pkgdir}/etc/ati"
79 install -m755 -d "${pkgdir}/etc/rc.d"
80 install -m755 -d "${pkgdir}/etc/profile.d"
81 install -m755 -d "${pkgdir}/etc/acpi/events"
82 install -m755 -d "${pkgdir}/etc/security/console.apps"
84 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/dri"
85 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/drivers"
86 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions"
87 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions/fglrx" # since 11.4
88 install -m755 -d "${pkgdir}/usr/lib/xorg/modules/linux"
89 install -m755 -d "${pkgdir}/usr/lib/dri"
90 install -m755 -d "${pkgdir}/usr/lib/fglrx" # since 11.4
92 install -m755 -d "${pkgdir}/usr/bin"
93 install -m755 -d "${pkgdir}/usr/sbin"
95 install -m755 -d "${pkgdir}/usr/include/X11/extensions"
96 install -m755 -d "${pkgdir}/usr/include/GL"
98 install -m755 -d "${pkgdir}/usr/share/applications"
99 install -m755 -d "${pkgdir}/usr/share/ati/amdcccle"
100 install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
101 install -m755 -d "${pkgdir}/usr/share/man/man8"
102 install -m755 -d "${pkgdir}/usr/share/pixmaps"
105 if [ "${CARCH}" = "i686" ]; then
106 cd "${srcdir}/archive_files/xpic/usr/X11R6/lib/modules" || return 1
107 elif [ "${CARCH}" = "x86_64" ]; then
108 cd "${srcdir}/archive_files/xpic_64a/usr/X11R6/lib64/modules" || return 1
111 # *.a added in 11.2, and removed in 11.3...
112 #install -m644 *.a "${pkgdir}/usr/lib/xorg/modules/" || return 1
113 install -m755 *.so "${pkgdir}/usr/lib/xorg/modules/" || return 1
114 install -m755 drivers/*.so "${pkgdir}/usr/lib/xorg/modules/drivers/" || return 1
115 install -m755 linux/*.so "${pkgdir}/usr/lib/xorg/modules/linux/" || return 1
116 #install -m755 extensions/libglx.so "${pkgdir}/usr/lib/xorg/modules/extensions/" || return 1 #before 11.4
117 install -m755 extensions/fglrx/fglrx-libglx.so "${pkgdir}/usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so" || return 1 # since 11.5
118 ln -snf /usr/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so "${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so" # since 11.4
119 #install -m755 extensions/libdri.so "${pkgdir}/usr/lib/xorg/modules/extensions/libdri.ati" || return 1
121 # Controlcenter / libraries
122 if [ "${CARCH}" = "i686" ]; then
123 cd "${srcdir}/archive_files/arch/x86/usr" || return 1
125 elif [ "${CARCH}" = "x86_64" ]; then
126 cd "${srcdir}/archive_files/arch/x86_64/usr" || return 1
130 install -m755 X11R6/bin/* "${pkgdir}/usr/bin/" || return 1
131 install -m755 sbin/* "${pkgdir}/usr/sbin/" || return 1
132 #install -m755 X11R6/${_lib}/*.so* "${pkgdir}/usr/lib/" || return #before 11.4
133 install -m755 X11R6/${_lib}/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/fglrx" || return 1 # since 11.5
134 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/fglrx/libGL.so.1.2" # since 11.4
135 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/fglrx-libGL.so.1.2" # since 11.4
136 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so.1.2" # since 11.4
137 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so.1" # since 11.4
138 ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so" # since 11.4
139 install -m755 X11R6/${_lib}/libAMDXvBA.so.1.0 "${pkgdir}/usr/lib/" || return 1 # since 11.4
140 ln -snf libAMDXvBA.so.1.0 "${pkgdir}/usr/lib/libAMDXvBA.so.1" # since 11.4
141 ln -snf libAMDXvBA.so.1.0 "${pkgdir}/usr/lib/libAMDXvBA.so" # since 11.4
142 install -m755 X11R6/${_lib}/libatiadlxx.so "${pkgdir}/usr/lib/" || return 1 # since 11.4
143 install -m755 X11R6/${_lib}/libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/" || return 1 # since 11.4
144 install -m755 X11R6/${_lib}/libXvBAW.so.1.0 "${pkgdir}/usr/lib/" || return 1 # since 11.4
145 ln -snf libXvBAW.so.1.0 "${pkgdir}/usr/lib/libXvBAW.so.1" # since 11.4
146 ln -snf libXvBAW.so.1.0 "${pkgdir}/usr/lib/libXvBAW.so" # since 11.4
147 install -m644 X11R6/${_lib}/*.a "${pkgdir}/usr/lib/" || return 1
148 install -m644 X11R6/${_lib}/*.cap "${pkgdir}/usr/lib/" || return 1
149 install -m755 X11R6/${_lib}/modules/dri/*.so "${pkgdir}/usr/lib/xorg/modules/dri/" || return 1
150 install -m755 ${_lib}/*.so* "${pkgdir}/usr/lib/" || return 1
152 ## QT libs (only 2 files) - un-comment 2 lines below if you don't want to install qt package
153 # install -m755 -d "${pkgdir}/usr/share/ati/${_lib}"
154 # install -m755 share/ati/${_lib}/*.so* "${pkgdir}/usr/share/ati/${_lib}/" || return 1
156 ln -snf /usr/lib/xorg/modules/dri/fglrx_dri.so ${pkgdir}/usr/lib/dri/fglrx_dri.so
157 ln -snf libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/libfglrx_dm.so.1"
158 ln -snf libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/libfglrx_dm.so"
159 #ln -sf libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so.1" #before 11.4
160 #ln -sf libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so" #before 11.4
161 ln -snf libatiuki.so.1.0 "${pkgdir}/usr/lib/libatiuki.so.1"
162 ln -snf libatiuki.so.1.0 "${pkgdir}/usr/lib/libatiuki.so"
165 cd "${srcdir}"/archive_files/common
166 install -m644 etc/ati/* "${pkgdir}/etc/ati/" || return 1
167 chmod 755 "${pkgdir}/etc/ati/authatieventsd.sh" || return 1
169 #security provided with 10.9, is it working fine?
170 install -m644 etc/security/console.apps/amdcccle-su "${pkgdir}/etc/security/console.apps/" || return 1
172 # *.h removed in 11.3...
173 #install -m644 usr/X11R6/include/X11/extensions/*.h "${pkgdir}/usr/include/X11/extensions/" || return 1
174 install -m644 usr/X11R6/bin/amdupdaterandrconfig "${pkgdir}/usr/bin/" || return 1
175 install -m644 usr/include/GL/*.h "${pkgdir}/usr/include/GL/" || return 1
176 install -m755 usr/sbin/*.sh "${pkgdir}/usr/sbin/" || return 1
177 install -m644 usr/share/ati/amdcccle/* "${pkgdir}/usr/share/ati/amdcccle/" || return 1
178 install -m644 usr/share/icons/*.xpm "${pkgdir}/usr/share/pixmaps/" || return 1
179 install -m644 usr/share/man/man8/*.8 "${pkgdir}/usr/share/man/man8/" || return 1
180 install -m644 "${srcdir}/amdcccle.desktop" "${pkgdir}/usr/share/applications/" || return 1
183 install -m755 usr/share/doc/fglrx/examples/etc/acpi/*.sh "${pkgdir}/etc/acpi/" || return 1
184 sed -i -e 's/usr\/X11R6/usr/g' "${pkgdir}/etc/acpi/ati-powermode.sh" || return 1
185 install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* "${pkgdir}/etc/acpi/events/" || return 1
187 # Add ATI Events Daemon launcher
188 install -m755 "${srcdir}/atieventsd.sh" "${pkgdir}/etc/rc.d/atieventsd" || return 1
190 # thanks to cerebral, we dont need that damned symlink
191 install -m755 "${srcdir}/catalyst.sh" "${pkgdir}/etc/profile.d/" || return 1
194 install -m644 "${srcdir}/archive_files/ATI_LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/" || return 1
197 ##catalyst-hook section
198 if [ "${CARCH}" = "i686" ]; then
199 cd "${srcdir}/archive_files/arch/x86/usr" || return 1
201 elif [ "${CARCH}" = "x86_64" ]; then
202 cd "${srcdir}/archive_files/arch/x86_64/usr" || return 1
206 # Prepare modules source files
208 test "${CARCH}" = "i686" && _archdir=x86
209 cd "${srcdir}/archive_files/"
210 install -m755 -d "${pkgdir}/usr/share/ati/build_mod" || return 1
211 install -m644 common/lib/modules/fglrx/build_mod/*.c \
212 "${pkgdir}/usr/share/ati/build_mod/" || return 1
213 install -m644 common/lib/modules/fglrx/build_mod/*.h \
214 "${pkgdir}/usr/share/ati/build_mod/" || return 1
215 install -m644 common/lib/modules/fglrx/build_mod/2.6.x/Makefile \
216 "${pkgdir}/usr/share/ati/build_mod/" || return 1
217 install -m644 arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a \
218 "${pkgdir}/usr/share/ati/build_mod/" || return 1
219 install -m755 -d "${pkgdir}/usr/bin" || return 1
220 install -m755 "${srcdir}/catalyst_build_module" "${pkgdir}/usr/bin" || return 1
222 # modified ati's make.sh script
223 install -m755 "${srcdir}/ati_make.sh" "${pkgdir}/usr/share/ati/build_mod/" || return 1
225 # makefile patch to choose arch_compat_alloc_user_space or older compat_alloc_user_space
226 # works only in combination with ati_make.sh script
227 install -m644 "${srcdir}/makefile_compat.patch" "${pkgdir}/usr/share/ati/build_mod/" || return 1
229 # patch used when kernel's # CONFIG_BKL is not set
230 install -m644 "${srcdir}/no_bkl.patch" "${pkgdir}/usr/share/ati/build_mod/" || return 1
232 # 2.6.39 patch - in .39 bkl was completely removed
233 install -m644 "${srcdir}/2.6.39_bkl.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
247 ##lib32-catalyst-utils section
248 if [ "${CARCH}" = "x86_64" ] && [[ `cat /etc/pacman.conf | grep -c "#\[multilib]"` = 0 ]]; then
250 install -D -m755 lib32-catalyst.sh ${pkgdir}/etc/profile.d/lib32-catalyst.sh || return 1
252 # Install lib32 libraries
253 cd "${srcdir}/archive_files/arch/x86/usr" || return 1
254 install -dm755 "${pkgdir}/usr/lib32" || return 1
255 install -dm755 "${pkgdir}/usr/lib32/fglrx" || return 1 # since 11.4
256 install -dm755 "${pkgdir}/usr/lib32/xorg/modules/dri" || return 1
257 install -m755 lib/*.so* "${pkgdir}/usr/lib32/" || return 1
259 install -m755 X11R6/lib/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/fglrx" || return 1 # since 11.5
260 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/fglrx/libGL.so.1.2" # since 11.4
261 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/fglrx-libGL.so.1.2" # since 11.4
262 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/libGL.so.1.2" # since 11.4
263 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/libGL.so.1" # since 11.4
264 ln -sf /usr/lib32/fglrx/fglrx-libGL.so.1.2 "${pkgdir}/usr/lib32/libGL.so" # since 11.4
265 install -m755 X11R6/lib/libAMDXvBA.so.1.0 "${pkgdir}/usr/lib32/" || return 1 # since 11.4
266 install -m755 X11R6/lib/libatiadlxx.so "${pkgdir}/usr/lib32/" || return 1 # since 11.4
267 install -m755 X11R6/lib/libfglrx_dm.so.1.0 "${pkgdir}/usr/lib32/" || return 1 # since 11.4
268 install -m755 X11R6/lib/libXvBAW.so.1.0 "${pkgdir}/usr/lib32/" || return 1 # since 11.4
270 install -m755 X11R6/lib/modules/dri/*.so "${pkgdir}/usr/lib32/xorg/modules/dri/" || return 1
272 cd "$pkgdir/usr/lib32/" || return 1
273 ln -sf libfglrx_dm.so.1.0 libfglrx_dm.so.1 || return 1
274 ln -sf libAMDXvBA.so.1.0 libAMDXvBA.so.1 || return 1
275 ln -sf libXvBAW.so.1.0 libXvBAW.so.1 || return 1
276 ln -sf libatiuki.so.1.0 libatiuki.so.1 || return 1
277 ln -sf libatiuki.so.1.0 libatiuki.so || return 1